diff --git a/controller/env/appenv.go b/controller/env/appenv.go index d6273a6cf..c25e22b0e 100644 --- a/controller/env/appenv.go +++ b/controller/env/appenv.go @@ -30,6 +30,10 @@ import ( "github.com/lucsky/cuid" "github.com/michaelquigley/pfxlog" "github.com/openziti/channel/v2" + clientServer "github.com/openziti/edge-api/rest_client_api_server" + clientOperations "github.com/openziti/edge-api/rest_client_api_server/operations" + managementServer "github.com/openziti/edge-api/rest_management_api_server" + managementOperations "github.com/openziti/edge-api/rest_management_api_server/operations" edgeConfig "github.com/openziti/edge/controller/config" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" @@ -39,10 +43,6 @@ import ( "github.com/openziti/edge/events" "github.com/openziti/edge/internal/cert" "github.com/openziti/edge/internal/jwtsigner" - clientServer "github.com/openziti/edge/rest_client_api_server" - clientOperations "github.com/openziti/edge/rest_client_api_server/operations" - managementServer "github.com/openziti/edge/rest_management_api_server" - managementOperations "github.com/openziti/edge/rest_management_api_server/operations" "github.com/openziti/fabric/controller/api" "github.com/openziti/fabric/controller/network" "github.com/openziti/fabric/controller/xctrl" diff --git a/controller/internal/routes/api_session_api_model.go b/controller/internal/routes/api_session_api_model.go index 6813e0416..0d82dc4d0 100644 --- a/controller/internal/routes/api_session_api_model.go +++ b/controller/internal/routes/api_session_api_model.go @@ -20,10 +20,10 @@ import ( "fmt" "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" "net/http" diff --git a/controller/internal/routes/api_session_router.go b/controller/internal/routes/api_session_router.go index 074c45449..79499564f 100644 --- a/controller/internal/routes/api_session_router.go +++ b/controller/internal/routes/api_session_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/api_session" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/api_session" ) func init() { diff --git a/controller/internal/routes/auth_policy_api_model.go b/controller/internal/routes/auth_policy_api_model.go index d499c7889..0f848de36 100644 --- a/controller/internal/routes/auth_policy_api_model.go +++ b/controller/internal/routes/auth_policy_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/auth_policy_router.go b/controller/internal/routes/auth_policy_router.go index 2ad1b2571..ad19e4155 100644 --- a/controller/internal/routes/auth_policy_router.go +++ b/controller/internal/routes/auth_policy_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/auth_policy" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/auth_policy" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/authenticate_router.go b/controller/internal/routes/authenticate_router.go index 7f8e6b5b6..c684b8b2e 100644 --- a/controller/internal/routes/authenticate_router.go +++ b/controller/internal/routes/authenticate_router.go @@ -21,14 +21,14 @@ import ( "github.com/google/uuid" "github.com/michaelquigley/pfxlog" "github.com/mitchellh/mapstructure" + clientApiAuthentication "github.com/openziti/edge-api/rest_client_api_server/operations/authentication" + managementApiAuthentication "github.com/openziti/edge-api/rest_management_api_server/operations/authentication" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - clientApiAuthentication "github.com/openziti/edge/rest_client_api_server/operations/authentication" - managementApiAuthentication "github.com/openziti/edge/rest_management_api_server/operations/authentication" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "github.com/openziti/metrics" "github.com/openziti/sdk-golang/ziti/constants" diff --git a/controller/internal/routes/authenticator_api_model.go b/controller/internal/routes/authenticator_api_model.go index 9cbae8efb..94c44e0f0 100644 --- a/controller/internal/routes/authenticator_api_model.go +++ b/controller/internal/routes/authenticator_api_model.go @@ -19,11 +19,11 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/errorz" "github.com/openziti/foundation/v2/stringz" diff --git a/controller/internal/routes/authenticator_router.go b/controller/internal/routes/authenticator_router.go index 05696af20..724ab5615 100644 --- a/controller/internal/routes/authenticator_router.go +++ b/controller/internal/routes/authenticator_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/authenticator" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/authenticator" "github.com/openziti/fabric/controller/fields" "github.com/openziti/foundation/v2/errorz" "github.com/pkg/errors" diff --git a/controller/internal/routes/base_entity_api_model.go b/controller/internal/routes/base_entity_api_model.go index 249053195..b71b2e1a8 100644 --- a/controller/internal/routes/base_entity_api_model.go +++ b/controller/internal/routes/base_entity_api_model.go @@ -18,7 +18,7 @@ package routes import ( "github.com/go-openapi/strfmt" - "github.com/openziti/edge/rest_model" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/fabric/controller/models" "path" ) @@ -36,7 +36,7 @@ func BaseEntityToRestModel(entity models.Entity, linkFactory LinksFactory) rest_ CreatedAt: &createdAt, UpdatedAt: &updatedAt, Links: linkFactory.Links(entity), - Tags: &tags, + Tags: &tags, } if ret.Tags.SubTags == nil { diff --git a/controller/internal/routes/base_router.go b/controller/internal/routes/base_router.go index 04debea08..10744c7b8 100644 --- a/controller/internal/routes/base_router.go +++ b/controller/internal/routes/base_router.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" edgeApiError "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/api" "github.com/openziti/fabric/controller/apierror" "github.com/openziti/fabric/controller/fields" diff --git a/controller/internal/routes/ca_api_model.go b/controller/internal/routes/ca_api_model.go index ab16a459a..5848ad206 100644 --- a/controller/internal/routes/ca_api_model.go +++ b/controller/internal/routes/ca_api_model.go @@ -21,10 +21,10 @@ import ( "github.com/go-openapi/strfmt" "github.com/google/uuid" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/ca_router.go b/controller/internal/routes/ca_router.go index 0972373e3..e5d389cf5 100644 --- a/controller/internal/routes/ca_router.go +++ b/controller/internal/routes/ca_router.go @@ -23,11 +23,11 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/golang-jwt/jwt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_management_api_server/operations/certificate_authority" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/certificate_authority" "github.com/openziti/fabric/controller/fields" "github.com/openziti/sdk-golang/ziti/config" "github.com/openziti/storage/boltz" diff --git a/controller/internal/routes/config_api_model.go b/controller/internal/routes/config_api_model.go index 00dc34f28..085d9ed3f 100644 --- a/controller/internal/routes/config_api_model.go +++ b/controller/internal/routes/config_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/errorz" "github.com/openziti/foundation/v2/stringz" diff --git a/controller/internal/routes/config_router.go b/controller/internal/routes/config_router.go index 39dcb5ade..861911ff0 100644 --- a/controller/internal/routes/config_router.go +++ b/controller/internal/routes/config_router.go @@ -19,10 +19,10 @@ package routes import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/config" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/config" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/config_type_api_model.go b/controller/internal/routes/config_type_api_model.go index 507940915..7bf1c70a0 100644 --- a/controller/internal/routes/config_type_api_model.go +++ b/controller/internal/routes/config_type_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/config_type_router.go b/controller/internal/routes/config_type_router.go index e430da5da..caca2779c 100644 --- a/controller/internal/routes/config_type_router.go +++ b/controller/internal/routes/config_type_router.go @@ -19,10 +19,10 @@ package routes import ( "github.com/go-openapi/errors" "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/config" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/config" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/current_api_session_api_model.go b/controller/internal/routes/current_api_session_api_model.go index 033864919..e80d81edf 100644 --- a/controller/internal/routes/current_api_session_api_model.go +++ b/controller/internal/routes/current_api_session_api_model.go @@ -20,10 +20,10 @@ import ( "fmt" "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "time" ) diff --git a/controller/internal/routes/current_api_session_router.go b/controller/internal/routes/current_api_session_router.go index aac6d75e6..67675ae3c 100644 --- a/controller/internal/routes/current_api_session_router.go +++ b/controller/internal/routes/current_api_session_router.go @@ -19,12 +19,12 @@ package routes import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" + clientCurrentApiSession "github.com/openziti/edge-api/rest_client_api_server/operations/current_api_session" + managementCurrentApiSession "github.com/openziti/edge-api/rest_management_api_server/operations/current_api_session" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - clientCurrentApiSession "github.com/openziti/edge/rest_client_api_server/operations/current_api_session" - managementCurrentApiSession "github.com/openziti/edge/rest_management_api_server/operations/current_api_session" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/stringz" "net/http" "time" diff --git a/controller/internal/routes/current_identity_api_model.go b/controller/internal/routes/current_identity_api_model.go index 1d928cb96..9d46e8441 100644 --- a/controller/internal/routes/current_identity_api_model.go +++ b/controller/internal/routes/current_identity_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "path" ) diff --git a/controller/internal/routes/current_identity_authenticator_api_model.go b/controller/internal/routes/current_identity_authenticator_api_model.go index ae67bd591..97267d365 100644 --- a/controller/internal/routes/current_identity_authenticator_api_model.go +++ b/controller/internal/routes/current_identity_authenticator_api_model.go @@ -17,8 +17,8 @@ package routes import ( + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/model" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "path" ) diff --git a/controller/internal/routes/current_identity_authenticator_router.go b/controller/internal/routes/current_identity_authenticator_router.go index cdfe28b81..4020c5a26 100644 --- a/controller/internal/routes/current_identity_authenticator_router.go +++ b/controller/internal/routes/current_identity_authenticator_router.go @@ -20,13 +20,13 @@ import ( "crypto/x509" "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" + clientCurrentApiSession "github.com/openziti/edge-api/rest_client_api_server/operations/current_api_session" + managementCurrentApiSession "github.com/openziti/edge-api/rest_management_api_server/operations/current_api_session" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - clientCurrentApiSession "github.com/openziti/edge/rest_client_api_server/operations/current_api_session" - managementCurrentApiSession "github.com/openziti/edge/rest_management_api_server/operations/current_api_session" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/fields" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/errorz" diff --git a/controller/internal/routes/current_identity_router.go b/controller/internal/routes/current_identity_router.go index 963474d5c..6f4b4da47 100644 --- a/controller/internal/routes/current_identity_router.go +++ b/controller/internal/routes/current_identity_router.go @@ -19,14 +19,14 @@ package routes import ( "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" + clientCurrentIdentity "github.com/openziti/edge-api/rest_client_api_server/operations/current_identity" + managementCurrentIdentity "github.com/openziti/edge-api/rest_management_api_server/operations/current_identity" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - clientCurrentIdentity "github.com/openziti/edge/rest_client_api_server/operations/current_identity" - managementCurrentIdentity "github.com/openziti/edge/rest_management_api_server/operations/current_identity" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "github.com/openziti/storage/boltz" "github.com/pkg/errors" diff --git a/controller/internal/routes/database_router.go b/controller/internal/routes/database_router.go index 491178cad..a3a2100ac 100644 --- a/controller/internal/routes/database_router.go +++ b/controller/internal/routes/database_router.go @@ -21,12 +21,12 @@ import ( "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_management_api_server/operations/database" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/database" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/network" "net/http" "sync" diff --git a/controller/internal/routes/edge_router_api_model.go b/controller/internal/routes/edge_router_api_model.go index d6388b45c..abc804b49 100644 --- a/controller/internal/routes/edge_router_api_model.go +++ b/controller/internal/routes/edge_router_api_model.go @@ -24,10 +24,10 @@ import ( "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/edge_router_policy_api_model.go b/controller/internal/routes/edge_router_policy_api_model.go index c509b4a95..28d45b58b 100644 --- a/controller/internal/routes/edge_router_policy_api_model.go +++ b/controller/internal/routes/edge_router_policy_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/edge_router_policy_router.go b/controller/internal/routes/edge_router_policy_router.go index d419de8d4..adf2ee71c 100644 --- a/controller/internal/routes/edge_router_policy_router.go +++ b/controller/internal/routes/edge_router_policy_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/edge_router_policy" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/edge_router_policy" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/edge_router_router.go b/controller/internal/routes/edge_router_router.go index 1049107e8..a2740c8ef 100644 --- a/controller/internal/routes/edge_router_router.go +++ b/controller/internal/routes/edge_router_router.go @@ -18,12 +18,12 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/edge_router" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/edge_router" "github.com/openziti/fabric/controller/fields" "github.com/openziti/fabric/controller/models" "github.com/openziti/storage/ast" diff --git a/controller/internal/routes/enroll_router.go b/controller/internal/routes/enroll_router.go index 767c18872..96a78d9cf 100644 --- a/controller/internal/routes/enroll_router.go +++ b/controller/internal/routes/enroll_router.go @@ -24,15 +24,15 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_client_api_server/operations/enroll" + "github.com/openziti/edge-api/rest_client_api_server/operations/well_known" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" cert2 "github.com/openziti/edge/internal/cert" - "github.com/openziti/edge/rest_client_api_server/operations/enroll" - "github.com/openziti/edge/rest_client_api_server/operations/well_known" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "net/http" "strings" diff --git a/controller/internal/routes/enrollment_api_model.go b/controller/internal/routes/enrollment_api_model.go index 2034096da..398160265 100644 --- a/controller/internal/routes/enrollment_api_model.go +++ b/controller/internal/routes/enrollment_api_model.go @@ -20,10 +20,10 @@ import ( "fmt" "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/enrollment_router.go b/controller/internal/routes/enrollment_router.go index d948a718f..76b3e129a 100644 --- a/controller/internal/routes/enrollment_router.go +++ b/controller/internal/routes/enrollment_router.go @@ -18,12 +18,12 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/enrollment" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/enrollment" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "time" ) diff --git a/controller/internal/routes/external_jwt_signer_api_model.go b/controller/internal/routes/external_jwt_signer_api_model.go index 660b841b2..acc7adb27 100644 --- a/controller/internal/routes/external_jwt_signer_api_model.go +++ b/controller/internal/routes/external_jwt_signer_api_model.go @@ -20,10 +20,10 @@ import ( "fmt" "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/external_jwt_signer_router.go b/controller/internal/routes/external_jwt_signer_router.go index 33e8727ef..75c7543e8 100644 --- a/controller/internal/routes/external_jwt_signer_router.go +++ b/controller/internal/routes/external_jwt_signer_router.go @@ -19,11 +19,11 @@ package routes import ( "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_management_api_server/operations/external_jwt_signer" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/external_jwt_signer" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/identity_api_model.go b/controller/internal/routes/identity_api_model.go index 9cce505ca..fd4c94ca4 100644 --- a/controller/internal/routes/identity_api_model.go +++ b/controller/internal/routes/identity_api_model.go @@ -21,11 +21,11 @@ import ( "github.com/go-openapi/strfmt" "github.com/google/uuid" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" "github.com/openziti/sdk-golang/ziti" diff --git a/controller/internal/routes/identity_router.go b/controller/internal/routes/identity_router.go index f48e76520..78dc57c28 100644 --- a/controller/internal/routes/identity_router.go +++ b/controller/internal/routes/identity_router.go @@ -22,13 +22,13 @@ import ( "github.com/go-openapi/strfmt" "github.com/google/uuid" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_management_api_server/operations/identity" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/identity" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/fields" "github.com/openziti/fabric/controller/models" "github.com/openziti/fabric/logcontext" diff --git a/controller/internal/routes/identity_type_api_model.go b/controller/internal/routes/identity_type_api_model.go index f9e0a8c85..35d620b8d 100644 --- a/controller/internal/routes/identity_type_api_model.go +++ b/controller/internal/routes/identity_type_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" ) diff --git a/controller/internal/routes/identity_type_router.go b/controller/internal/routes/identity_type_router.go index d8d8cef15..6290e4b83 100644 --- a/controller/internal/routes/identity_type_router.go +++ b/controller/internal/routes/identity_type_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/identity" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/identity" ) func init() { diff --git a/controller/internal/routes/posture_check_api_model.go b/controller/internal/routes/posture_check_api_model.go index 848e2c576..dd78b77f1 100644 --- a/controller/internal/routes/posture_check_api_model.go +++ b/controller/internal/routes/posture_check_api_model.go @@ -20,10 +20,10 @@ import ( "fmt" "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" "strings" diff --git a/controller/internal/routes/posture_check_router.go b/controller/internal/routes/posture_check_router.go index 32a03c8a4..3b25ad7c3 100644 --- a/controller/internal/routes/posture_check_router.go +++ b/controller/internal/routes/posture_check_router.go @@ -18,11 +18,11 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/posture_checks" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/posture_checks" "github.com/openziti/fabric/controller/fields" "github.com/openziti/fabric/controller/models" ) diff --git a/controller/internal/routes/posture_check_type_api_model.go b/controller/internal/routes/posture_check_type_api_model.go index 55b3a62db..28474326d 100644 --- a/controller/internal/routes/posture_check_type_api_model.go +++ b/controller/internal/routes/posture_check_type_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" ) diff --git a/controller/internal/routes/posture_check_type_router.go b/controller/internal/routes/posture_check_type_router.go index 98b97f047..e128a57df 100644 --- a/controller/internal/routes/posture_check_type_router.go +++ b/controller/internal/routes/posture_check_type_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/posture_checks" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/posture_checks" ) func init() { diff --git a/controller/internal/routes/posture_data_api_model.go b/controller/internal/routes/posture_data_api_model.go index 1f93e73ea..a352e0ab5 100644 --- a/controller/internal/routes/posture_data_api_model.go +++ b/controller/internal/routes/posture_data_api_model.go @@ -19,9 +19,9 @@ package routes import ( "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" - "github.com/openziti/edge/rest_model" "time" ) diff --git a/controller/internal/routes/posture_response_responder.go b/controller/internal/routes/posture_response_responder.go index cb98704e7..9777f219f 100644 --- a/controller/internal/routes/posture_response_responder.go +++ b/controller/internal/routes/posture_response_responder.go @@ -17,9 +17,9 @@ package routes import ( + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "net/http" ) diff --git a/controller/internal/routes/posture_response_router.go b/controller/internal/routes/posture_response_router.go index 6adf0276b..3b33a888b 100644 --- a/controller/internal/routes/posture_response_router.go +++ b/controller/internal/routes/posture_response_router.go @@ -18,12 +18,12 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_client_api_server/operations/posture_checks" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_client_api_server/operations/posture_checks" - "github.com/openziti/edge/rest_model" "time" ) diff --git a/controller/internal/routes/protocol_router.go b/controller/internal/routes/protocol_router.go index ee1913a65..7b58c0358 100644 --- a/controller/internal/routes/protocol_router.go +++ b/controller/internal/routes/protocol_router.go @@ -18,11 +18,11 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_client_api_server/operations/informational" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_client_api_server/operations/informational" - "github.com/openziti/edge/rest_model" ) func init() { diff --git a/controller/internal/routes/role_attributes_router.go b/controller/internal/routes/role_attributes_router.go index e2318b43e..33ef94ef2 100644 --- a/controller/internal/routes/role_attributes_router.go +++ b/controller/internal/routes/role_attributes_router.go @@ -18,11 +18,11 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/role_attributes" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/role_attributes" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" ) diff --git a/controller/internal/routes/router_api_model.go b/controller/internal/routes/router_api_model.go index 22a4585be..c9579a716 100644 --- a/controller/internal/routes/router_api_model.go +++ b/controller/internal/routes/router_api_model.go @@ -5,10 +5,10 @@ import ( "github.com/go-openapi/strfmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/router_router.go b/controller/internal/routes/router_router.go index fadbfa6a1..13b05baf6 100644 --- a/controller/internal/routes/router_router.go +++ b/controller/internal/routes/router_router.go @@ -18,11 +18,11 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/router" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/router" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/routes.go b/controller/internal/routes/routes.go index b5a0ca99a..ad4dca210 100644 --- a/controller/internal/routes/routes.go +++ b/controller/internal/routes/routes.go @@ -18,9 +18,9 @@ package routes import ( "github.com/go-openapi/strfmt" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/errorz" "net/http" diff --git a/controller/internal/routes/service_api_model.go b/controller/internal/routes/service_api_model.go index 086a51bcf..98057e985 100644 --- a/controller/internal/routes/service_api_model.go +++ b/controller/internal/routes/service_api_model.go @@ -19,11 +19,11 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" "strings" diff --git a/controller/internal/routes/service_edge_router_policy_api_model.go b/controller/internal/routes/service_edge_router_policy_api_model.go index 2e4bc99c2..f11eb5edd 100644 --- a/controller/internal/routes/service_edge_router_policy_api_model.go +++ b/controller/internal/routes/service_edge_router_policy_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/service_edge_router_policy_router.go b/controller/internal/routes/service_edge_router_policy_router.go index 8093b6959..5954ffb44 100644 --- a/controller/internal/routes/service_edge_router_policy_router.go +++ b/controller/internal/routes/service_edge_router_policy_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/service_edge_router_policy" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/service_edge_router_policy" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/service_policy_api_model.go b/controller/internal/routes/service_policy_api_model.go index 4562883f7..11bcdfcaf 100644 --- a/controller/internal/routes/service_policy_api_model.go +++ b/controller/internal/routes/service_policy_api_model.go @@ -19,10 +19,10 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" "github.com/openziti/foundation/v2/stringz" ) diff --git a/controller/internal/routes/service_policy_router.go b/controller/internal/routes/service_policy_router.go index d7a565a7a..41eb74285 100644 --- a/controller/internal/routes/service_policy_router.go +++ b/controller/internal/routes/service_policy_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/service_policy" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/service_policy" "github.com/openziti/fabric/controller/fields" ) diff --git a/controller/internal/routes/service_router.go b/controller/internal/routes/service_router.go index 31404f4a5..c09145fcd 100644 --- a/controller/internal/routes/service_router.go +++ b/controller/internal/routes/service_router.go @@ -20,8 +20,8 @@ import ( "fmt" "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" - clientService "github.com/openziti/edge/rest_client_api_server/operations/service" - managementService "github.com/openziti/edge/rest_management_api_server/operations/service" + clientService "github.com/openziti/edge-api/rest_client_api_server/operations/service" + managementService "github.com/openziti/edge-api/rest_management_api_server/operations/service" "github.com/openziti/fabric/controller/fields" "github.com/openziti/fabric/controller/models" "github.com/openziti/metrics" diff --git a/controller/internal/routes/session_api_model.go b/controller/internal/routes/session_api_model.go index 55eebbccc..feac20c20 100644 --- a/controller/internal/routes/session_api_model.go +++ b/controller/internal/routes/session_api_model.go @@ -21,10 +21,10 @@ import ( "github.com/google/uuid" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" ) diff --git a/controller/internal/routes/session_api_responder.go b/controller/internal/routes/session_api_responder.go index 0755d6a21..197537127 100644 --- a/controller/internal/routes/session_api_responder.go +++ b/controller/internal/routes/session_api_responder.go @@ -17,9 +17,9 @@ package routes import ( + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "net/http" ) diff --git a/controller/internal/routes/session_router.go b/controller/internal/routes/session_router.go index fb297b47b..ccfae010e 100644 --- a/controller/internal/routes/session_router.go +++ b/controller/internal/routes/session_router.go @@ -18,13 +18,13 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_client_api_server/operations/session" + clientSession "github.com/openziti/edge-api/rest_client_api_server/operations/session" + managementSession "github.com/openziti/edge-api/rest_management_api_server/operations/session" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_client_api_server/operations/session" - clientSession "github.com/openziti/edge/rest_client_api_server/operations/session" - managementSession "github.com/openziti/edge/rest_management_api_server/operations/session" - "github.com/openziti/edge/rest_model" "github.com/openziti/metrics" "time" ) diff --git a/controller/internal/routes/spec_router.go b/controller/internal/routes/spec_router.go index aea89f6b7..b6f6e8f03 100644 --- a/controller/internal/routes/spec_router.go +++ b/controller/internal/routes/spec_router.go @@ -21,14 +21,14 @@ import ( "fmt" "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_client_api_server" + clientInformational "github.com/openziti/edge-api/rest_client_api_server/operations/informational" + "github.com/openziti/edge-api/rest_management_api_server" + managementInformational "github.com/openziti/edge-api/rest_management_api_server/operations/informational" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_client_api_server" - clientInformational "github.com/openziti/edge/rest_client_api_server/operations/informational" - "github.com/openziti/edge/rest_management_api_server" - managementInformational "github.com/openziti/edge/rest_management_api_server/operations/informational" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/build" "github.com/openziti/fabric/controller/models" "time" diff --git a/controller/internal/routes/summary_router.go b/controller/internal/routes/summary_router.go index 78e26c46d..a3a03705b 100644 --- a/controller/internal/routes/summary_router.go +++ b/controller/internal/routes/summary_router.go @@ -18,11 +18,11 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/informational" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/informational" - "github.com/openziti/edge/rest_model" ) func init() { diff --git a/controller/internal/routes/terminator_api_model.go b/controller/internal/routes/terminator_api_model.go index 53c94c16c..9d6ac5722 100644 --- a/controller/internal/routes/terminator_api_model.go +++ b/controller/internal/routes/terminator_api_model.go @@ -19,9 +19,9 @@ package routes import ( "fmt" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/api" "github.com/openziti/fabric/controller/models" "github.com/openziti/fabric/controller/network" diff --git a/controller/internal/routes/terminator_router.go b/controller/internal/routes/terminator_router.go index 73cfd92a1..a4eaf5b57 100644 --- a/controller/internal/routes/terminator_router.go +++ b/controller/internal/routes/terminator_router.go @@ -18,10 +18,10 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + "github.com/openziti/edge-api/rest_management_api_server/operations/terminator" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server/operations/terminator" "github.com/openziti/fabric/controller/api_impl" "github.com/openziti/fabric/controller/fields" "github.com/openziti/fabric/controller/network" diff --git a/controller/internal/routes/version_router.go b/controller/internal/routes/version_router.go index 521045ae9..c21ae25f8 100644 --- a/controller/internal/routes/version_router.go +++ b/controller/internal/routes/version_router.go @@ -19,13 +19,13 @@ package routes import ( "github.com/go-openapi/runtime/middleware" + clientInformational "github.com/openziti/edge-api/rest_client_api_server/operations/informational" + managementInformational "github.com/openziti/edge-api/rest_management_api_server/operations/informational" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - clientInformational "github.com/openziti/edge/rest_client_api_server/operations/informational" - managementInformational "github.com/openziti/edge/rest_management_api_server/operations/informational" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/build" "github.com/openziti/xweb/v2" "runtime" diff --git a/controller/model/enrollment_mod_erott.go b/controller/model/enrollment_mod_erott.go index 622fc3237..57e2571d3 100644 --- a/controller/model/enrollment_mod_erott.go +++ b/controller/model/enrollment_mod_erott.go @@ -18,9 +18,9 @@ package model import ( "fmt" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/internal/cert" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "github.com/pkg/errors" "time" diff --git a/controller/model/enrollment_mod_ott.go b/controller/model/enrollment_mod_ott.go index 7e3175c3a..839c99c66 100644 --- a/controller/model/enrollment_mod_ott.go +++ b/controller/model/enrollment_mod_ott.go @@ -18,11 +18,11 @@ package model import ( "encoding/pem" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/eid" "github.com/openziti/edge/internal/cert" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/models" ) diff --git a/controller/model/enrollment_mod_trott.go b/controller/model/enrollment_mod_trott.go index e67a4ce5e..51ed951fa 100644 --- a/controller/model/enrollment_mod_trott.go +++ b/controller/model/enrollment_mod_trott.go @@ -18,9 +18,9 @@ package model import ( "fmt" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/internal/cert" - "github.com/openziti/edge/rest_model" "time" ) diff --git a/controller/response/responder.go b/controller/response/responder.go index 9a2f48f3a..3b23e8fe3 100644 --- a/controller/response/responder.go +++ b/controller/response/responder.go @@ -19,15 +19,15 @@ package response import ( "fmt" "github.com/go-openapi/errors" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/internal/version" - "github.com/openziti/edge/rest_model" "github.com/openziti/fabric/controller/api" "github.com/openziti/fabric/controller/apierror" "github.com/openziti/foundation/v2/errorz" "net/http" ) -//todo: rename to Responder, remove old Responder and RequestResponder +// todo: rename to Responder, remove old Responder and RequestResponder type Responder interface { api.Responder RespondWithOk(data interface{}, meta *rest_model.Meta) diff --git a/controller/server/client-api.go b/controller/server/client-api.go index 8ad6eb145..61cc67107 100644 --- a/controller/server/client-api.go +++ b/controller/server/client-api.go @@ -18,13 +18,13 @@ package server import ( "fmt" + "github.com/openziti/edge-api/rest_client_api_client" + "github.com/openziti/edge-api/rest_client_api_server" + "github.com/openziti/edge-api/rest_management_api_server" "github.com/openziti/edge/controller" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_client_api_client" - "github.com/openziti/edge/rest_client_api_server" - "github.com/openziti/edge/rest_management_api_server" "github.com/openziti/fabric/controller/api" "github.com/openziti/xweb/v2" "github.com/pkg/errors" diff --git a/controller/server/fabric-api.go b/controller/server/fabric-api.go index 5817a46bb..6119dd8c9 100644 --- a/controller/server/fabric-api.go +++ b/controller/server/fabric-api.go @@ -4,10 +4,10 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_management_api_server" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/internal/permissions" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_server" "github.com/openziti/fabric/controller/api" "github.com/openziti/fabric/controller/api_impl" "github.com/openziti/fabric/controller/apierror" diff --git a/controller/server/management-api.go b/controller/server/management-api.go index 084eb5de5..96e6ffabb 100644 --- a/controller/server/management-api.go +++ b/controller/server/management-api.go @@ -18,12 +18,12 @@ package server import ( "fmt" + "github.com/openziti/edge-api/rest_management_api_client" + "github.com/openziti/edge-api/rest_management_api_server" "github.com/openziti/edge/controller" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/controller/env" "github.com/openziti/edge/controller/response" - "github.com/openziti/edge/rest_management_api_client" - "github.com/openziti/edge/rest_management_api_server" "github.com/openziti/fabric/controller/api" "github.com/openziti/xweb/v2" "net/http" diff --git a/go.mod b/go.mod index 16bb22b2e..a0edcc725 100644 --- a/go.mod +++ b/go.mod @@ -14,16 +14,12 @@ require ( github.com/go-openapi/errors v0.20.3 github.com/go-openapi/loads v0.21.2 github.com/go-openapi/runtime v0.25.0 - github.com/go-openapi/spec v0.20.8 github.com/go-openapi/strfmt v0.21.3 - github.com/go-openapi/swag v0.22.3 - github.com/go-openapi/validate v0.22.1 github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/go-cmp v0.5.9 github.com/google/gopacket v1.1.19 github.com/google/uuid v1.3.0 github.com/hashicorp/golang-lru/v2 v2.0.1 - github.com/jessevdk/go-flags v1.5.0 github.com/jinzhu/copier v0.3.5 github.com/kataras/go-events v0.0.3-0.20201007151548-c411dc70c0a6 github.com/lucsky/cuid v1.2.1 @@ -55,7 +51,6 @@ require ( github.com/xeipuuv/gojsonschema v1.2.0 go.etcd.io/bbolt v1.3.6 golang.org/x/crypto v0.5.0 - golang.org/x/net v0.5.0 golang.org/x/sync v0.1.0 golang.org/x/sys v0.4.0 google.golang.org/protobuf v1.28.1 @@ -73,7 +68,7 @@ require ( github.com/boltdb/bolt v1.3.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dineshappavoo/basex v0.0.0-20170425072625-481a6f6dc663 // indirect - github.com/docker/go-units v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/ef-ds/deque v1.0.4 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.13.0 // indirect @@ -83,8 +78,11 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/analysis v0.21.4 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/spec v0.20.8 // indirect + github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/validate v0.22.1 // indirect github.com/go-resty/resty/v2 v2.7.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect @@ -95,6 +93,7 @@ require ( github.com/hashicorp/raft v1.3.11 // indirect github.com/hashicorp/raft-boltdb v0.0.0-20220329195025-15018e9b97e0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/jessevdk/go-flags v1.5.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/josharian/native v1.0.0 // indirect github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect @@ -108,6 +107,7 @@ require ( github.com/natefinch/lumberjack v2.0.0+incompatible // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/openziti/edge-api v0.25.6-0.20230124204917-87f8ac9c70cf // indirect github.com/parallaxsecond/parsec-client-go v0.0.0-20221025095442-f0a77d263cf9 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect @@ -118,12 +118,13 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - go.mongodb.org/mongo-driver v1.10.0 // indirect + go.mongodb.org/mongo-driver v1.11.1 // indirect go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect - go.opentelemetry.io/otel v1.11.1 // indirect - go.opentelemetry.io/otel/trace v1.11.1 // indirect + go.opentelemetry.io/otel v1.11.2 // indirect + go.opentelemetry.io/otel/trace v1.11.2 // indirect golang.org/x/exp v0.0.0-20221217163422-3c43f8badb15 // indirect golang.org/x/mod v0.6.0 // indirect + golang.org/x/net v0.5.0 // indirect golang.org/x/term v0.4.0 // indirect golang.org/x/tools v0.2.0 // indirect ) diff --git a/go.sum b/go.sum index 44d25badb..acf6a6844 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,8 @@ github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3 h1:AqeKSZIG/NIC7 github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3/go.mod h1:hEfFauPHz7+NnjR/yHJGhrKo1Za+zStgwUETx3yzqgY= github.com/dineshappavoo/basex v0.0.0-20170425072625-481a6f6dc663 h1:fctNkSsavbXpt8geFWZb8n+noCqS8MrOXRJ/YfdZ2dQ= github.com/dineshappavoo/basex v0.0.0-20170425072625-481a6f6dc663/go.mod h1:Kad2hux31v/IyD4Rf4wAwIyK48995rs3qAl9IUAhc2k= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/ef-ds/deque v1.0.4 h1:iFAZNmveMT9WERAkqLJ+oaABF9AcVQ5AjXem/hroniI= github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -157,11 +157,13 @@ github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpX github.com/go-openapi/errors v0.20.3 h1:rz6kiC84sqNQoqrtulzaL/VERgkoCyB6WdEkc2ujzUc= github.com/go-openapi/errors v0.20.3/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= @@ -363,8 +365,9 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -451,6 +454,12 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openziti/channel/v2 v2.0.26 h1:IIEnno26FuywcyCwCie1U7OHoB8HzuG95EzEnvtKmio= github.com/openziti/channel/v2 v2.0.26/go.mod h1:zZO0bgVYY9FCDs2EMRakDl6wIfyOWuzgPzPL8EvQ5Ks= +github.com/openziti/edge-api v0.0.0-20230123214913-31bffcdbab62 h1:RKnWfDRb7gcCPhfCM+SaiPQvAYvGOSR/9yXwTYnWUHY= +github.com/openziti/edge-api v0.0.0-20230123214913-31bffcdbab62/go.mod h1:XFiADoiVmGHNzowt6paH5BsyYZW+5KIYNuxwevpzVVo= +github.com/openziti/edge-api v0.25.5 h1:zBBbALZvEPl1PsQ/xKIwkpNMtl/YfPx93zBKsHh94kE= +github.com/openziti/edge-api v0.25.5/go.mod h1:XFiADoiVmGHNzowt6paH5BsyYZW+5KIYNuxwevpzVVo= +github.com/openziti/edge-api v0.25.6-0.20230124204917-87f8ac9c70cf h1:ev+hLgINDVwK8p3LBZMCnEBPAVK9jcfar6M/n1SF5WA= +github.com/openziti/edge-api v0.25.6-0.20230124204917-87f8ac9c70cf/go.mod h1:Ohmiq2Fdz1UXiXIyxGUIPI1gXY3ZVNMiT7urvp8u6xw= github.com/openziti/fabric v0.22.16 h1:hdNJ4v95BOYJnIkEyECwSBccqUtIK6w3B3rvewbWXDo= github.com/openziti/fabric v0.22.16/go.mod h1:0O6wPDXd90rT3QUsVTOPY28GhqnDLFDuJTOAaGJTYOA= github.com/openziti/foundation/v2 v2.0.10 h1:IeOkcPbgBpBTw4JrWz8s9Z76vO/m+i2uIE0cMZ0C2DM= @@ -596,8 +605,9 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3 go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.10.0 h1:UtV6N5k14upNp4LTduX0QCufG124fSu25Wz9tu94GLg= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= +go.mongodb.org/mongo-driver v1.11.1 h1:QP0znIRTuL0jf1oBQoAoM0C6ZJfBK4kx0Uumtv1A7w8= +go.mongodb.org/mongo-driver v1.11.1/go.mod h1:s7p5vEtfbeR1gYi6pnj3c3/urpbLv2T5Sfd6Rp2HBB8= go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 h1:CCriYyAfq1Br1aIYettdHZTy8mBTIPo7We18TuO/bak= go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -607,11 +617,11 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= -go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= +go.opentelemetry.io/otel v1.11.2 h1:YBZcQlsVekzFsFbjygXMOXSs6pialIZxcjfO/mBDmR0= +go.opentelemetry.io/otel v1.11.2/go.mod h1:7p4EUV+AqgdlNV9gL97IgUZiVR3yrFXYo53f9BM3tRI= go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= -go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= -go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= +go.opentelemetry.io/otel/trace v1.11.2 h1:Xf7hWSF2Glv0DE3MH7fBHvtpSBsjcBUe5MYAmZM/+y0= +go.opentelemetry.io/otel/trace v1.11.2/go.mod h1:4N+yC7QEz7TTsG9BSRLNAa63eg5E06ObSbKPmxQ/pKA= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= @@ -1003,6 +1013,7 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/rest_client_api_client/authentication/authenticate_mfa_parameters.go b/rest_client_api_client/authentication/authenticate_mfa_parameters.go deleted file mode 100644 index 4079c1557..000000000 --- a/rest_client_api_client/authentication/authenticate_mfa_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateMfaParams creates a new AuthenticateMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAuthenticateMfaParams() *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAuthenticateMfaParamsWithTimeout creates a new AuthenticateMfaParams object -// with the ability to set a timeout on a request. -func NewAuthenticateMfaParamsWithTimeout(timeout time.Duration) *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - timeout: timeout, - } -} - -// NewAuthenticateMfaParamsWithContext creates a new AuthenticateMfaParams object -// with the ability to set a context for a request. -func NewAuthenticateMfaParamsWithContext(ctx context.Context) *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - Context: ctx, - } -} - -// NewAuthenticateMfaParamsWithHTTPClient creates a new AuthenticateMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewAuthenticateMfaParamsWithHTTPClient(client *http.Client) *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - HTTPClient: client, - } -} - -/* AuthenticateMfaParams contains all the parameters to send to the API endpoint - for the authenticate mfa operation. - - Typically these are written to a http.Request. -*/ -type AuthenticateMfaParams struct { - - /* MfaAuth. - - An MFA validation request - */ - MfaAuth *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the authenticate mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateMfaParams) WithDefaults() *AuthenticateMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the authenticate mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the authenticate mfa params -func (o *AuthenticateMfaParams) WithTimeout(timeout time.Duration) *AuthenticateMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the authenticate mfa params -func (o *AuthenticateMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the authenticate mfa params -func (o *AuthenticateMfaParams) WithContext(ctx context.Context) *AuthenticateMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the authenticate mfa params -func (o *AuthenticateMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the authenticate mfa params -func (o *AuthenticateMfaParams) WithHTTPClient(client *http.Client) *AuthenticateMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the authenticate mfa params -func (o *AuthenticateMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaAuth adds the mfaAuth to the authenticate mfa params -func (o *AuthenticateMfaParams) WithMfaAuth(mfaAuth *rest_model.MfaCode) *AuthenticateMfaParams { - o.SetMfaAuth(mfaAuth) - return o -} - -// SetMfaAuth adds the mfaAuth to the authenticate mfa params -func (o *AuthenticateMfaParams) SetMfaAuth(mfaAuth *rest_model.MfaCode) { - o.MfaAuth = mfaAuth -} - -// WriteToRequest writes these params to a swagger request -func (o *AuthenticateMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.MfaAuth != nil { - if err := r.SetBodyParam(o.MfaAuth); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/authentication/authenticate_mfa_responses.go b/rest_client_api_client/authentication/authenticate_mfa_responses.go deleted file mode 100644 index 066827b90..000000000 --- a/rest_client_api_client/authentication/authenticate_mfa_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateMfaReader is a Reader for the AuthenticateMfa structure. -type AuthenticateMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AuthenticateMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAuthenticateMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewAuthenticateMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewAuthenticateMfaOK creates a AuthenticateMfaOK with default headers values -func NewAuthenticateMfaOK() *AuthenticateMfaOK { - return &AuthenticateMfaOK{} -} - -/* AuthenticateMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type AuthenticateMfaOK struct { - Payload *rest_model.Empty -} - -func (o *AuthenticateMfaOK) Error() string { - return fmt.Sprintf("[POST /authenticate/mfa][%d] authenticateMfaOK %+v", 200, o.Payload) -} -func (o *AuthenticateMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *AuthenticateMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAuthenticateMfaUnauthorized creates a AuthenticateMfaUnauthorized with default headers values -func NewAuthenticateMfaUnauthorized() *AuthenticateMfaUnauthorized { - return &AuthenticateMfaUnauthorized{} -} - -/* AuthenticateMfaUnauthorized describes a response with status code 401, with default header values. - -Base empty response -*/ -type AuthenticateMfaUnauthorized struct { - Payload *rest_model.Empty -} - -func (o *AuthenticateMfaUnauthorized) Error() string { - return fmt.Sprintf("[POST /authenticate/mfa][%d] authenticateMfaUnauthorized %+v", 401, o.Payload) -} -func (o *AuthenticateMfaUnauthorized) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *AuthenticateMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/authentication/authenticate_parameters.go b/rest_client_api_client/authentication/authenticate_parameters.go deleted file mode 100644 index 6ad327cf4..000000000 --- a/rest_client_api_client/authentication/authenticate_parameters.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateParams creates a new AuthenticateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAuthenticateParams() *AuthenticateParams { - return &AuthenticateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAuthenticateParamsWithTimeout creates a new AuthenticateParams object -// with the ability to set a timeout on a request. -func NewAuthenticateParamsWithTimeout(timeout time.Duration) *AuthenticateParams { - return &AuthenticateParams{ - timeout: timeout, - } -} - -// NewAuthenticateParamsWithContext creates a new AuthenticateParams object -// with the ability to set a context for a request. -func NewAuthenticateParamsWithContext(ctx context.Context) *AuthenticateParams { - return &AuthenticateParams{ - Context: ctx, - } -} - -// NewAuthenticateParamsWithHTTPClient creates a new AuthenticateParams object -// with the ability to set a custom HTTPClient for a request. -func NewAuthenticateParamsWithHTTPClient(client *http.Client) *AuthenticateParams { - return &AuthenticateParams{ - HTTPClient: client, - } -} - -/* AuthenticateParams contains all the parameters to send to the API endpoint - for the authenticate operation. - - Typically these are written to a http.Request. -*/ -type AuthenticateParams struct { - - // Auth. - Auth *rest_model.Authenticate - - // Method. - Method string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the authenticate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateParams) WithDefaults() *AuthenticateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the authenticate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the authenticate params -func (o *AuthenticateParams) WithTimeout(timeout time.Duration) *AuthenticateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the authenticate params -func (o *AuthenticateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the authenticate params -func (o *AuthenticateParams) WithContext(ctx context.Context) *AuthenticateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the authenticate params -func (o *AuthenticateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the authenticate params -func (o *AuthenticateParams) WithHTTPClient(client *http.Client) *AuthenticateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the authenticate params -func (o *AuthenticateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuth adds the auth to the authenticate params -func (o *AuthenticateParams) WithAuth(auth *rest_model.Authenticate) *AuthenticateParams { - o.SetAuth(auth) - return o -} - -// SetAuth adds the auth to the authenticate params -func (o *AuthenticateParams) SetAuth(auth *rest_model.Authenticate) { - o.Auth = auth -} - -// WithMethod adds the method to the authenticate params -func (o *AuthenticateParams) WithMethod(method string) *AuthenticateParams { - o.SetMethod(method) - return o -} - -// SetMethod adds the method to the authenticate params -func (o *AuthenticateParams) SetMethod(method string) { - o.Method = method -} - -// WriteToRequest writes these params to a swagger request -func (o *AuthenticateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Auth != nil { - if err := r.SetBodyParam(o.Auth); err != nil { - return err - } - } - - // query param method - qrMethod := o.Method - qMethod := qrMethod - if qMethod != "" { - - if err := r.SetQueryParam("method", qMethod); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/authentication/authenticate_responses.go b/rest_client_api_client/authentication/authenticate_responses.go deleted file mode 100644 index 210eabe0f..000000000 --- a/rest_client_api_client/authentication/authenticate_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateReader is a Reader for the Authenticate structure. -type AuthenticateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AuthenticateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAuthenticateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewAuthenticateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewAuthenticateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewAuthenticateOK creates a AuthenticateOK with default headers values -func NewAuthenticateOK() *AuthenticateOK { - return &AuthenticateOK{} -} - -/* AuthenticateOK describes a response with status code 200, with default header values. - -The API session associated with the session used to issue the request -*/ -type AuthenticateOK struct { - Payload *rest_model.CurrentAPISessionDetailEnvelope -} - -func (o *AuthenticateOK) Error() string { - return fmt.Sprintf("[POST /authenticate][%d] authenticateOK %+v", 200, o.Payload) -} -func (o *AuthenticateOK) GetPayload() *rest_model.CurrentAPISessionDetailEnvelope { - return o.Payload -} - -func (o *AuthenticateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CurrentAPISessionDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAuthenticateBadRequest creates a AuthenticateBadRequest with default headers values -func NewAuthenticateBadRequest() *AuthenticateBadRequest { - return &AuthenticateBadRequest{} -} - -/* AuthenticateBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type AuthenticateBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AuthenticateBadRequest) Error() string { - return fmt.Sprintf("[POST /authenticate][%d] authenticateBadRequest %+v", 400, o.Payload) -} -func (o *AuthenticateBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AuthenticateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAuthenticateForbidden creates a AuthenticateForbidden with default headers values -func NewAuthenticateForbidden() *AuthenticateForbidden { - return &AuthenticateForbidden{} -} - -/* AuthenticateForbidden describes a response with status code 403, with default header values. - -The authentication request could not be processed as the credentials are invalid -*/ -type AuthenticateForbidden struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AuthenticateForbidden) Error() string { - return fmt.Sprintf("[POST /authenticate][%d] authenticateForbidden %+v", 403, o.Payload) -} -func (o *AuthenticateForbidden) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AuthenticateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/authentication/authentication_client.go b/rest_client_api_client/authentication/authentication_client.go deleted file mode 100644 index 7c1ea58bc..000000000 --- a/rest_client_api_client/authentication/authentication_client.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new authentication API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for authentication API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) - - AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Authenticate authenticates via a method supplied via a query string parameter - - Allows authentication Methods include "password" and "cert" - -*/ -func (a *Client) Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAuthenticateParams() - } - op := &runtime.ClientOperation{ - ID: "authenticate", - Method: "POST", - PathPattern: "/authenticate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AuthenticateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AuthenticateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for authenticate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - AuthenticateMfa completes m f a authentication - - Completes MFA authentication by submitting a MFA time based one time token or backup code. -*/ -func (a *Client) AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAuthenticateMfaParams() - } - op := &runtime.ClientOperation{ - ID: "authenticateMfa", - Method: "POST", - PathPattern: "/authenticate/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AuthenticateMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AuthenticateMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for authenticateMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/current_api_session/create_current_api_session_certificate_parameters.go b/rest_client_api_client/current_api_session/create_current_api_session_certificate_parameters.go deleted file mode 100644 index 73c2ab79a..000000000 --- a/rest_client_api_client/current_api_session/create_current_api_session_certificate_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateCurrentAPISessionCertificateParams creates a new CreateCurrentAPISessionCertificateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateCurrentAPISessionCertificateParams() *CreateCurrentAPISessionCertificateParams { - return &CreateCurrentAPISessionCertificateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateCurrentAPISessionCertificateParamsWithTimeout creates a new CreateCurrentAPISessionCertificateParams object -// with the ability to set a timeout on a request. -func NewCreateCurrentAPISessionCertificateParamsWithTimeout(timeout time.Duration) *CreateCurrentAPISessionCertificateParams { - return &CreateCurrentAPISessionCertificateParams{ - timeout: timeout, - } -} - -// NewCreateCurrentAPISessionCertificateParamsWithContext creates a new CreateCurrentAPISessionCertificateParams object -// with the ability to set a context for a request. -func NewCreateCurrentAPISessionCertificateParamsWithContext(ctx context.Context) *CreateCurrentAPISessionCertificateParams { - return &CreateCurrentAPISessionCertificateParams{ - Context: ctx, - } -} - -// NewCreateCurrentAPISessionCertificateParamsWithHTTPClient creates a new CreateCurrentAPISessionCertificateParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateCurrentAPISessionCertificateParamsWithHTTPClient(client *http.Client) *CreateCurrentAPISessionCertificateParams { - return &CreateCurrentAPISessionCertificateParams{ - HTTPClient: client, - } -} - -/* CreateCurrentAPISessionCertificateParams contains all the parameters to send to the API endpoint - for the create current Api session certificate operation. - - Typically these are written to a http.Request. -*/ -type CreateCurrentAPISessionCertificateParams struct { - - /* SessionCertificate. - - The payload describing the CSR used to create a session certificate - */ - SessionCertificate *rest_model.CurrentAPISessionCertificateCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create current Api session certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCurrentAPISessionCertificateParams) WithDefaults() *CreateCurrentAPISessionCertificateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create current Api session certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCurrentAPISessionCertificateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) WithTimeout(timeout time.Duration) *CreateCurrentAPISessionCertificateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) WithContext(ctx context.Context) *CreateCurrentAPISessionCertificateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) WithHTTPClient(client *http.Client) *CreateCurrentAPISessionCertificateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSessionCertificate adds the sessionCertificate to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) WithSessionCertificate(sessionCertificate *rest_model.CurrentAPISessionCertificateCreate) *CreateCurrentAPISessionCertificateParams { - o.SetSessionCertificate(sessionCertificate) - return o -} - -// SetSessionCertificate adds the sessionCertificate to the create current Api session certificate params -func (o *CreateCurrentAPISessionCertificateParams) SetSessionCertificate(sessionCertificate *rest_model.CurrentAPISessionCertificateCreate) { - o.SessionCertificate = sessionCertificate -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateCurrentAPISessionCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.SessionCertificate != nil { - if err := r.SetBodyParam(o.SessionCertificate); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/create_current_api_session_certificate_responses.go b/rest_client_api_client/current_api_session/create_current_api_session_certificate_responses.go deleted file mode 100644 index 92655a3c8..000000000 --- a/rest_client_api_client/current_api_session/create_current_api_session_certificate_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateCurrentAPISessionCertificateReader is a Reader for the CreateCurrentAPISessionCertificate structure. -type CreateCurrentAPISessionCertificateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateCurrentAPISessionCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateCurrentAPISessionCertificateCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateCurrentAPISessionCertificateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateCurrentAPISessionCertificateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateCurrentAPISessionCertificateCreated creates a CreateCurrentAPISessionCertificateCreated with default headers values -func NewCreateCurrentAPISessionCertificateCreated() *CreateCurrentAPISessionCertificateCreated { - return &CreateCurrentAPISessionCertificateCreated{} -} - -/* CreateCurrentAPISessionCertificateCreated describes a response with status code 201, with default header values. - -A response of a create API Session certificate -*/ -type CreateCurrentAPISessionCertificateCreated struct { - Payload *rest_model.CreateCurrentAPISessionCertificateEnvelope -} - -func (o *CreateCurrentAPISessionCertificateCreated) Error() string { - return fmt.Sprintf("[POST /current-api-session/certificates][%d] createCurrentApiSessionCertificateCreated %+v", 201, o.Payload) -} -func (o *CreateCurrentAPISessionCertificateCreated) GetPayload() *rest_model.CreateCurrentAPISessionCertificateEnvelope { - return o.Payload -} - -func (o *CreateCurrentAPISessionCertificateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateCurrentAPISessionCertificateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCurrentAPISessionCertificateBadRequest creates a CreateCurrentAPISessionCertificateBadRequest with default headers values -func NewCreateCurrentAPISessionCertificateBadRequest() *CreateCurrentAPISessionCertificateBadRequest { - return &CreateCurrentAPISessionCertificateBadRequest{} -} - -/* CreateCurrentAPISessionCertificateBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateCurrentAPISessionCertificateBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateCurrentAPISessionCertificateBadRequest) Error() string { - return fmt.Sprintf("[POST /current-api-session/certificates][%d] createCurrentApiSessionCertificateBadRequest %+v", 400, o.Payload) -} -func (o *CreateCurrentAPISessionCertificateBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateCurrentAPISessionCertificateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCurrentAPISessionCertificateUnauthorized creates a CreateCurrentAPISessionCertificateUnauthorized with default headers values -func NewCreateCurrentAPISessionCertificateUnauthorized() *CreateCurrentAPISessionCertificateUnauthorized { - return &CreateCurrentAPISessionCertificateUnauthorized{} -} - -/* CreateCurrentAPISessionCertificateUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateCurrentAPISessionCertificateUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateCurrentAPISessionCertificateUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-api-session/certificates][%d] createCurrentApiSessionCertificateUnauthorized %+v", 401, o.Payload) -} -func (o *CreateCurrentAPISessionCertificateUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateCurrentAPISessionCertificateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/current_api_session_client.go b/rest_client_api_client/current_api_session/current_api_session_client.go deleted file mode 100644 index 576e85d5e..000000000 --- a/rest_client_api_client/current_api_session/current_api_session_client.go +++ /dev/null @@ -1,633 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new current api session API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for current api session API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionOK, error) - - CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCurrentAPISessionCertificateCreated, error) - - DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionCertificateOK, error) - - DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentAPISessionCertificateOK, error) - - DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentIdentityAuthenticatorOK, error) - - ExtendCurrentIdentityAuthenticator(params *ExtendCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendCurrentIdentityAuthenticatorOK, error) - - ExtendVerifyCurrentIdentityAuthenticator(params *ExtendVerifyCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendVerifyCurrentIdentityAuthenticatorOK, error) - - GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentAPISessionOK, error) - - ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentAPISessionCertificatesOK, error) - - ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentIdentityAuthenticatorsOK, error) - - ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceUpdatesOK, error) - - PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCurrentIdentityAuthenticatorOK, error) - - UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCurrentIdentityAuthenticatorOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteCurrentAPISession logouts - - Terminates the current API session -*/ -func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteCurrentAPISessionParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteCurrentAPISession", - Method: "DELETE", - PathPattern: "/current-api-session", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteCurrentAPISessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteCurrentAPISessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteCurrentAPISession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateCurrentAPISessionCertificate creates an ephemeral certificate for the current API session - - Creates an ephemeral certificate for the current API Session. This endpoint expects a PEM encoded CSRs to be provided for fulfillment as a property of a JSON payload. It is up to the client to manage the private key backing the CSR request. -*/ -func (a *Client) CreateCurrentAPISessionCertificate(params *CreateCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCurrentAPISessionCertificateCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateCurrentAPISessionCertificateParams() - } - op := &runtime.ClientOperation{ - ID: "createCurrentApiSessionCertificate", - Method: "POST", - PathPattern: "/current-api-session/certificates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateCurrentAPISessionCertificateReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateCurrentAPISessionCertificateCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createCurrentApiSessionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteCurrentAPISessionCertificate deletes an ephemeral certificate - - Delete an ephemeral certificateby id - -*/ -func (a *Client) DeleteCurrentAPISessionCertificate(params *DeleteCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionCertificateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteCurrentAPISessionCertificateParams() - } - op := &runtime.ClientOperation{ - ID: "deleteCurrentApiSessionCertificate", - Method: "DELETE", - PathPattern: "/current-api-session/certificates/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteCurrentAPISessionCertificateReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteCurrentAPISessionCertificateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteCurrentApiSessionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailCurrentAPISessionCertificate retrieves an ephemeral certificate - - Retrieves a single ephemeral certificate by id -*/ -func (a *Client) DetailCurrentAPISessionCertificate(params *DetailCurrentAPISessionCertificateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentAPISessionCertificateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailCurrentAPISessionCertificateParams() - } - op := &runtime.ClientOperation{ - ID: "detailCurrentApiSessionCertificate", - Method: "GET", - PathPattern: "/current-api-session/certificates/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailCurrentAPISessionCertificateReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailCurrentAPISessionCertificateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailCurrentApiSessionCertificate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailCurrentIdentityAuthenticator retrieves an authenticator for the current identity - - Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity. -*/ -func (a *Client) DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "detailCurrentIdentityAuthenticator", - Method: "GET", - PathPattern: "/current-identity/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExtendCurrentIdentityAuthenticator allows the current identity to recieve a new certificate associated with a certificate based authenticator - - This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled. -Allows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation. -The response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint. -After verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active. -*/ -func (a *Client) ExtendCurrentIdentityAuthenticator(params *ExtendCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExtendCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "extendCurrentIdentityAuthenticator", - Method: "POST", - PathPattern: "/current-identity/authenticators/{id}/extend", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExtendCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExtendCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for extendCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExtendVerifyCurrentIdentityAuthenticator allows the current identity to validate reciept of a new client certificate - - After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt. -After receipt, the new client certificate must be used for new authentication requests. -*/ -func (a *Client) ExtendVerifyCurrentIdentityAuthenticator(params *ExtendVerifyCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendVerifyCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExtendVerifyCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "extendVerifyCurrentIdentityAuthenticator", - Method: "POST", - PathPattern: "/current-identity/authenticators/{id}/extend-verify", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExtendVerifyCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExtendVerifyCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for extendVerifyCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCurrentAPISession returns the current API session - - Retrieves the API session that was used to issue the current request -*/ -func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentAPISessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCurrentAPISessionParams() - } - op := &runtime.ClientOperation{ - ID: "getCurrentAPISession", - Method: "GET", - PathPattern: "/current-api-session", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCurrentAPISessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCurrentAPISessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCurrentAPISession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListCurrentAPISessionCertificates lists the ephemeral certificates available for the current API session - - Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination -*/ -func (a *Client) ListCurrentAPISessionCertificates(params *ListCurrentAPISessionCertificatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentAPISessionCertificatesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListCurrentAPISessionCertificatesParams() - } - op := &runtime.ClientOperation{ - ID: "listCurrentApiSessionCertificates", - Method: "GET", - PathPattern: "/current-api-session/certificates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListCurrentAPISessionCertificatesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListCurrentAPISessionCertificatesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listCurrentApiSessionCertificates: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListCurrentIdentityAuthenticators lists authenticators for the current identity - - Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination. -*/ -func (a *Client) ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentIdentityAuthenticatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListCurrentIdentityAuthenticatorsParams() - } - op := &runtime.ClientOperation{ - ID: "listCurrentIdentityAuthenticators", - Method: "GET", - PathPattern: "/current-identity/authenticators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListCurrentIdentityAuthenticatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListCurrentIdentityAuthenticatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listCurrentIdentityAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceUpdates returns data indicating whether a client should updates it service list - - Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate -service refreshes. - -*/ -func (a *Client) ListServiceUpdates(params *ListServiceUpdatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceUpdatesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceUpdatesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceUpdates", - Method: "GET", - PathPattern: "/current-api-session/service-updates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceUpdatesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceUpdatesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceUpdates: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchCurrentIdentityAuthenticator updates the supplied fields on an authenticator of this identity - - Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API -session's identity. - -*/ -func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "patchCurrentIdentityAuthenticator", - Method: "PATCH", - PathPattern: "/current-identity/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateCurrentIdentityAuthenticator updates all fields on an authenticator of this identity - - Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's -identity. - -*/ -func (a *Client) UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "updateCurrentIdentityAuthenticator", - Method: "PUT", - PathPattern: "/current-identity/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/current_api_session/delete_current_api_session_certificate_parameters.go b/rest_client_api_client/current_api_session/delete_current_api_session_certificate_parameters.go deleted file mode 100644 index 5921b456e..000000000 --- a/rest_client_api_client/current_api_session/delete_current_api_session_certificate_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCurrentAPISessionCertificateParams creates a new DeleteCurrentAPISessionCertificateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteCurrentAPISessionCertificateParams() *DeleteCurrentAPISessionCertificateParams { - return &DeleteCurrentAPISessionCertificateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteCurrentAPISessionCertificateParamsWithTimeout creates a new DeleteCurrentAPISessionCertificateParams object -// with the ability to set a timeout on a request. -func NewDeleteCurrentAPISessionCertificateParamsWithTimeout(timeout time.Duration) *DeleteCurrentAPISessionCertificateParams { - return &DeleteCurrentAPISessionCertificateParams{ - timeout: timeout, - } -} - -// NewDeleteCurrentAPISessionCertificateParamsWithContext creates a new DeleteCurrentAPISessionCertificateParams object -// with the ability to set a context for a request. -func NewDeleteCurrentAPISessionCertificateParamsWithContext(ctx context.Context) *DeleteCurrentAPISessionCertificateParams { - return &DeleteCurrentAPISessionCertificateParams{ - Context: ctx, - } -} - -// NewDeleteCurrentAPISessionCertificateParamsWithHTTPClient creates a new DeleteCurrentAPISessionCertificateParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteCurrentAPISessionCertificateParamsWithHTTPClient(client *http.Client) *DeleteCurrentAPISessionCertificateParams { - return &DeleteCurrentAPISessionCertificateParams{ - HTTPClient: client, - } -} - -/* DeleteCurrentAPISessionCertificateParams contains all the parameters to send to the API endpoint - for the delete current Api session certificate operation. - - Typically these are written to a http.Request. -*/ -type DeleteCurrentAPISessionCertificateParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete current Api session certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCurrentAPISessionCertificateParams) WithDefaults() *DeleteCurrentAPISessionCertificateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete current Api session certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCurrentAPISessionCertificateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) WithTimeout(timeout time.Duration) *DeleteCurrentAPISessionCertificateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) WithContext(ctx context.Context) *DeleteCurrentAPISessionCertificateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) WithHTTPClient(client *http.Client) *DeleteCurrentAPISessionCertificateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) WithID(id string) *DeleteCurrentAPISessionCertificateParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete current Api session certificate params -func (o *DeleteCurrentAPISessionCertificateParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteCurrentAPISessionCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/delete_current_api_session_certificate_responses.go b/rest_client_api_client/current_api_session/delete_current_api_session_certificate_responses.go deleted file mode 100644 index 1d687e523..000000000 --- a/rest_client_api_client/current_api_session/delete_current_api_session_certificate_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCurrentAPISessionCertificateReader is a Reader for the DeleteCurrentAPISessionCertificate structure. -type DeleteCurrentAPISessionCertificateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteCurrentAPISessionCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteCurrentAPISessionCertificateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteCurrentAPISessionCertificateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteCurrentAPISessionCertificateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteCurrentAPISessionCertificateOK creates a DeleteCurrentAPISessionCertificateOK with default headers values -func NewDeleteCurrentAPISessionCertificateOK() *DeleteCurrentAPISessionCertificateOK { - return &DeleteCurrentAPISessionCertificateOK{} -} - -/* DeleteCurrentAPISessionCertificateOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteCurrentAPISessionCertificateOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteCurrentAPISessionCertificateOK) Error() string { - return fmt.Sprintf("[DELETE /current-api-session/certificates/{id}][%d] deleteCurrentApiSessionCertificateOK %+v", 200, o.Payload) -} -func (o *DeleteCurrentAPISessionCertificateOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteCurrentAPISessionCertificateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCurrentAPISessionCertificateBadRequest creates a DeleteCurrentAPISessionCertificateBadRequest with default headers values -func NewDeleteCurrentAPISessionCertificateBadRequest() *DeleteCurrentAPISessionCertificateBadRequest { - return &DeleteCurrentAPISessionCertificateBadRequest{} -} - -/* DeleteCurrentAPISessionCertificateBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteCurrentAPISessionCertificateBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteCurrentAPISessionCertificateBadRequest) Error() string { - return fmt.Sprintf("[DELETE /current-api-session/certificates/{id}][%d] deleteCurrentApiSessionCertificateBadRequest %+v", 400, o.Payload) -} -func (o *DeleteCurrentAPISessionCertificateBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteCurrentAPISessionCertificateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCurrentAPISessionCertificateUnauthorized creates a DeleteCurrentAPISessionCertificateUnauthorized with default headers values -func NewDeleteCurrentAPISessionCertificateUnauthorized() *DeleteCurrentAPISessionCertificateUnauthorized { - return &DeleteCurrentAPISessionCertificateUnauthorized{} -} - -/* DeleteCurrentAPISessionCertificateUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteCurrentAPISessionCertificateUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteCurrentAPISessionCertificateUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /current-api-session/certificates/{id}][%d] deleteCurrentApiSessionCertificateUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteCurrentAPISessionCertificateUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteCurrentAPISessionCertificateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/delete_current_api_session_parameters.go b/rest_client_api_client/current_api_session/delete_current_api_session_parameters.go deleted file mode 100644 index eafb99cf7..000000000 --- a/rest_client_api_client/current_api_session/delete_current_api_session_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCurrentAPISessionParams creates a new DeleteCurrentAPISessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteCurrentAPISessionParams() *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteCurrentAPISessionParamsWithTimeout creates a new DeleteCurrentAPISessionParams object -// with the ability to set a timeout on a request. -func NewDeleteCurrentAPISessionParamsWithTimeout(timeout time.Duration) *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - timeout: timeout, - } -} - -// NewDeleteCurrentAPISessionParamsWithContext creates a new DeleteCurrentAPISessionParams object -// with the ability to set a context for a request. -func NewDeleteCurrentAPISessionParamsWithContext(ctx context.Context) *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - Context: ctx, - } -} - -// NewDeleteCurrentAPISessionParamsWithHTTPClient creates a new DeleteCurrentAPISessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteCurrentAPISessionParamsWithHTTPClient(client *http.Client) *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - HTTPClient: client, - } -} - -/* DeleteCurrentAPISessionParams contains all the parameters to send to the API endpoint - for the delete current API session operation. - - Typically these are written to a http.Request. -*/ -type DeleteCurrentAPISessionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCurrentAPISessionParams) WithDefaults() *DeleteCurrentAPISessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCurrentAPISessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete current API session params -func (o *DeleteCurrentAPISessionParams) WithTimeout(timeout time.Duration) *DeleteCurrentAPISessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete current API session params -func (o *DeleteCurrentAPISessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete current API session params -func (o *DeleteCurrentAPISessionParams) WithContext(ctx context.Context) *DeleteCurrentAPISessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete current API session params -func (o *DeleteCurrentAPISessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete current API session params -func (o *DeleteCurrentAPISessionParams) WithHTTPClient(client *http.Client) *DeleteCurrentAPISessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete current API session params -func (o *DeleteCurrentAPISessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteCurrentAPISessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/delete_current_api_session_responses.go b/rest_client_api_client/current_api_session/delete_current_api_session_responses.go deleted file mode 100644 index fe6773d1c..000000000 --- a/rest_client_api_client/current_api_session/delete_current_api_session_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCurrentAPISessionReader is a Reader for the DeleteCurrentAPISession structure. -type DeleteCurrentAPISessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteCurrentAPISessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteCurrentAPISessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteCurrentAPISessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteCurrentAPISessionOK creates a DeleteCurrentAPISessionOK with default headers values -func NewDeleteCurrentAPISessionOK() *DeleteCurrentAPISessionOK { - return &DeleteCurrentAPISessionOK{} -} - -/* DeleteCurrentAPISessionOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DeleteCurrentAPISessionOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteCurrentAPISessionOK) Error() string { - return fmt.Sprintf("[DELETE /current-api-session][%d] deleteCurrentApiSessionOK %+v", 200, o.Payload) -} -func (o *DeleteCurrentAPISessionOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteCurrentAPISessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCurrentAPISessionUnauthorized creates a DeleteCurrentAPISessionUnauthorized with default headers values -func NewDeleteCurrentAPISessionUnauthorized() *DeleteCurrentAPISessionUnauthorized { - return &DeleteCurrentAPISessionUnauthorized{} -} - -/* DeleteCurrentAPISessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteCurrentAPISessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteCurrentAPISessionUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /current-api-session][%d] deleteCurrentApiSessionUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteCurrentAPISessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteCurrentAPISessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/detail_current_api_session_certificate_parameters.go b/rest_client_api_client/current_api_session/detail_current_api_session_certificate_parameters.go deleted file mode 100644 index 866fca43a..000000000 --- a/rest_client_api_client/current_api_session/detail_current_api_session_certificate_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailCurrentAPISessionCertificateParams creates a new DetailCurrentAPISessionCertificateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailCurrentAPISessionCertificateParams() *DetailCurrentAPISessionCertificateParams { - return &DetailCurrentAPISessionCertificateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailCurrentAPISessionCertificateParamsWithTimeout creates a new DetailCurrentAPISessionCertificateParams object -// with the ability to set a timeout on a request. -func NewDetailCurrentAPISessionCertificateParamsWithTimeout(timeout time.Duration) *DetailCurrentAPISessionCertificateParams { - return &DetailCurrentAPISessionCertificateParams{ - timeout: timeout, - } -} - -// NewDetailCurrentAPISessionCertificateParamsWithContext creates a new DetailCurrentAPISessionCertificateParams object -// with the ability to set a context for a request. -func NewDetailCurrentAPISessionCertificateParamsWithContext(ctx context.Context) *DetailCurrentAPISessionCertificateParams { - return &DetailCurrentAPISessionCertificateParams{ - Context: ctx, - } -} - -// NewDetailCurrentAPISessionCertificateParamsWithHTTPClient creates a new DetailCurrentAPISessionCertificateParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailCurrentAPISessionCertificateParamsWithHTTPClient(client *http.Client) *DetailCurrentAPISessionCertificateParams { - return &DetailCurrentAPISessionCertificateParams{ - HTTPClient: client, - } -} - -/* DetailCurrentAPISessionCertificateParams contains all the parameters to send to the API endpoint - for the detail current Api session certificate operation. - - Typically these are written to a http.Request. -*/ -type DetailCurrentAPISessionCertificateParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail current Api session certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCurrentAPISessionCertificateParams) WithDefaults() *DetailCurrentAPISessionCertificateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail current Api session certificate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCurrentAPISessionCertificateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) WithTimeout(timeout time.Duration) *DetailCurrentAPISessionCertificateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) WithContext(ctx context.Context) *DetailCurrentAPISessionCertificateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) WithHTTPClient(client *http.Client) *DetailCurrentAPISessionCertificateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) WithID(id string) *DetailCurrentAPISessionCertificateParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail current Api session certificate params -func (o *DetailCurrentAPISessionCertificateParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailCurrentAPISessionCertificateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/detail_current_api_session_certificate_responses.go b/rest_client_api_client/current_api_session/detail_current_api_session_certificate_responses.go deleted file mode 100644 index b2766fdd6..000000000 --- a/rest_client_api_client/current_api_session/detail_current_api_session_certificate_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailCurrentAPISessionCertificateReader is a Reader for the DetailCurrentAPISessionCertificate structure. -type DetailCurrentAPISessionCertificateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailCurrentAPISessionCertificateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailCurrentAPISessionCertificateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailCurrentAPISessionCertificateUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailCurrentAPISessionCertificateNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailCurrentAPISessionCertificateOK creates a DetailCurrentAPISessionCertificateOK with default headers values -func NewDetailCurrentAPISessionCertificateOK() *DetailCurrentAPISessionCertificateOK { - return &DetailCurrentAPISessionCertificateOK{} -} - -/* DetailCurrentAPISessionCertificateOK describes a response with status code 200, with default header values. - -A response containing a single API Session certificate -*/ -type DetailCurrentAPISessionCertificateOK struct { - Payload *rest_model.DetailCurrentAPISessionCertificateEnvelope -} - -func (o *DetailCurrentAPISessionCertificateOK) Error() string { - return fmt.Sprintf("[GET /current-api-session/certificates/{id}][%d] detailCurrentApiSessionCertificateOK %+v", 200, o.Payload) -} -func (o *DetailCurrentAPISessionCertificateOK) GetPayload() *rest_model.DetailCurrentAPISessionCertificateEnvelope { - return o.Payload -} - -func (o *DetailCurrentAPISessionCertificateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailCurrentAPISessionCertificateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCurrentAPISessionCertificateUnauthorized creates a DetailCurrentAPISessionCertificateUnauthorized with default headers values -func NewDetailCurrentAPISessionCertificateUnauthorized() *DetailCurrentAPISessionCertificateUnauthorized { - return &DetailCurrentAPISessionCertificateUnauthorized{} -} - -/* DetailCurrentAPISessionCertificateUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailCurrentAPISessionCertificateUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCurrentAPISessionCertificateUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-api-session/certificates/{id}][%d] detailCurrentApiSessionCertificateUnauthorized %+v", 401, o.Payload) -} -func (o *DetailCurrentAPISessionCertificateUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCurrentAPISessionCertificateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCurrentAPISessionCertificateNotFound creates a DetailCurrentAPISessionCertificateNotFound with default headers values -func NewDetailCurrentAPISessionCertificateNotFound() *DetailCurrentAPISessionCertificateNotFound { - return &DetailCurrentAPISessionCertificateNotFound{} -} - -/* DetailCurrentAPISessionCertificateNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailCurrentAPISessionCertificateNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCurrentAPISessionCertificateNotFound) Error() string { - return fmt.Sprintf("[GET /current-api-session/certificates/{id}][%d] detailCurrentApiSessionCertificateNotFound %+v", 404, o.Payload) -} -func (o *DetailCurrentAPISessionCertificateNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCurrentAPISessionCertificateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/detail_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/detail_current_identity_authenticator_parameters.go deleted file mode 100644 index 25eee1aae..000000000 --- a/rest_client_api_client/current_api_session/detail_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailCurrentIdentityAuthenticatorParams creates a new DetailCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailCurrentIdentityAuthenticatorParams() *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailCurrentIdentityAuthenticatorParamsWithTimeout creates a new DetailCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewDetailCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewDetailCurrentIdentityAuthenticatorParamsWithContext creates a new DetailCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewDetailCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewDetailCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new DetailCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* DetailCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the detail current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type DetailCurrentIdentityAuthenticatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCurrentIdentityAuthenticatorParams) WithDefaults() *DetailCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *DetailCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *DetailCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *DetailCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithID(id string) *DetailCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/detail_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/detail_current_identity_authenticator_responses.go deleted file mode 100644 index 707e09eef..000000000 --- a/rest_client_api_client/current_api_session/detail_current_identity_authenticator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailCurrentIdentityAuthenticatorReader is a Reader for the DetailCurrentIdentityAuthenticator structure. -type DetailCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailCurrentIdentityAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailCurrentIdentityAuthenticatorOK creates a DetailCurrentIdentityAuthenticatorOK with default headers values -func NewDetailCurrentIdentityAuthenticatorOK() *DetailCurrentIdentityAuthenticatorOK { - return &DetailCurrentIdentityAuthenticatorOK{} -} - -/* DetailCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -A singular authenticator resource -*/ -type DetailCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.DetailAuthenticatorEnvelope -} - -func (o *DetailCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators/{id}][%d] detailCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *DetailCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.DetailAuthenticatorEnvelope { - return o.Payload -} - -func (o *DetailCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailAuthenticatorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCurrentIdentityAuthenticatorUnauthorized creates a DetailCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewDetailCurrentIdentityAuthenticatorUnauthorized() *DetailCurrentIdentityAuthenticatorUnauthorized { - return &DetailCurrentIdentityAuthenticatorUnauthorized{} -} - -/* DetailCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators/{id}][%d] detailCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCurrentIdentityAuthenticatorNotFound creates a DetailCurrentIdentityAuthenticatorNotFound with default headers values -func NewDetailCurrentIdentityAuthenticatorNotFound() *DetailCurrentIdentityAuthenticatorNotFound { - return &DetailCurrentIdentityAuthenticatorNotFound{} -} - -/* DetailCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailCurrentIdentityAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCurrentIdentityAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators/{id}][%d] detailCurrentIdentityAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *DetailCurrentIdentityAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCurrentIdentityAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/extend_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/extend_current_identity_authenticator_parameters.go deleted file mode 100644 index f10d59225..000000000 --- a/rest_client_api_client/current_api_session/extend_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendCurrentIdentityAuthenticatorParams creates a new ExtendCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExtendCurrentIdentityAuthenticatorParams() *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExtendCurrentIdentityAuthenticatorParamsWithTimeout creates a new ExtendCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewExtendCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewExtendCurrentIdentityAuthenticatorParamsWithContext creates a new ExtendCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewExtendCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewExtendCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new ExtendCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewExtendCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* ExtendCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the extend current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type ExtendCurrentIdentityAuthenticatorParams struct { - - // Extend. - Extend *rest_model.IdentityExtendEnrollmentRequest - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the extend current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendCurrentIdentityAuthenticatorParams) WithDefaults() *ExtendCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the extend current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *ExtendCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *ExtendCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *ExtendCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExtend adds the extend to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithExtend(extend *rest_model.IdentityExtendEnrollmentRequest) *ExtendCurrentIdentityAuthenticatorParams { - o.SetExtend(extend) - return o -} - -// SetExtend adds the extend to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetExtend(extend *rest_model.IdentityExtendEnrollmentRequest) { - o.Extend = extend -} - -// WithID adds the id to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithID(id string) *ExtendCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtendCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Extend != nil { - if err := r.SetBodyParam(o.Extend); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/extend_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/extend_current_identity_authenticator_responses.go deleted file mode 100644 index af4120ce8..000000000 --- a/rest_client_api_client/current_api_session/extend_current_identity_authenticator_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ExtendCurrentIdentityAuthenticatorReader is a Reader for the ExtendCurrentIdentityAuthenticator structure. -type ExtendCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExtendCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExtendCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewExtendCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExtendCurrentIdentityAuthenticatorOK creates a ExtendCurrentIdentityAuthenticatorOK with default headers values -func NewExtendCurrentIdentityAuthenticatorOK() *ExtendCurrentIdentityAuthenticatorOK { - return &ExtendCurrentIdentityAuthenticatorOK{} -} - -/* ExtendCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -A response containg the identity's new certificate -*/ -type ExtendCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.IdentityExtendEnrollmentEnvelope -} - -func (o *ExtendCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend][%d] extendCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *ExtendCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.IdentityExtendEnrollmentEnvelope { - return o.Payload -} - -func (o *ExtendCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.IdentityExtendEnrollmentEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExtendCurrentIdentityAuthenticatorUnauthorized creates a ExtendCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendCurrentIdentityAuthenticatorUnauthorized() *ExtendCurrentIdentityAuthenticatorUnauthorized { - return &ExtendCurrentIdentityAuthenticatorUnauthorized{} -} - -/* ExtendCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ExtendCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend][%d] extendCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/extend_verify_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/extend_verify_current_identity_authenticator_parameters.go deleted file mode 100644 index 66d03fa38..000000000 --- a/rest_client_api_client/current_api_session/extend_verify_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendVerifyCurrentIdentityAuthenticatorParams creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExtendVerifyCurrentIdentityAuthenticatorParams() *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorParamsWithTimeout creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewExtendVerifyCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorParamsWithContext creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewExtendVerifyCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewExtendVerifyCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* ExtendVerifyCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the extend verify current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type ExtendVerifyCurrentIdentityAuthenticatorParams struct { - - // Extend. - Extend *rest_model.IdentityExtendValidateEnrollmentRequest - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the extend verify current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithDefaults() *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the extend verify current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExtend adds the extend to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithExtend(extend *rest_model.IdentityExtendValidateEnrollmentRequest) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetExtend(extend) - return o -} - -// SetExtend adds the extend to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetExtend(extend *rest_model.IdentityExtendValidateEnrollmentRequest) { - o.Extend = extend -} - -// WithID adds the id to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithID(id string) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Extend != nil { - if err := r.SetBodyParam(o.Extend); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/extend_verify_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/extend_verify_current_identity_authenticator_responses.go deleted file mode 100644 index fc5588800..000000000 --- a/rest_client_api_client/current_api_session/extend_verify_current_identity_authenticator_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ExtendVerifyCurrentIdentityAuthenticatorReader is a Reader for the ExtendVerifyCurrentIdentityAuthenticator structure. -type ExtendVerifyCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExtendVerifyCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExtendVerifyCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorOK creates a ExtendVerifyCurrentIdentityAuthenticatorOK with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorOK() *ExtendVerifyCurrentIdentityAuthenticatorOK { - return &ExtendVerifyCurrentIdentityAuthenticatorOK{} -} - -/* ExtendVerifyCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type ExtendVerifyCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend-verify][%d] extendVerifyCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized creates a ExtendVerifyCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized() *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized { - return &ExtendVerifyCurrentIdentityAuthenticatorUnauthorized{} -} - -/* ExtendVerifyCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ExtendVerifyCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend-verify][%d] extendVerifyCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/get_current_api_session_parameters.go b/rest_client_api_client/current_api_session/get_current_api_session_parameters.go deleted file mode 100644 index caa755863..000000000 --- a/rest_client_api_client/current_api_session/get_current_api_session_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCurrentAPISessionParams creates a new GetCurrentAPISessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCurrentAPISessionParams() *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCurrentAPISessionParamsWithTimeout creates a new GetCurrentAPISessionParams object -// with the ability to set a timeout on a request. -func NewGetCurrentAPISessionParamsWithTimeout(timeout time.Duration) *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - timeout: timeout, - } -} - -// NewGetCurrentAPISessionParamsWithContext creates a new GetCurrentAPISessionParams object -// with the ability to set a context for a request. -func NewGetCurrentAPISessionParamsWithContext(ctx context.Context) *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - Context: ctx, - } -} - -// NewGetCurrentAPISessionParamsWithHTTPClient creates a new GetCurrentAPISessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCurrentAPISessionParamsWithHTTPClient(client *http.Client) *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - HTTPClient: client, - } -} - -/* GetCurrentAPISessionParams contains all the parameters to send to the API endpoint - for the get current API session operation. - - Typically these are written to a http.Request. -*/ -type GetCurrentAPISessionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentAPISessionParams) WithDefaults() *GetCurrentAPISessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentAPISessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get current API session params -func (o *GetCurrentAPISessionParams) WithTimeout(timeout time.Duration) *GetCurrentAPISessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get current API session params -func (o *GetCurrentAPISessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get current API session params -func (o *GetCurrentAPISessionParams) WithContext(ctx context.Context) *GetCurrentAPISessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get current API session params -func (o *GetCurrentAPISessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get current API session params -func (o *GetCurrentAPISessionParams) WithHTTPClient(client *http.Client) *GetCurrentAPISessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get current API session params -func (o *GetCurrentAPISessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCurrentAPISessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/get_current_api_session_responses.go b/rest_client_api_client/current_api_session/get_current_api_session_responses.go deleted file mode 100644 index fe10a356e..000000000 --- a/rest_client_api_client/current_api_session/get_current_api_session_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentAPISessionReader is a Reader for the GetCurrentAPISession structure. -type GetCurrentAPISessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCurrentAPISessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCurrentAPISessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCurrentAPISessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCurrentAPISessionOK creates a GetCurrentAPISessionOK with default headers values -func NewGetCurrentAPISessionOK() *GetCurrentAPISessionOK { - return &GetCurrentAPISessionOK{} -} - -/* GetCurrentAPISessionOK describes a response with status code 200, with default header values. - -The API session associated with the session used to issue the request -*/ -type GetCurrentAPISessionOK struct { - Payload *rest_model.CurrentAPISessionDetailEnvelope -} - -func (o *GetCurrentAPISessionOK) Error() string { - return fmt.Sprintf("[GET /current-api-session][%d] getCurrentApiSessionOK %+v", 200, o.Payload) -} -func (o *GetCurrentAPISessionOK) GetPayload() *rest_model.CurrentAPISessionDetailEnvelope { - return o.Payload -} - -func (o *GetCurrentAPISessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CurrentAPISessionDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCurrentAPISessionUnauthorized creates a GetCurrentAPISessionUnauthorized with default headers values -func NewGetCurrentAPISessionUnauthorized() *GetCurrentAPISessionUnauthorized { - return &GetCurrentAPISessionUnauthorized{} -} - -/* GetCurrentAPISessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetCurrentAPISessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCurrentAPISessionUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-api-session][%d] getCurrentApiSessionUnauthorized %+v", 401, o.Payload) -} -func (o *GetCurrentAPISessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCurrentAPISessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/list_current_api_session_certificates_parameters.go b/rest_client_api_client/current_api_session/list_current_api_session_certificates_parameters.go deleted file mode 100644 index a4aadb570..000000000 --- a/rest_client_api_client/current_api_session/list_current_api_session_certificates_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCurrentAPISessionCertificatesParams creates a new ListCurrentAPISessionCertificatesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListCurrentAPISessionCertificatesParams() *ListCurrentAPISessionCertificatesParams { - return &ListCurrentAPISessionCertificatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListCurrentAPISessionCertificatesParamsWithTimeout creates a new ListCurrentAPISessionCertificatesParams object -// with the ability to set a timeout on a request. -func NewListCurrentAPISessionCertificatesParamsWithTimeout(timeout time.Duration) *ListCurrentAPISessionCertificatesParams { - return &ListCurrentAPISessionCertificatesParams{ - timeout: timeout, - } -} - -// NewListCurrentAPISessionCertificatesParamsWithContext creates a new ListCurrentAPISessionCertificatesParams object -// with the ability to set a context for a request. -func NewListCurrentAPISessionCertificatesParamsWithContext(ctx context.Context) *ListCurrentAPISessionCertificatesParams { - return &ListCurrentAPISessionCertificatesParams{ - Context: ctx, - } -} - -// NewListCurrentAPISessionCertificatesParamsWithHTTPClient creates a new ListCurrentAPISessionCertificatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListCurrentAPISessionCertificatesParamsWithHTTPClient(client *http.Client) *ListCurrentAPISessionCertificatesParams { - return &ListCurrentAPISessionCertificatesParams{ - HTTPClient: client, - } -} - -/* ListCurrentAPISessionCertificatesParams contains all the parameters to send to the API endpoint - for the list current Api session certificates operation. - - Typically these are written to a http.Request. -*/ -type ListCurrentAPISessionCertificatesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list current Api session certificates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCurrentAPISessionCertificatesParams) WithDefaults() *ListCurrentAPISessionCertificatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list current Api session certificates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCurrentAPISessionCertificatesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) WithTimeout(timeout time.Duration) *ListCurrentAPISessionCertificatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) WithContext(ctx context.Context) *ListCurrentAPISessionCertificatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) WithHTTPClient(client *http.Client) *ListCurrentAPISessionCertificatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) WithFilter(filter *string) *ListCurrentAPISessionCertificatesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) WithLimit(limit *int64) *ListCurrentAPISessionCertificatesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) WithOffset(offset *int64) *ListCurrentAPISessionCertificatesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list current Api session certificates params -func (o *ListCurrentAPISessionCertificatesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListCurrentAPISessionCertificatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/list_current_api_session_certificates_responses.go b/rest_client_api_client/current_api_session/list_current_api_session_certificates_responses.go deleted file mode 100644 index 5d1397674..000000000 --- a/rest_client_api_client/current_api_session/list_current_api_session_certificates_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListCurrentAPISessionCertificatesReader is a Reader for the ListCurrentAPISessionCertificates structure. -type ListCurrentAPISessionCertificatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListCurrentAPISessionCertificatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListCurrentAPISessionCertificatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListCurrentAPISessionCertificatesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListCurrentAPISessionCertificatesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListCurrentAPISessionCertificatesOK creates a ListCurrentAPISessionCertificatesOK with default headers values -func NewListCurrentAPISessionCertificatesOK() *ListCurrentAPISessionCertificatesOK { - return &ListCurrentAPISessionCertificatesOK{} -} - -/* ListCurrentAPISessionCertificatesOK describes a response with status code 200, with default header values. - -A list of the current API Session's certificate -*/ -type ListCurrentAPISessionCertificatesOK struct { - Payload *rest_model.ListCurrentAPISessionCertificatesEnvelope -} - -func (o *ListCurrentAPISessionCertificatesOK) Error() string { - return fmt.Sprintf("[GET /current-api-session/certificates][%d] listCurrentApiSessionCertificatesOK %+v", 200, o.Payload) -} -func (o *ListCurrentAPISessionCertificatesOK) GetPayload() *rest_model.ListCurrentAPISessionCertificatesEnvelope { - return o.Payload -} - -func (o *ListCurrentAPISessionCertificatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListCurrentAPISessionCertificatesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCurrentAPISessionCertificatesBadRequest creates a ListCurrentAPISessionCertificatesBadRequest with default headers values -func NewListCurrentAPISessionCertificatesBadRequest() *ListCurrentAPISessionCertificatesBadRequest { - return &ListCurrentAPISessionCertificatesBadRequest{} -} - -/* ListCurrentAPISessionCertificatesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListCurrentAPISessionCertificatesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCurrentAPISessionCertificatesBadRequest) Error() string { - return fmt.Sprintf("[GET /current-api-session/certificates][%d] listCurrentApiSessionCertificatesBadRequest %+v", 400, o.Payload) -} -func (o *ListCurrentAPISessionCertificatesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCurrentAPISessionCertificatesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCurrentAPISessionCertificatesUnauthorized creates a ListCurrentAPISessionCertificatesUnauthorized with default headers values -func NewListCurrentAPISessionCertificatesUnauthorized() *ListCurrentAPISessionCertificatesUnauthorized { - return &ListCurrentAPISessionCertificatesUnauthorized{} -} - -/* ListCurrentAPISessionCertificatesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListCurrentAPISessionCertificatesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCurrentAPISessionCertificatesUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-api-session/certificates][%d] listCurrentApiSessionCertificatesUnauthorized %+v", 401, o.Payload) -} -func (o *ListCurrentAPISessionCertificatesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCurrentAPISessionCertificatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/list_current_identity_authenticators_parameters.go b/rest_client_api_client/current_api_session/list_current_identity_authenticators_parameters.go deleted file mode 100644 index 2867bd7eb..000000000 --- a/rest_client_api_client/current_api_session/list_current_identity_authenticators_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCurrentIdentityAuthenticatorsParams creates a new ListCurrentIdentityAuthenticatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListCurrentIdentityAuthenticatorsParams() *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListCurrentIdentityAuthenticatorsParamsWithTimeout creates a new ListCurrentIdentityAuthenticatorsParams object -// with the ability to set a timeout on a request. -func NewListCurrentIdentityAuthenticatorsParamsWithTimeout(timeout time.Duration) *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - timeout: timeout, - } -} - -// NewListCurrentIdentityAuthenticatorsParamsWithContext creates a new ListCurrentIdentityAuthenticatorsParams object -// with the ability to set a context for a request. -func NewListCurrentIdentityAuthenticatorsParamsWithContext(ctx context.Context) *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - Context: ctx, - } -} - -// NewListCurrentIdentityAuthenticatorsParamsWithHTTPClient creates a new ListCurrentIdentityAuthenticatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListCurrentIdentityAuthenticatorsParamsWithHTTPClient(client *http.Client) *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - HTTPClient: client, - } -} - -/* ListCurrentIdentityAuthenticatorsParams contains all the parameters to send to the API endpoint - for the list current identity authenticators operation. - - Typically these are written to a http.Request. -*/ -type ListCurrentIdentityAuthenticatorsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list current identity authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCurrentIdentityAuthenticatorsParams) WithDefaults() *ListCurrentIdentityAuthenticatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list current identity authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCurrentIdentityAuthenticatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithTimeout(timeout time.Duration) *ListCurrentIdentityAuthenticatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithContext(ctx context.Context) *ListCurrentIdentityAuthenticatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithHTTPClient(client *http.Client) *ListCurrentIdentityAuthenticatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithFilter(filter *string) *ListCurrentIdentityAuthenticatorsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithLimit(limit *int64) *ListCurrentIdentityAuthenticatorsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithOffset(offset *int64) *ListCurrentIdentityAuthenticatorsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListCurrentIdentityAuthenticatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/list_current_identity_authenticators_responses.go b/rest_client_api_client/current_api_session/list_current_identity_authenticators_responses.go deleted file mode 100644 index 7d507b824..000000000 --- a/rest_client_api_client/current_api_session/list_current_identity_authenticators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListCurrentIdentityAuthenticatorsReader is a Reader for the ListCurrentIdentityAuthenticators structure. -type ListCurrentIdentityAuthenticatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListCurrentIdentityAuthenticatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListCurrentIdentityAuthenticatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListCurrentIdentityAuthenticatorsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListCurrentIdentityAuthenticatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListCurrentIdentityAuthenticatorsOK creates a ListCurrentIdentityAuthenticatorsOK with default headers values -func NewListCurrentIdentityAuthenticatorsOK() *ListCurrentIdentityAuthenticatorsOK { - return &ListCurrentIdentityAuthenticatorsOK{} -} - -/* ListCurrentIdentityAuthenticatorsOK describes a response with status code 200, with default header values. - -A list of authenticators -*/ -type ListCurrentIdentityAuthenticatorsOK struct { - Payload *rest_model.ListAuthenticatorsEnvelope -} - -func (o *ListCurrentIdentityAuthenticatorsOK) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators][%d] listCurrentIdentityAuthenticatorsOK %+v", 200, o.Payload) -} -func (o *ListCurrentIdentityAuthenticatorsOK) GetPayload() *rest_model.ListAuthenticatorsEnvelope { - return o.Payload -} - -func (o *ListCurrentIdentityAuthenticatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListAuthenticatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCurrentIdentityAuthenticatorsBadRequest creates a ListCurrentIdentityAuthenticatorsBadRequest with default headers values -func NewListCurrentIdentityAuthenticatorsBadRequest() *ListCurrentIdentityAuthenticatorsBadRequest { - return &ListCurrentIdentityAuthenticatorsBadRequest{} -} - -/* ListCurrentIdentityAuthenticatorsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListCurrentIdentityAuthenticatorsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCurrentIdentityAuthenticatorsBadRequest) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators][%d] listCurrentIdentityAuthenticatorsBadRequest %+v", 400, o.Payload) -} -func (o *ListCurrentIdentityAuthenticatorsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCurrentIdentityAuthenticatorsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCurrentIdentityAuthenticatorsUnauthorized creates a ListCurrentIdentityAuthenticatorsUnauthorized with default headers values -func NewListCurrentIdentityAuthenticatorsUnauthorized() *ListCurrentIdentityAuthenticatorsUnauthorized { - return &ListCurrentIdentityAuthenticatorsUnauthorized{} -} - -/* ListCurrentIdentityAuthenticatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListCurrentIdentityAuthenticatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators][%d] listCurrentIdentityAuthenticatorsUnauthorized %+v", 401, o.Payload) -} -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/list_service_updates_parameters.go b/rest_client_api_client/current_api_session/list_service_updates_parameters.go deleted file mode 100644 index e7647471f..000000000 --- a/rest_client_api_client/current_api_session/list_service_updates_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListServiceUpdatesParams creates a new ListServiceUpdatesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceUpdatesParams() *ListServiceUpdatesParams { - return &ListServiceUpdatesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceUpdatesParamsWithTimeout creates a new ListServiceUpdatesParams object -// with the ability to set a timeout on a request. -func NewListServiceUpdatesParamsWithTimeout(timeout time.Duration) *ListServiceUpdatesParams { - return &ListServiceUpdatesParams{ - timeout: timeout, - } -} - -// NewListServiceUpdatesParamsWithContext creates a new ListServiceUpdatesParams object -// with the ability to set a context for a request. -func NewListServiceUpdatesParamsWithContext(ctx context.Context) *ListServiceUpdatesParams { - return &ListServiceUpdatesParams{ - Context: ctx, - } -} - -// NewListServiceUpdatesParamsWithHTTPClient creates a new ListServiceUpdatesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceUpdatesParamsWithHTTPClient(client *http.Client) *ListServiceUpdatesParams { - return &ListServiceUpdatesParams{ - HTTPClient: client, - } -} - -/* ListServiceUpdatesParams contains all the parameters to send to the API endpoint - for the list service updates operation. - - Typically these are written to a http.Request. -*/ -type ListServiceUpdatesParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service updates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceUpdatesParams) WithDefaults() *ListServiceUpdatesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service updates params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceUpdatesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service updates params -func (o *ListServiceUpdatesParams) WithTimeout(timeout time.Duration) *ListServiceUpdatesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service updates params -func (o *ListServiceUpdatesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service updates params -func (o *ListServiceUpdatesParams) WithContext(ctx context.Context) *ListServiceUpdatesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service updates params -func (o *ListServiceUpdatesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service updates params -func (o *ListServiceUpdatesParams) WithHTTPClient(client *http.Client) *ListServiceUpdatesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service updates params -func (o *ListServiceUpdatesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceUpdatesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/list_service_updates_responses.go b/rest_client_api_client/current_api_session/list_service_updates_responses.go deleted file mode 100644 index 2b4317a21..000000000 --- a/rest_client_api_client/current_api_session/list_service_updates_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceUpdatesReader is a Reader for the ListServiceUpdates structure. -type ListServiceUpdatesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceUpdatesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceUpdatesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListServiceUpdatesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceUpdatesOK creates a ListServiceUpdatesOK with default headers values -func NewListServiceUpdatesOK() *ListServiceUpdatesOK { - return &ListServiceUpdatesOK{} -} - -/* ListServiceUpdatesOK describes a response with status code 200, with default header values. - -Data indicating necessary service updates -*/ -type ListServiceUpdatesOK struct { - Payload *rest_model.ListCurrentAPISessionServiceUpdatesEnvelope -} - -func (o *ListServiceUpdatesOK) Error() string { - return fmt.Sprintf("[GET /current-api-session/service-updates][%d] listServiceUpdatesOK %+v", 200, o.Payload) -} -func (o *ListServiceUpdatesOK) GetPayload() *rest_model.ListCurrentAPISessionServiceUpdatesEnvelope { - return o.Payload -} - -func (o *ListServiceUpdatesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListCurrentAPISessionServiceUpdatesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceUpdatesUnauthorized creates a ListServiceUpdatesUnauthorized with default headers values -func NewListServiceUpdatesUnauthorized() *ListServiceUpdatesUnauthorized { - return &ListServiceUpdatesUnauthorized{} -} - -/* ListServiceUpdatesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceUpdatesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceUpdatesUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-api-session/service-updates][%d] listServiceUpdatesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceUpdatesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceUpdatesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/patch_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/patch_current_identity_authenticator_parameters.go deleted file mode 100644 index a357899c0..000000000 --- a/rest_client_api_client/current_api_session/patch_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchCurrentIdentityAuthenticatorParams creates a new PatchCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchCurrentIdentityAuthenticatorParams() *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchCurrentIdentityAuthenticatorParamsWithTimeout creates a new PatchCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewPatchCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewPatchCurrentIdentityAuthenticatorParamsWithContext creates a new PatchCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewPatchCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewPatchCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new PatchCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* PatchCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the patch current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type PatchCurrentIdentityAuthenticatorParams struct { - - /* Authenticator. - - An authenticator patch object - */ - Authenticator *rest_model.AuthenticatorPatchWithCurrent - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchCurrentIdentityAuthenticatorParams) WithDefaults() *PatchCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *PatchCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *PatchCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *PatchCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorPatchWithCurrent) *PatchCurrentIdentityAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorPatchWithCurrent) { - o.Authenticator = authenticator -} - -// WithID adds the id to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithID(id string) *PatchCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/patch_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/patch_current_identity_authenticator_responses.go deleted file mode 100644 index 2032cb5ce..000000000 --- a/rest_client_api_client/current_api_session/patch_current_identity_authenticator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchCurrentIdentityAuthenticatorReader is a Reader for the PatchCurrentIdentityAuthenticator structure. -type PatchCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchCurrentIdentityAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchCurrentIdentityAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchCurrentIdentityAuthenticatorOK creates a PatchCurrentIdentityAuthenticatorOK with default headers values -func NewPatchCurrentIdentityAuthenticatorOK() *PatchCurrentIdentityAuthenticatorOK { - return &PatchCurrentIdentityAuthenticatorOK{} -} - -/* PatchCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *PatchCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCurrentIdentityAuthenticatorBadRequest creates a PatchCurrentIdentityAuthenticatorBadRequest with default headers values -func NewPatchCurrentIdentityAuthenticatorBadRequest() *PatchCurrentIdentityAuthenticatorBadRequest { - return &PatchCurrentIdentityAuthenticatorBadRequest{} -} - -/* PatchCurrentIdentityAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchCurrentIdentityAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCurrentIdentityAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCurrentIdentityAuthenticatorUnauthorized creates a PatchCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewPatchCurrentIdentityAuthenticatorUnauthorized() *PatchCurrentIdentityAuthenticatorUnauthorized { - return &PatchCurrentIdentityAuthenticatorUnauthorized{} -} - -/* PatchCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCurrentIdentityAuthenticatorNotFound creates a PatchCurrentIdentityAuthenticatorNotFound with default headers values -func NewPatchCurrentIdentityAuthenticatorNotFound() *PatchCurrentIdentityAuthenticatorNotFound { - return &PatchCurrentIdentityAuthenticatorNotFound{} -} - -/* PatchCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchCurrentIdentityAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCurrentIdentityAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_api_session/update_current_identity_authenticator_parameters.go b/rest_client_api_client/current_api_session/update_current_identity_authenticator_parameters.go deleted file mode 100644 index 98fee8670..000000000 --- a/rest_client_api_client/current_api_session/update_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateCurrentIdentityAuthenticatorParams creates a new UpdateCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateCurrentIdentityAuthenticatorParams() *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateCurrentIdentityAuthenticatorParamsWithTimeout creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewUpdateCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewUpdateCurrentIdentityAuthenticatorParamsWithContext creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewUpdateCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewUpdateCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* UpdateCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the update current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type UpdateCurrentIdentityAuthenticatorParams struct { - - /* Authenticator. - - An authenticator put object - */ - Authenticator *rest_model.AuthenticatorUpdateWithCurrent - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCurrentIdentityAuthenticatorParams) WithDefaults() *UpdateCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *UpdateCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *UpdateCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *UpdateCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorUpdateWithCurrent) *UpdateCurrentIdentityAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorUpdateWithCurrent) { - o.Authenticator = authenticator -} - -// WithID adds the id to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithID(id string) *UpdateCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_api_session/update_current_identity_authenticator_responses.go b/rest_client_api_client/current_api_session/update_current_identity_authenticator_responses.go deleted file mode 100644 index 015697666..000000000 --- a/rest_client_api_client/current_api_session/update_current_identity_authenticator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateCurrentIdentityAuthenticatorReader is a Reader for the UpdateCurrentIdentityAuthenticator structure. -type UpdateCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateCurrentIdentityAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateCurrentIdentityAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateCurrentIdentityAuthenticatorOK creates a UpdateCurrentIdentityAuthenticatorOK with default headers values -func NewUpdateCurrentIdentityAuthenticatorOK() *UpdateCurrentIdentityAuthenticatorOK { - return &UpdateCurrentIdentityAuthenticatorOK{} -} - -/* UpdateCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCurrentIdentityAuthenticatorBadRequest creates a UpdateCurrentIdentityAuthenticatorBadRequest with default headers values -func NewUpdateCurrentIdentityAuthenticatorBadRequest() *UpdateCurrentIdentityAuthenticatorBadRequest { - return &UpdateCurrentIdentityAuthenticatorBadRequest{} -} - -/* UpdateCurrentIdentityAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateCurrentIdentityAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCurrentIdentityAuthenticatorUnauthorized creates a UpdateCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewUpdateCurrentIdentityAuthenticatorUnauthorized() *UpdateCurrentIdentityAuthenticatorUnauthorized { - return &UpdateCurrentIdentityAuthenticatorUnauthorized{} -} - -/* UpdateCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCurrentIdentityAuthenticatorNotFound creates a UpdateCurrentIdentityAuthenticatorNotFound with default headers values -func NewUpdateCurrentIdentityAuthenticatorNotFound() *UpdateCurrentIdentityAuthenticatorNotFound { - return &UpdateCurrentIdentityAuthenticatorNotFound{} -} - -/* UpdateCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateCurrentIdentityAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCurrentIdentityAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/create_mfa_recovery_codes_parameters.go b/rest_client_api_client/current_identity/create_mfa_recovery_codes_parameters.go deleted file mode 100644 index dfe1c5554..000000000 --- a/rest_client_api_client/current_identity/create_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateMfaRecoveryCodesParams creates a new CreateMfaRecoveryCodesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMfaRecoveryCodesParams() *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMfaRecoveryCodesParamsWithTimeout creates a new CreateMfaRecoveryCodesParams object -// with the ability to set a timeout on a request. -func NewCreateMfaRecoveryCodesParamsWithTimeout(timeout time.Duration) *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - timeout: timeout, - } -} - -// NewCreateMfaRecoveryCodesParamsWithContext creates a new CreateMfaRecoveryCodesParams object -// with the ability to set a context for a request. -func NewCreateMfaRecoveryCodesParamsWithContext(ctx context.Context) *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - Context: ctx, - } -} - -// NewCreateMfaRecoveryCodesParamsWithHTTPClient creates a new CreateMfaRecoveryCodesParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMfaRecoveryCodesParamsWithHTTPClient(client *http.Client) *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - HTTPClient: client, - } -} - -/* CreateMfaRecoveryCodesParams contains all the parameters to send to the API endpoint - for the create mfa recovery codes operation. - - Typically these are written to a http.Request. -*/ -type CreateMfaRecoveryCodesParams struct { - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMfaRecoveryCodesParams) WithDefaults() *CreateMfaRecoveryCodesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMfaRecoveryCodesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithTimeout(timeout time.Duration) *CreateMfaRecoveryCodesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithContext(ctx context.Context) *CreateMfaRecoveryCodesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithHTTPClient(client *http.Client) *CreateMfaRecoveryCodesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidation adds the mfaValidation to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *CreateMfaRecoveryCodesParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMfaRecoveryCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/create_mfa_recovery_codes_responses.go b/rest_client_api_client/current_identity/create_mfa_recovery_codes_responses.go deleted file mode 100644 index 7f0d20f88..000000000 --- a/rest_client_api_client/current_identity/create_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateMfaRecoveryCodesReader is a Reader for the CreateMfaRecoveryCodes structure. -type CreateMfaRecoveryCodesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMfaRecoveryCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateMfaRecoveryCodesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCreateMfaRecoveryCodesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMfaRecoveryCodesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateMfaRecoveryCodesOK creates a CreateMfaRecoveryCodesOK with default headers values -func NewCreateMfaRecoveryCodesOK() *CreateMfaRecoveryCodesOK { - return &CreateMfaRecoveryCodesOK{} -} - -/* CreateMfaRecoveryCodesOK describes a response with status code 200, with default header values. - -The recovery codes of an MFA enrollment -*/ -type CreateMfaRecoveryCodesOK struct { - Payload *rest_model.DetailMfaRecoveryCodesEnvelope -} - -func (o *CreateMfaRecoveryCodesOK) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/recovery-codes][%d] createMfaRecoveryCodesOK %+v", 200, o.Payload) -} -func (o *CreateMfaRecoveryCodesOK) GetPayload() *rest_model.DetailMfaRecoveryCodesEnvelope { - return o.Payload -} - -func (o *CreateMfaRecoveryCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailMfaRecoveryCodesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMfaRecoveryCodesUnauthorized creates a CreateMfaRecoveryCodesUnauthorized with default headers values -func NewCreateMfaRecoveryCodesUnauthorized() *CreateMfaRecoveryCodesUnauthorized { - return &CreateMfaRecoveryCodesUnauthorized{} -} - -/* CreateMfaRecoveryCodesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateMfaRecoveryCodesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateMfaRecoveryCodesUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/recovery-codes][%d] createMfaRecoveryCodesUnauthorized %+v", 401, o.Payload) -} -func (o *CreateMfaRecoveryCodesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateMfaRecoveryCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMfaRecoveryCodesNotFound creates a CreateMfaRecoveryCodesNotFound with default headers values -func NewCreateMfaRecoveryCodesNotFound() *CreateMfaRecoveryCodesNotFound { - return &CreateMfaRecoveryCodesNotFound{} -} - -/* CreateMfaRecoveryCodesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type CreateMfaRecoveryCodesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateMfaRecoveryCodesNotFound) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/recovery-codes][%d] createMfaRecoveryCodesNotFound %+v", 404, o.Payload) -} -func (o *CreateMfaRecoveryCodesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateMfaRecoveryCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/current_identity_client.go b/rest_client_api_client/current_identity/current_identity_client.go deleted file mode 100644 index c6642969b..000000000 --- a/rest_client_api_client/current_identity/current_identity_client.go +++ /dev/null @@ -1,459 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new current identity API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for current identity API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateMfaRecoveryCodesOK, error) - - DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteMfaOK, error) - - DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaOK, error) - - DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaQrCodeOK, error) - - DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaRecoveryCodesOK, error) - - EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnrollMfaCreated, error) - - GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityOK, error) - - GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityEdgeRoutersOK, error) - - VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyMfaOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMfaRecoveryCodes fors a completed m f a enrollment regenerate the recovery codes - - Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes. - -*/ -func (a *Client) CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateMfaRecoveryCodesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMfaRecoveryCodesParams() - } - op := &runtime.ClientOperation{ - ID: "createMfaRecoveryCodes", - Method: "POST", - PathPattern: "/current-identity/mfa/recovery-codes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateMfaRecoveryCodesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMfaRecoveryCodesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMfaRecoveryCodes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteMfa disables m f a for the current identity - - Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via `DELETE /identities//mfa`. - -*/ -func (a *Client) DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteMfaParams() - } - op := &runtime.ClientOperation{ - ID: "deleteMfa", - Method: "DELETE", - PathPattern: "/current-identity/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailMfa returns the current status of m f a enrollment - - Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a `POST /current-identity/mfa/verify`. - -*/ -func (a *Client) DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailMfaParams() - } - op := &runtime.ClientOperation{ - ID: "detailMfa", - Method: "GET", - PathPattern: "/current-identity/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailMfaQrCode shows a q r code for unverified m f a enrollments - - Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started. - -*/ -func (a *Client) DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaQrCodeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailMfaQrCodeParams() - } - op := &runtime.ClientOperation{ - ID: "detailMfaQrCode", - Method: "GET", - PathPattern: "/current-identity/mfa/qr-code", - ProducesMediaTypes: []string{"application/json", "image/png"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailMfaQrCodeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailMfaQrCodeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailMfaQrCode: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailMfaRecoveryCodes fors a completed m f a enrollment view the current recovery codes - - Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. - -*/ -func (a *Client) DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaRecoveryCodesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailMfaRecoveryCodesParams() - } - op := &runtime.ClientOperation{ - ID: "detailMfaRecoveryCodes", - Method: "GET", - PathPattern: "/current-identity/mfa/recovery-codes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailMfaRecoveryCodesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailMfaRecoveryCodesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailMfaRecoveryCodes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnrollMfa initiates m f a enrollment - - Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via `POST /current-identity/mfa/verify` - -*/ -func (a *Client) EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnrollMfaCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollMfaParams() - } - op := &runtime.ClientOperation{ - ID: "enrollMfa", - Method: "POST", - PathPattern: "/current-identity/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollMfaCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enrollMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCurrentIdentity returns the current identity - - Returns the identity associated with the API sessions used to issue the current request -*/ -func (a *Client) GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCurrentIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "getCurrentIdentity", - Method: "GET", - PathPattern: "/current-identity", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCurrentIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCurrentIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCurrentIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCurrentIdentityEdgeRouters returns this list of edge routers the identity has access to - - Lists the Edge Routers that the current identity has access to via policies. The data returned -includes their address and online status - -*/ -func (a *Client) GetCurrentIdentityEdgeRouters(params *GetCurrentIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityEdgeRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCurrentIdentityEdgeRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "getCurrentIdentityEdgeRouters", - Method: "GET", - PathPattern: "/current-identity/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCurrentIdentityEdgeRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCurrentIdentityEdgeRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCurrentIdentityEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - VerifyMfa completes m f a enrollment by verifying a time based one time token - - Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via `POST /current-identity/mfa`. - -*/ -func (a *Client) VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewVerifyMfaParams() - } - op := &runtime.ClientOperation{ - ID: "verifyMfa", - Method: "POST", - PathPattern: "/current-identity/mfa/verify", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &VerifyMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*VerifyMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for verifyMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/current_identity/delete_mfa_parameters.go b/rest_client_api_client/current_identity/delete_mfa_parameters.go deleted file mode 100644 index 1aca8d4a3..000000000 --- a/rest_client_api_client/current_identity/delete_mfa_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewDeleteMfaParams creates a new DeleteMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteMfaParams() *DeleteMfaParams { - return &DeleteMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteMfaParamsWithTimeout creates a new DeleteMfaParams object -// with the ability to set a timeout on a request. -func NewDeleteMfaParamsWithTimeout(timeout time.Duration) *DeleteMfaParams { - return &DeleteMfaParams{ - timeout: timeout, - } -} - -// NewDeleteMfaParamsWithContext creates a new DeleteMfaParams object -// with the ability to set a context for a request. -func NewDeleteMfaParamsWithContext(ctx context.Context) *DeleteMfaParams { - return &DeleteMfaParams{ - Context: ctx, - } -} - -// NewDeleteMfaParamsWithHTTPClient creates a new DeleteMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteMfaParamsWithHTTPClient(client *http.Client) *DeleteMfaParams { - return &DeleteMfaParams{ - HTTPClient: client, - } -} - -/* DeleteMfaParams contains all the parameters to send to the API endpoint - for the delete mfa operation. - - Typically these are written to a http.Request. -*/ -type DeleteMfaParams struct { - - // MfaValidationCode. - MfaValidationCode *string - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteMfaParams) WithDefaults() *DeleteMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete mfa params -func (o *DeleteMfaParams) WithTimeout(timeout time.Duration) *DeleteMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete mfa params -func (o *DeleteMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete mfa params -func (o *DeleteMfaParams) WithContext(ctx context.Context) *DeleteMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete mfa params -func (o *DeleteMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete mfa params -func (o *DeleteMfaParams) WithHTTPClient(client *http.Client) *DeleteMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete mfa params -func (o *DeleteMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidationCode adds the mfaValidationCode to the delete mfa params -func (o *DeleteMfaParams) WithMfaValidationCode(mfaValidationCode *string) *DeleteMfaParams { - o.SetMfaValidationCode(mfaValidationCode) - return o -} - -// SetMfaValidationCode adds the mfaValidationCode to the delete mfa params -func (o *DeleteMfaParams) SetMfaValidationCode(mfaValidationCode *string) { - o.MfaValidationCode = mfaValidationCode -} - -// WithMfaValidation adds the mfaValidation to the delete mfa params -func (o *DeleteMfaParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *DeleteMfaParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the delete mfa params -func (o *DeleteMfaParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.MfaValidationCode != nil { - - // header param mfa-validation-code - if err := r.SetHeaderParam("mfa-validation-code", *o.MfaValidationCode); err != nil { - return err - } - } - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/delete_mfa_responses.go b/rest_client_api_client/current_identity/delete_mfa_responses.go deleted file mode 100644 index 078ac1ee1..000000000 --- a/rest_client_api_client/current_identity/delete_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteMfaReader is a Reader for the DeleteMfa structure. -type DeleteMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteMfaOK creates a DeleteMfaOK with default headers values -func NewDeleteMfaOK() *DeleteMfaOK { - return &DeleteMfaOK{} -} - -/* DeleteMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DeleteMfaOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteMfaOK) Error() string { - return fmt.Sprintf("[DELETE /current-identity/mfa][%d] deleteMfaOK %+v", 200, o.Payload) -} -func (o *DeleteMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMfaUnauthorized creates a DeleteMfaUnauthorized with default headers values -func NewDeleteMfaUnauthorized() *DeleteMfaUnauthorized { - return &DeleteMfaUnauthorized{} -} - -/* DeleteMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteMfaUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /current-identity/mfa][%d] deleteMfaUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMfaNotFound creates a DeleteMfaNotFound with default headers values -func NewDeleteMfaNotFound() *DeleteMfaNotFound { - return &DeleteMfaNotFound{} -} - -/* DeleteMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DeleteMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteMfaNotFound) Error() string { - return fmt.Sprintf("[DELETE /current-identity/mfa][%d] deleteMfaNotFound %+v", 404, o.Payload) -} -func (o *DeleteMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/detail_mfa_parameters.go b/rest_client_api_client/current_identity/detail_mfa_parameters.go deleted file mode 100644 index 0a33ee409..000000000 --- a/rest_client_api_client/current_identity/detail_mfa_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailMfaParams creates a new DetailMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailMfaParams() *DetailMfaParams { - return &DetailMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailMfaParamsWithTimeout creates a new DetailMfaParams object -// with the ability to set a timeout on a request. -func NewDetailMfaParamsWithTimeout(timeout time.Duration) *DetailMfaParams { - return &DetailMfaParams{ - timeout: timeout, - } -} - -// NewDetailMfaParamsWithContext creates a new DetailMfaParams object -// with the ability to set a context for a request. -func NewDetailMfaParamsWithContext(ctx context.Context) *DetailMfaParams { - return &DetailMfaParams{ - Context: ctx, - } -} - -// NewDetailMfaParamsWithHTTPClient creates a new DetailMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailMfaParamsWithHTTPClient(client *http.Client) *DetailMfaParams { - return &DetailMfaParams{ - HTTPClient: client, - } -} - -/* DetailMfaParams contains all the parameters to send to the API endpoint - for the detail mfa operation. - - Typically these are written to a http.Request. -*/ -type DetailMfaParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaParams) WithDefaults() *DetailMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail mfa params -func (o *DetailMfaParams) WithTimeout(timeout time.Duration) *DetailMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail mfa params -func (o *DetailMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail mfa params -func (o *DetailMfaParams) WithContext(ctx context.Context) *DetailMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail mfa params -func (o *DetailMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail mfa params -func (o *DetailMfaParams) WithHTTPClient(client *http.Client) *DetailMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail mfa params -func (o *DetailMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/detail_mfa_qr_code_parameters.go b/rest_client_api_client/current_identity/detail_mfa_qr_code_parameters.go deleted file mode 100644 index 633dc56ec..000000000 --- a/rest_client_api_client/current_identity/detail_mfa_qr_code_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailMfaQrCodeParams creates a new DetailMfaQrCodeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailMfaQrCodeParams() *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailMfaQrCodeParamsWithTimeout creates a new DetailMfaQrCodeParams object -// with the ability to set a timeout on a request. -func NewDetailMfaQrCodeParamsWithTimeout(timeout time.Duration) *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - timeout: timeout, - } -} - -// NewDetailMfaQrCodeParamsWithContext creates a new DetailMfaQrCodeParams object -// with the ability to set a context for a request. -func NewDetailMfaQrCodeParamsWithContext(ctx context.Context) *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - Context: ctx, - } -} - -// NewDetailMfaQrCodeParamsWithHTTPClient creates a new DetailMfaQrCodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailMfaQrCodeParamsWithHTTPClient(client *http.Client) *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - HTTPClient: client, - } -} - -/* DetailMfaQrCodeParams contains all the parameters to send to the API endpoint - for the detail mfa qr code operation. - - Typically these are written to a http.Request. -*/ -type DetailMfaQrCodeParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail mfa qr code params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaQrCodeParams) WithDefaults() *DetailMfaQrCodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail mfa qr code params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaQrCodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) WithTimeout(timeout time.Duration) *DetailMfaQrCodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) WithContext(ctx context.Context) *DetailMfaQrCodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) WithHTTPClient(client *http.Client) *DetailMfaQrCodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailMfaQrCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/detail_mfa_qr_code_responses.go b/rest_client_api_client/current_identity/detail_mfa_qr_code_responses.go deleted file mode 100644 index f88ac0469..000000000 --- a/rest_client_api_client/current_identity/detail_mfa_qr_code_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// DetailMfaQrCodeReader is a Reader for the DetailMfaQrCode structure. -type DetailMfaQrCodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailMfaQrCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailMfaQrCodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewDetailMfaQrCodeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailMfaQrCodeOK creates a DetailMfaQrCodeOK with default headers values -func NewDetailMfaQrCodeOK() *DetailMfaQrCodeOK { - return &DetailMfaQrCodeOK{} -} - -/* DetailMfaQrCodeOK describes a response with status code 200, with default header values. - -OK -*/ -type DetailMfaQrCodeOK struct { -} - -func (o *DetailMfaQrCodeOK) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/qr-code][%d] detailMfaQrCodeOK ", 200) -} - -func (o *DetailMfaQrCodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDetailMfaQrCodeNotFound creates a DetailMfaQrCodeNotFound with default headers values -func NewDetailMfaQrCodeNotFound() *DetailMfaQrCodeNotFound { - return &DetailMfaQrCodeNotFound{} -} - -/* DetailMfaQrCodeNotFound describes a response with status code 404, with default header values. - -No MFA enrollment or MFA enrollment is completed -*/ -type DetailMfaQrCodeNotFound struct { -} - -func (o *DetailMfaQrCodeNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/qr-code][%d] detailMfaQrCodeNotFound ", 404) -} - -func (o *DetailMfaQrCodeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/rest_client_api_client/current_identity/detail_mfa_recovery_codes_parameters.go b/rest_client_api_client/current_identity/detail_mfa_recovery_codes_parameters.go deleted file mode 100644 index 6960b0abc..000000000 --- a/rest_client_api_client/current_identity/detail_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewDetailMfaRecoveryCodesParams creates a new DetailMfaRecoveryCodesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailMfaRecoveryCodesParams() *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailMfaRecoveryCodesParamsWithTimeout creates a new DetailMfaRecoveryCodesParams object -// with the ability to set a timeout on a request. -func NewDetailMfaRecoveryCodesParamsWithTimeout(timeout time.Duration) *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - timeout: timeout, - } -} - -// NewDetailMfaRecoveryCodesParamsWithContext creates a new DetailMfaRecoveryCodesParams object -// with the ability to set a context for a request. -func NewDetailMfaRecoveryCodesParamsWithContext(ctx context.Context) *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - Context: ctx, - } -} - -// NewDetailMfaRecoveryCodesParamsWithHTTPClient creates a new DetailMfaRecoveryCodesParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailMfaRecoveryCodesParamsWithHTTPClient(client *http.Client) *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - HTTPClient: client, - } -} - -/* DetailMfaRecoveryCodesParams contains all the parameters to send to the API endpoint - for the detail mfa recovery codes operation. - - Typically these are written to a http.Request. -*/ -type DetailMfaRecoveryCodesParams struct { - - // MfaValidationCode. - MfaValidationCode *string - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaRecoveryCodesParams) WithDefaults() *DetailMfaRecoveryCodesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaRecoveryCodesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithTimeout(timeout time.Duration) *DetailMfaRecoveryCodesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithContext(ctx context.Context) *DetailMfaRecoveryCodesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithHTTPClient(client *http.Client) *DetailMfaRecoveryCodesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidationCode adds the mfaValidationCode to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithMfaValidationCode(mfaValidationCode *string) *DetailMfaRecoveryCodesParams { - o.SetMfaValidationCode(mfaValidationCode) - return o -} - -// SetMfaValidationCode adds the mfaValidationCode to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetMfaValidationCode(mfaValidationCode *string) { - o.MfaValidationCode = mfaValidationCode -} - -// WithMfaValidation adds the mfaValidation to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *DetailMfaRecoveryCodesParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailMfaRecoveryCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.MfaValidationCode != nil { - - // header param mfa-validation-code - if err := r.SetHeaderParam("mfa-validation-code", *o.MfaValidationCode); err != nil { - return err - } - } - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/detail_mfa_recovery_codes_responses.go b/rest_client_api_client/current_identity/detail_mfa_recovery_codes_responses.go deleted file mode 100644 index 4526d215e..000000000 --- a/rest_client_api_client/current_identity/detail_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaRecoveryCodesReader is a Reader for the DetailMfaRecoveryCodes structure. -type DetailMfaRecoveryCodesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailMfaRecoveryCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailMfaRecoveryCodesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailMfaRecoveryCodesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailMfaRecoveryCodesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailMfaRecoveryCodesOK creates a DetailMfaRecoveryCodesOK with default headers values -func NewDetailMfaRecoveryCodesOK() *DetailMfaRecoveryCodesOK { - return &DetailMfaRecoveryCodesOK{} -} - -/* DetailMfaRecoveryCodesOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DetailMfaRecoveryCodesOK struct { - Payload *rest_model.Empty -} - -func (o *DetailMfaRecoveryCodesOK) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/recovery-codes][%d] detailMfaRecoveryCodesOK %+v", 200, o.Payload) -} -func (o *DetailMfaRecoveryCodesOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DetailMfaRecoveryCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaRecoveryCodesUnauthorized creates a DetailMfaRecoveryCodesUnauthorized with default headers values -func NewDetailMfaRecoveryCodesUnauthorized() *DetailMfaRecoveryCodesUnauthorized { - return &DetailMfaRecoveryCodesUnauthorized{} -} - -/* DetailMfaRecoveryCodesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailMfaRecoveryCodesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaRecoveryCodesUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/recovery-codes][%d] detailMfaRecoveryCodesUnauthorized %+v", 401, o.Payload) -} -func (o *DetailMfaRecoveryCodesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaRecoveryCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaRecoveryCodesNotFound creates a DetailMfaRecoveryCodesNotFound with default headers values -func NewDetailMfaRecoveryCodesNotFound() *DetailMfaRecoveryCodesNotFound { - return &DetailMfaRecoveryCodesNotFound{} -} - -/* DetailMfaRecoveryCodesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailMfaRecoveryCodesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaRecoveryCodesNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/recovery-codes][%d] detailMfaRecoveryCodesNotFound %+v", 404, o.Payload) -} -func (o *DetailMfaRecoveryCodesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaRecoveryCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/detail_mfa_responses.go b/rest_client_api_client/current_identity/detail_mfa_responses.go deleted file mode 100644 index d94a0c1c0..000000000 --- a/rest_client_api_client/current_identity/detail_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaReader is a Reader for the DetailMfa structure. -type DetailMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailMfaOK creates a DetailMfaOK with default headers values -func NewDetailMfaOK() *DetailMfaOK { - return &DetailMfaOK{} -} - -/* DetailMfaOK describes a response with status code 200, with default header values. - -The details of an MFA enrollment -*/ -type DetailMfaOK struct { - Payload *rest_model.DetailMfaEnvelope -} - -func (o *DetailMfaOK) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa][%d] detailMfaOK %+v", 200, o.Payload) -} -func (o *DetailMfaOK) GetPayload() *rest_model.DetailMfaEnvelope { - return o.Payload -} - -func (o *DetailMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailMfaEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaUnauthorized creates a DetailMfaUnauthorized with default headers values -func NewDetailMfaUnauthorized() *DetailMfaUnauthorized { - return &DetailMfaUnauthorized{} -} - -/* DetailMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa][%d] detailMfaUnauthorized %+v", 401, o.Payload) -} -func (o *DetailMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaNotFound creates a DetailMfaNotFound with default headers values -func NewDetailMfaNotFound() *DetailMfaNotFound { - return &DetailMfaNotFound{} -} - -/* DetailMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa][%d] detailMfaNotFound %+v", 404, o.Payload) -} -func (o *DetailMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/enroll_mfa_parameters.go b/rest_client_api_client/current_identity/enroll_mfa_parameters.go deleted file mode 100644 index 3dc390b80..000000000 --- a/rest_client_api_client/current_identity/enroll_mfa_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollMfaParams creates a new EnrollMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollMfaParams() *EnrollMfaParams { - return &EnrollMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollMfaParamsWithTimeout creates a new EnrollMfaParams object -// with the ability to set a timeout on a request. -func NewEnrollMfaParamsWithTimeout(timeout time.Duration) *EnrollMfaParams { - return &EnrollMfaParams{ - timeout: timeout, - } -} - -// NewEnrollMfaParamsWithContext creates a new EnrollMfaParams object -// with the ability to set a context for a request. -func NewEnrollMfaParamsWithContext(ctx context.Context) *EnrollMfaParams { - return &EnrollMfaParams{ - Context: ctx, - } -} - -// NewEnrollMfaParamsWithHTTPClient creates a new EnrollMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollMfaParamsWithHTTPClient(client *http.Client) *EnrollMfaParams { - return &EnrollMfaParams{ - HTTPClient: client, - } -} - -/* EnrollMfaParams contains all the parameters to send to the API endpoint - for the enroll mfa operation. - - Typically these are written to a http.Request. -*/ -type EnrollMfaParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollMfaParams) WithDefaults() *EnrollMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll mfa params -func (o *EnrollMfaParams) WithTimeout(timeout time.Duration) *EnrollMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll mfa params -func (o *EnrollMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll mfa params -func (o *EnrollMfaParams) WithContext(ctx context.Context) *EnrollMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll mfa params -func (o *EnrollMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll mfa params -func (o *EnrollMfaParams) WithHTTPClient(client *http.Client) *EnrollMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll mfa params -func (o *EnrollMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/enroll_mfa_responses.go b/rest_client_api_client/current_identity/enroll_mfa_responses.go deleted file mode 100644 index 5467e2587..000000000 --- a/rest_client_api_client/current_identity/enroll_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollMfaReader is a Reader for the EnrollMfa structure. -type EnrollMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewEnrollMfaCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewEnrollMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewEnrollMfaConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollMfaCreated creates a EnrollMfaCreated with default headers values -func NewEnrollMfaCreated() *EnrollMfaCreated { - return &EnrollMfaCreated{} -} - -/* EnrollMfaCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type EnrollMfaCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *EnrollMfaCreated) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa][%d] enrollMfaCreated %+v", 201, o.Payload) -} -func (o *EnrollMfaCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *EnrollMfaCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollMfaUnauthorized creates a EnrollMfaUnauthorized with default headers values -func NewEnrollMfaUnauthorized() *EnrollMfaUnauthorized { - return &EnrollMfaUnauthorized{} -} - -/* EnrollMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type EnrollMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollMfaUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa][%d] enrollMfaUnauthorized %+v", 401, o.Payload) -} -func (o *EnrollMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollMfaConflict creates a EnrollMfaConflict with default headers values -func NewEnrollMfaConflict() *EnrollMfaConflict { - return &EnrollMfaConflict{} -} - -/* EnrollMfaConflict describes a response with status code 409, with default header values. - -The identity is already enrolled in MFA -*/ -type EnrollMfaConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollMfaConflict) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa][%d] enrollMfaConflict %+v", 409, o.Payload) -} -func (o *EnrollMfaConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollMfaConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/get_current_identity_edge_routers_parameters.go b/rest_client_api_client/current_identity/get_current_identity_edge_routers_parameters.go deleted file mode 100644 index 831142841..000000000 --- a/rest_client_api_client/current_identity/get_current_identity_edge_routers_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCurrentIdentityEdgeRoutersParams creates a new GetCurrentIdentityEdgeRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCurrentIdentityEdgeRoutersParams() *GetCurrentIdentityEdgeRoutersParams { - return &GetCurrentIdentityEdgeRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCurrentIdentityEdgeRoutersParamsWithTimeout creates a new GetCurrentIdentityEdgeRoutersParams object -// with the ability to set a timeout on a request. -func NewGetCurrentIdentityEdgeRoutersParamsWithTimeout(timeout time.Duration) *GetCurrentIdentityEdgeRoutersParams { - return &GetCurrentIdentityEdgeRoutersParams{ - timeout: timeout, - } -} - -// NewGetCurrentIdentityEdgeRoutersParamsWithContext creates a new GetCurrentIdentityEdgeRoutersParams object -// with the ability to set a context for a request. -func NewGetCurrentIdentityEdgeRoutersParamsWithContext(ctx context.Context) *GetCurrentIdentityEdgeRoutersParams { - return &GetCurrentIdentityEdgeRoutersParams{ - Context: ctx, - } -} - -// NewGetCurrentIdentityEdgeRoutersParamsWithHTTPClient creates a new GetCurrentIdentityEdgeRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCurrentIdentityEdgeRoutersParamsWithHTTPClient(client *http.Client) *GetCurrentIdentityEdgeRoutersParams { - return &GetCurrentIdentityEdgeRoutersParams{ - HTTPClient: client, - } -} - -/* GetCurrentIdentityEdgeRoutersParams contains all the parameters to send to the API endpoint - for the get current identity edge routers operation. - - Typically these are written to a http.Request. -*/ -type GetCurrentIdentityEdgeRoutersParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get current identity edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentIdentityEdgeRoutersParams) WithDefaults() *GetCurrentIdentityEdgeRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get current identity edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentIdentityEdgeRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get current identity edge routers params -func (o *GetCurrentIdentityEdgeRoutersParams) WithTimeout(timeout time.Duration) *GetCurrentIdentityEdgeRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get current identity edge routers params -func (o *GetCurrentIdentityEdgeRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get current identity edge routers params -func (o *GetCurrentIdentityEdgeRoutersParams) WithContext(ctx context.Context) *GetCurrentIdentityEdgeRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get current identity edge routers params -func (o *GetCurrentIdentityEdgeRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get current identity edge routers params -func (o *GetCurrentIdentityEdgeRoutersParams) WithHTTPClient(client *http.Client) *GetCurrentIdentityEdgeRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get current identity edge routers params -func (o *GetCurrentIdentityEdgeRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCurrentIdentityEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/get_current_identity_edge_routers_responses.go b/rest_client_api_client/current_identity/get_current_identity_edge_routers_responses.go deleted file mode 100644 index 694b928b6..000000000 --- a/rest_client_api_client/current_identity/get_current_identity_edge_routers_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentIdentityEdgeRoutersReader is a Reader for the GetCurrentIdentityEdgeRouters structure. -type GetCurrentIdentityEdgeRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCurrentIdentityEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCurrentIdentityEdgeRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCurrentIdentityEdgeRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCurrentIdentityEdgeRoutersOK creates a GetCurrentIdentityEdgeRoutersOK with default headers values -func NewGetCurrentIdentityEdgeRoutersOK() *GetCurrentIdentityEdgeRoutersOK { - return &GetCurrentIdentityEdgeRoutersOK{} -} - -/* GetCurrentIdentityEdgeRoutersOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type GetCurrentIdentityEdgeRoutersOK struct { - Payload *rest_model.ListCurrentIdentityEdgeRoutersEnvelope -} - -func (o *GetCurrentIdentityEdgeRoutersOK) Error() string { - return fmt.Sprintf("[GET /current-identity/edge-routers][%d] getCurrentIdentityEdgeRoutersOK %+v", 200, o.Payload) -} -func (o *GetCurrentIdentityEdgeRoutersOK) GetPayload() *rest_model.ListCurrentIdentityEdgeRoutersEnvelope { - return o.Payload -} - -func (o *GetCurrentIdentityEdgeRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListCurrentIdentityEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCurrentIdentityEdgeRoutersUnauthorized creates a GetCurrentIdentityEdgeRoutersUnauthorized with default headers values -func NewGetCurrentIdentityEdgeRoutersUnauthorized() *GetCurrentIdentityEdgeRoutersUnauthorized { - return &GetCurrentIdentityEdgeRoutersUnauthorized{} -} - -/* GetCurrentIdentityEdgeRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetCurrentIdentityEdgeRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCurrentIdentityEdgeRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/edge-routers][%d] getCurrentIdentityEdgeRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *GetCurrentIdentityEdgeRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCurrentIdentityEdgeRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/get_current_identity_parameters.go b/rest_client_api_client/current_identity/get_current_identity_parameters.go deleted file mode 100644 index a602b28cb..000000000 --- a/rest_client_api_client/current_identity/get_current_identity_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCurrentIdentityParams creates a new GetCurrentIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCurrentIdentityParams() *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCurrentIdentityParamsWithTimeout creates a new GetCurrentIdentityParams object -// with the ability to set a timeout on a request. -func NewGetCurrentIdentityParamsWithTimeout(timeout time.Duration) *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - timeout: timeout, - } -} - -// NewGetCurrentIdentityParamsWithContext creates a new GetCurrentIdentityParams object -// with the ability to set a context for a request. -func NewGetCurrentIdentityParamsWithContext(ctx context.Context) *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - Context: ctx, - } -} - -// NewGetCurrentIdentityParamsWithHTTPClient creates a new GetCurrentIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCurrentIdentityParamsWithHTTPClient(client *http.Client) *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - HTTPClient: client, - } -} - -/* GetCurrentIdentityParams contains all the parameters to send to the API endpoint - for the get current identity operation. - - Typically these are written to a http.Request. -*/ -type GetCurrentIdentityParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get current identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentIdentityParams) WithDefaults() *GetCurrentIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get current identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get current identity params -func (o *GetCurrentIdentityParams) WithTimeout(timeout time.Duration) *GetCurrentIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get current identity params -func (o *GetCurrentIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get current identity params -func (o *GetCurrentIdentityParams) WithContext(ctx context.Context) *GetCurrentIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get current identity params -func (o *GetCurrentIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get current identity params -func (o *GetCurrentIdentityParams) WithHTTPClient(client *http.Client) *GetCurrentIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get current identity params -func (o *GetCurrentIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCurrentIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/get_current_identity_responses.go b/rest_client_api_client/current_identity/get_current_identity_responses.go deleted file mode 100644 index e028c28d7..000000000 --- a/rest_client_api_client/current_identity/get_current_identity_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentIdentityReader is a Reader for the GetCurrentIdentity structure. -type GetCurrentIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCurrentIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCurrentIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCurrentIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCurrentIdentityOK creates a GetCurrentIdentityOK with default headers values -func NewGetCurrentIdentityOK() *GetCurrentIdentityOK { - return &GetCurrentIdentityOK{} -} - -/* GetCurrentIdentityOK describes a response with status code 200, with default header values. - -The identity associated with the API Session used to issue the request -*/ -type GetCurrentIdentityOK struct { - Payload *rest_model.CurrentIdentityDetailEnvelope -} - -func (o *GetCurrentIdentityOK) Error() string { - return fmt.Sprintf("[GET /current-identity][%d] getCurrentIdentityOK %+v", 200, o.Payload) -} -func (o *GetCurrentIdentityOK) GetPayload() *rest_model.CurrentIdentityDetailEnvelope { - return o.Payload -} - -func (o *GetCurrentIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CurrentIdentityDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCurrentIdentityUnauthorized creates a GetCurrentIdentityUnauthorized with default headers values -func NewGetCurrentIdentityUnauthorized() *GetCurrentIdentityUnauthorized { - return &GetCurrentIdentityUnauthorized{} -} - -/* GetCurrentIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetCurrentIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCurrentIdentityUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity][%d] getCurrentIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *GetCurrentIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCurrentIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/current_identity/verify_mfa_parameters.go b/rest_client_api_client/current_identity/verify_mfa_parameters.go deleted file mode 100644 index e2fafc4c3..000000000 --- a/rest_client_api_client/current_identity/verify_mfa_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewVerifyMfaParams creates a new VerifyMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewVerifyMfaParams() *VerifyMfaParams { - return &VerifyMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewVerifyMfaParamsWithTimeout creates a new VerifyMfaParams object -// with the ability to set a timeout on a request. -func NewVerifyMfaParamsWithTimeout(timeout time.Duration) *VerifyMfaParams { - return &VerifyMfaParams{ - timeout: timeout, - } -} - -// NewVerifyMfaParamsWithContext creates a new VerifyMfaParams object -// with the ability to set a context for a request. -func NewVerifyMfaParamsWithContext(ctx context.Context) *VerifyMfaParams { - return &VerifyMfaParams{ - Context: ctx, - } -} - -// NewVerifyMfaParamsWithHTTPClient creates a new VerifyMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewVerifyMfaParamsWithHTTPClient(client *http.Client) *VerifyMfaParams { - return &VerifyMfaParams{ - HTTPClient: client, - } -} - -/* VerifyMfaParams contains all the parameters to send to the API endpoint - for the verify mfa operation. - - Typically these are written to a http.Request. -*/ -type VerifyMfaParams struct { - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the verify mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VerifyMfaParams) WithDefaults() *VerifyMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the verify mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VerifyMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the verify mfa params -func (o *VerifyMfaParams) WithTimeout(timeout time.Duration) *VerifyMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the verify mfa params -func (o *VerifyMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the verify mfa params -func (o *VerifyMfaParams) WithContext(ctx context.Context) *VerifyMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the verify mfa params -func (o *VerifyMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the verify mfa params -func (o *VerifyMfaParams) WithHTTPClient(client *http.Client) *VerifyMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the verify mfa params -func (o *VerifyMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidation adds the mfaValidation to the verify mfa params -func (o *VerifyMfaParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *VerifyMfaParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the verify mfa params -func (o *VerifyMfaParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *VerifyMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/current_identity/verify_mfa_responses.go b/rest_client_api_client/current_identity/verify_mfa_responses.go deleted file mode 100644 index b2774952f..000000000 --- a/rest_client_api_client/current_identity/verify_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// VerifyMfaReader is a Reader for the VerifyMfa structure. -type VerifyMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *VerifyMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewVerifyMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewVerifyMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewVerifyMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewVerifyMfaOK creates a VerifyMfaOK with default headers values -func NewVerifyMfaOK() *VerifyMfaOK { - return &VerifyMfaOK{} -} - -/* VerifyMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type VerifyMfaOK struct { - Payload *rest_model.Empty -} - -func (o *VerifyMfaOK) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/verify][%d] verifyMfaOK %+v", 200, o.Payload) -} -func (o *VerifyMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *VerifyMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyMfaUnauthorized creates a VerifyMfaUnauthorized with default headers values -func NewVerifyMfaUnauthorized() *VerifyMfaUnauthorized { - return &VerifyMfaUnauthorized{} -} - -/* VerifyMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type VerifyMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyMfaUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/verify][%d] verifyMfaUnauthorized %+v", 401, o.Payload) -} -func (o *VerifyMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyMfaNotFound creates a VerifyMfaNotFound with default headers values -func NewVerifyMfaNotFound() *VerifyMfaNotFound { - return &VerifyMfaNotFound{} -} - -/* VerifyMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type VerifyMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyMfaNotFound) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/verify][%d] verifyMfaNotFound %+v", 404, o.Payload) -} -func (o *VerifyMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/enroll_ca_parameters.go b/rest_client_api_client/enroll/enroll_ca_parameters.go deleted file mode 100644 index 3b2b7a4be..000000000 --- a/rest_client_api_client/enroll/enroll_ca_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollCaParams creates a new EnrollCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollCaParams() *EnrollCaParams { - return &EnrollCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollCaParamsWithTimeout creates a new EnrollCaParams object -// with the ability to set a timeout on a request. -func NewEnrollCaParamsWithTimeout(timeout time.Duration) *EnrollCaParams { - return &EnrollCaParams{ - timeout: timeout, - } -} - -// NewEnrollCaParamsWithContext creates a new EnrollCaParams object -// with the ability to set a context for a request. -func NewEnrollCaParamsWithContext(ctx context.Context) *EnrollCaParams { - return &EnrollCaParams{ - Context: ctx, - } -} - -// NewEnrollCaParamsWithHTTPClient creates a new EnrollCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollCaParamsWithHTTPClient(client *http.Client) *EnrollCaParams { - return &EnrollCaParams{ - HTTPClient: client, - } -} - -/* EnrollCaParams contains all the parameters to send to the API endpoint - for the enroll ca operation. - - Typically these are written to a http.Request. -*/ -type EnrollCaParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollCaParams) WithDefaults() *EnrollCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll ca params -func (o *EnrollCaParams) WithTimeout(timeout time.Duration) *EnrollCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll ca params -func (o *EnrollCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll ca params -func (o *EnrollCaParams) WithContext(ctx context.Context) *EnrollCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll ca params -func (o *EnrollCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll ca params -func (o *EnrollCaParams) WithHTTPClient(client *http.Client) *EnrollCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll ca params -func (o *EnrollCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/enroll_ca_responses.go b/rest_client_api_client/enroll/enroll_ca_responses.go deleted file mode 100644 index b9b0c9f20..000000000 --- a/rest_client_api_client/enroll/enroll_ca_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollCaReader is a Reader for the EnrollCa structure. -type EnrollCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnrollCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewEnrollCaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollCaOK creates a EnrollCaOK with default headers values -func NewEnrollCaOK() *EnrollCaOK { - return &EnrollCaOK{} -} - -/* EnrollCaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type EnrollCaOK struct { - Payload *rest_model.Empty -} - -func (o *EnrollCaOK) Error() string { - return fmt.Sprintf("[POST /enroll/ca][%d] enrollCaOK %+v", 200, o.Payload) -} -func (o *EnrollCaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *EnrollCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollCaNotFound creates a EnrollCaNotFound with default headers values -func NewEnrollCaNotFound() *EnrollCaNotFound { - return &EnrollCaNotFound{} -} - -/* EnrollCaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type EnrollCaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollCaNotFound) Error() string { - return fmt.Sprintf("[POST /enroll/ca][%d] enrollCaNotFound %+v", 404, o.Payload) -} -func (o *EnrollCaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollCaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/enroll_client.go b/rest_client_api_client/enroll/enroll_client.go deleted file mode 100644 index c7b3a87bc..000000000 --- a/rest_client_api_client/enroll/enroll_client.go +++ /dev/null @@ -1,382 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new enroll API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for enroll API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - Enroll(params *EnrollParams, opts ...ClientOption) (*EnrollOK, error) - - EnrollCa(params *EnrollCaParams, opts ...ClientOption) (*EnrollCaOK, error) - - EnrollErOtt(params *EnrollErOttParams, opts ...ClientOption) (*EnrollErOttOK, error) - - EnrollOtt(params *EnrollOttParams, opts ...ClientOption) (*EnrollOttOK, error) - - EnrollOttCa(params *EnrollOttCaParams, opts ...ClientOption) (*EnrollOttCaOK, error) - - ErnollUpdb(params *ErnollUpdbParams, opts ...ClientOption) (*ErnollUpdbOK, error) - - ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams, opts ...ClientOption) (*ExtendRouterEnrollmentOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Enroll legacies enrollment endpoint - - endpoint defers to the logic in the more specific `enroll/*` endpoints -*/ -func (a *Client) Enroll(params *EnrollParams, opts ...ClientOption) (*EnrollOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollParams() - } - op := &runtime.ClientOperation{ - ID: "enroll", - Method: "POST", - PathPattern: "/enroll", - ProducesMediaTypes: []string{"application/json", "application/x-pem-file"}, - ConsumesMediaTypes: []string{"application/json", "application/pkcs10", "application/x-pem-file", "text/plain"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enroll: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnrollCa enrolls an identity with a pre exchanged certificate - - For CA auto enrollment, an identity is not created beforehand. -Instead one will be created during enrollment. The client will present a client certificate that is signed by a -Certificate Authority that has been added and verified (See POST /cas and POST /cas/{id}/verify). - -During this process no CSRs are requires as the client should already be in possession of a valid certificate. - -*/ -func (a *Client) EnrollCa(params *EnrollCaParams, opts ...ClientOption) (*EnrollCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollCaParams() - } - op := &runtime.ClientOperation{ - ID: "enrollCa", - Method: "POST", - PathPattern: "/enroll/ca", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollCaReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enrollCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnrollErOtt enrolls an edge router - - Enrolls an edge-router via a one-time-token to establish a certificate based identity. - -*/ -func (a *Client) EnrollErOtt(params *EnrollErOttParams, opts ...ClientOption) (*EnrollErOttOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollErOttParams() - } - op := &runtime.ClientOperation{ - ID: "enrollErOtt", - Method: "POST", - PathPattern: "/enroll/erott", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollErOttReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollErOttOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enrollErOtt: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnrollOtt enrolls an identity via one time token - - Enroll an identity via a one-time-token which is supplied via a query string parameter. This enrollment method -expects a PEM encoded CSRs to be provided for fulfillment. It is up to the enrolling identity to manage the -private key backing the CSR request. - -*/ -func (a *Client) EnrollOtt(params *EnrollOttParams, opts ...ClientOption) (*EnrollOttOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollOttParams() - } - op := &runtime.ClientOperation{ - ID: "enrollOtt", - Method: "POST", - PathPattern: "/enroll/ott", - ProducesMediaTypes: []string{"application/x-x509-user-cert"}, - ConsumesMediaTypes: []string{"application/pkcs10"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollOttReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollOttOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enrollOtt: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnrollOttCa enrolls an identity via one time token with a pre exchanged client certificate - - Enroll an identity via a one-time-token that also requires a pre-exchanged client certificate to match a -Certificate Authority that has been added and verified (See POST /cas and POST /cas{id}/verify). The client -must present a client certificate signed by CA associated with the enrollment. This enrollment is similar to -CA auto enrollment except that is required the identity to be pre-created. - -As the client certificate has been pre-exchanged there is no CSR input to this enrollment method. - -*/ -func (a *Client) EnrollOttCa(params *EnrollOttCaParams, opts ...ClientOption) (*EnrollOttCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollOttCaParams() - } - op := &runtime.ClientOperation{ - ID: "enrollOttCa", - Method: "POST", - PathPattern: "/enroll/ottca", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollOttCaReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollOttCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enrollOttCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ErnollUpdb enrolls an identity via one time token - - Enrolls an identity via a one-time-token to establish an initial username and password combination - -*/ -func (a *Client) ErnollUpdb(params *ErnollUpdbParams, opts ...ClientOption) (*ErnollUpdbOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewErnollUpdbParams() - } - op := &runtime.ClientOperation{ - ID: "ernollUpdb", - Method: "POST", - PathPattern: "/enroll/updb", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ErnollUpdbReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ErnollUpdbOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for ernollUpdb: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExtendRouterEnrollment extends the life of a currently enrolled router s certificates - - Allows a router to extend its certificates' expiration date by -using its current and valid client certificate to submit a CSR. This CSR may -be passed in using a new private key, thus allowing private key rotation or swapping. - -After completion any new connections must be made with certificates returned from a 200 OK -response. The previous client certificate is rendered invalid for use with the controller even if it -has not expired. - -This request must be made using the existing, valid, client certificate. - -*/ -func (a *Client) ExtendRouterEnrollment(params *ExtendRouterEnrollmentParams, opts ...ClientOption) (*ExtendRouterEnrollmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExtendRouterEnrollmentParams() - } - op := &runtime.ClientOperation{ - ID: "extendRouterEnrollment", - Method: "POST", - PathPattern: "/enroll/extend/router", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExtendRouterEnrollmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExtendRouterEnrollmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for extendRouterEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/enroll/enroll_er_ott_parameters.go b/rest_client_api_client/enroll/enroll_er_ott_parameters.go deleted file mode 100644 index f4a86714b..000000000 --- a/rest_client_api_client/enroll/enroll_er_ott_parameters.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollErOttParams creates a new EnrollErOttParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollErOttParams() *EnrollErOttParams { - return &EnrollErOttParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollErOttParamsWithTimeout creates a new EnrollErOttParams object -// with the ability to set a timeout on a request. -func NewEnrollErOttParamsWithTimeout(timeout time.Duration) *EnrollErOttParams { - return &EnrollErOttParams{ - timeout: timeout, - } -} - -// NewEnrollErOttParamsWithContext creates a new EnrollErOttParams object -// with the ability to set a context for a request. -func NewEnrollErOttParamsWithContext(ctx context.Context) *EnrollErOttParams { - return &EnrollErOttParams{ - Context: ctx, - } -} - -// NewEnrollErOttParamsWithHTTPClient creates a new EnrollErOttParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollErOttParamsWithHTTPClient(client *http.Client) *EnrollErOttParams { - return &EnrollErOttParams{ - HTTPClient: client, - } -} - -/* EnrollErOttParams contains all the parameters to send to the API endpoint - for the enroll er ott operation. - - Typically these are written to a http.Request. -*/ -type EnrollErOttParams struct { - - // Token. - // - // Format: uuid - Token strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll er ott params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollErOttParams) WithDefaults() *EnrollErOttParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll er ott params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollErOttParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll er ott params -func (o *EnrollErOttParams) WithTimeout(timeout time.Duration) *EnrollErOttParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll er ott params -func (o *EnrollErOttParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll er ott params -func (o *EnrollErOttParams) WithContext(ctx context.Context) *EnrollErOttParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll er ott params -func (o *EnrollErOttParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll er ott params -func (o *EnrollErOttParams) WithHTTPClient(client *http.Client) *EnrollErOttParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll er ott params -func (o *EnrollErOttParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithToken adds the token to the enroll er ott params -func (o *EnrollErOttParams) WithToken(token strfmt.UUID) *EnrollErOttParams { - o.SetToken(token) - return o -} - -// SetToken adds the token to the enroll er ott params -func (o *EnrollErOttParams) SetToken(token strfmt.UUID) { - o.Token = token -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollErOttParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param token - qrToken := o.Token - qToken := qrToken.String() - if qToken != "" { - - if err := r.SetQueryParam("token", qToken); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/enroll_er_ott_responses.go b/rest_client_api_client/enroll/enroll_er_ott_responses.go deleted file mode 100644 index 114be39d3..000000000 --- a/rest_client_api_client/enroll/enroll_er_ott_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollErOttReader is a Reader for the EnrollErOtt structure. -type EnrollErOttReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollErOttReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnrollErOttOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollErOttOK creates a EnrollErOttOK with default headers values -func NewEnrollErOttOK() *EnrollErOttOK { - return &EnrollErOttOK{} -} - -/* EnrollErOttOK describes a response with status code 200, with default header values. - -A response containing the edge routers signed certificates (server chain, server cert, CAs). -*/ -type EnrollErOttOK struct { - Payload *rest_model.EnrollmentCertsEnvelope -} - -func (o *EnrollErOttOK) Error() string { - return fmt.Sprintf("[POST /enroll/erott][%d] enrollErOttOK %+v", 200, o.Payload) -} -func (o *EnrollErOttOK) GetPayload() *rest_model.EnrollmentCertsEnvelope { - return o.Payload -} - -func (o *EnrollErOttOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.EnrollmentCertsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/enroll_ott_ca_parameters.go b/rest_client_api_client/enroll/enroll_ott_ca_parameters.go deleted file mode 100644 index 915f29552..000000000 --- a/rest_client_api_client/enroll/enroll_ott_ca_parameters.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollOttCaParams creates a new EnrollOttCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollOttCaParams() *EnrollOttCaParams { - return &EnrollOttCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollOttCaParamsWithTimeout creates a new EnrollOttCaParams object -// with the ability to set a timeout on a request. -func NewEnrollOttCaParamsWithTimeout(timeout time.Duration) *EnrollOttCaParams { - return &EnrollOttCaParams{ - timeout: timeout, - } -} - -// NewEnrollOttCaParamsWithContext creates a new EnrollOttCaParams object -// with the ability to set a context for a request. -func NewEnrollOttCaParamsWithContext(ctx context.Context) *EnrollOttCaParams { - return &EnrollOttCaParams{ - Context: ctx, - } -} - -// NewEnrollOttCaParamsWithHTTPClient creates a new EnrollOttCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollOttCaParamsWithHTTPClient(client *http.Client) *EnrollOttCaParams { - return &EnrollOttCaParams{ - HTTPClient: client, - } -} - -/* EnrollOttCaParams contains all the parameters to send to the API endpoint - for the enroll ott ca operation. - - Typically these are written to a http.Request. -*/ -type EnrollOttCaParams struct { - - // Token. - // - // Format: uuid - Token strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll ott ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollOttCaParams) WithDefaults() *EnrollOttCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll ott ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollOttCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll ott ca params -func (o *EnrollOttCaParams) WithTimeout(timeout time.Duration) *EnrollOttCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll ott ca params -func (o *EnrollOttCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll ott ca params -func (o *EnrollOttCaParams) WithContext(ctx context.Context) *EnrollOttCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll ott ca params -func (o *EnrollOttCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll ott ca params -func (o *EnrollOttCaParams) WithHTTPClient(client *http.Client) *EnrollOttCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll ott ca params -func (o *EnrollOttCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithToken adds the token to the enroll ott ca params -func (o *EnrollOttCaParams) WithToken(token strfmt.UUID) *EnrollOttCaParams { - o.SetToken(token) - return o -} - -// SetToken adds the token to the enroll ott ca params -func (o *EnrollOttCaParams) SetToken(token strfmt.UUID) { - o.Token = token -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollOttCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param token - qrToken := o.Token - qToken := qrToken.String() - if qToken != "" { - - if err := r.SetQueryParam("token", qToken); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/enroll_ott_ca_responses.go b/rest_client_api_client/enroll/enroll_ott_ca_responses.go deleted file mode 100644 index f1f98e1d6..000000000 --- a/rest_client_api_client/enroll/enroll_ott_ca_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollOttCaReader is a Reader for the EnrollOttCa structure. -type EnrollOttCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollOttCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnrollOttCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollOttCaOK creates a EnrollOttCaOK with default headers values -func NewEnrollOttCaOK() *EnrollOttCaOK { - return &EnrollOttCaOK{} -} - -/* EnrollOttCaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type EnrollOttCaOK struct { - Payload *rest_model.Empty -} - -func (o *EnrollOttCaOK) Error() string { - return fmt.Sprintf("[POST /enroll/ottca][%d] enrollOttCaOK %+v", 200, o.Payload) -} -func (o *EnrollOttCaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *EnrollOttCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/enroll_ott_parameters.go b/rest_client_api_client/enroll/enroll_ott_parameters.go deleted file mode 100644 index b31f4d530..000000000 --- a/rest_client_api_client/enroll/enroll_ott_parameters.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollOttParams creates a new EnrollOttParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollOttParams() *EnrollOttParams { - return &EnrollOttParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollOttParamsWithTimeout creates a new EnrollOttParams object -// with the ability to set a timeout on a request. -func NewEnrollOttParamsWithTimeout(timeout time.Duration) *EnrollOttParams { - return &EnrollOttParams{ - timeout: timeout, - } -} - -// NewEnrollOttParamsWithContext creates a new EnrollOttParams object -// with the ability to set a context for a request. -func NewEnrollOttParamsWithContext(ctx context.Context) *EnrollOttParams { - return &EnrollOttParams{ - Context: ctx, - } -} - -// NewEnrollOttParamsWithHTTPClient creates a new EnrollOttParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollOttParamsWithHTTPClient(client *http.Client) *EnrollOttParams { - return &EnrollOttParams{ - HTTPClient: client, - } -} - -/* EnrollOttParams contains all the parameters to send to the API endpoint - for the enroll ott operation. - - Typically these are written to a http.Request. -*/ -type EnrollOttParams struct { - - // Token. - // - // Format: uuid - Token strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll ott params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollOttParams) WithDefaults() *EnrollOttParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll ott params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollOttParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll ott params -func (o *EnrollOttParams) WithTimeout(timeout time.Duration) *EnrollOttParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll ott params -func (o *EnrollOttParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll ott params -func (o *EnrollOttParams) WithContext(ctx context.Context) *EnrollOttParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll ott params -func (o *EnrollOttParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll ott params -func (o *EnrollOttParams) WithHTTPClient(client *http.Client) *EnrollOttParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll ott params -func (o *EnrollOttParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithToken adds the token to the enroll ott params -func (o *EnrollOttParams) WithToken(token strfmt.UUID) *EnrollOttParams { - o.SetToken(token) - return o -} - -// SetToken adds the token to the enroll ott params -func (o *EnrollOttParams) SetToken(token strfmt.UUID) { - o.Token = token -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollOttParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param token - qrToken := o.Token - qToken := qrToken.String() - if qToken != "" { - - if err := r.SetQueryParam("token", qToken); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/enroll_ott_responses.go b/rest_client_api_client/enroll/enroll_ott_responses.go deleted file mode 100644 index 18e76cd3d..000000000 --- a/rest_client_api_client/enroll/enroll_ott_responses.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollOttReader is a Reader for the EnrollOtt structure. -type EnrollOttReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollOttReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnrollOttOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewEnrollOttNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollOttOK creates a EnrollOttOK with default headers values -func NewEnrollOttOK() *EnrollOttOK { - return &EnrollOttOK{} -} - -/* EnrollOttOK describes a response with status code 200, with default header values. - -A PEM encoded certificate signed by the internal Ziti CA -*/ -type EnrollOttOK struct { - Payload string -} - -func (o *EnrollOttOK) Error() string { - return fmt.Sprintf("[POST /enroll/ott][%d] enrollOttOK %+v", 200, o.Payload) -} -func (o *EnrollOttOK) GetPayload() string { - return o.Payload -} - -func (o *EnrollOttOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollOttNotFound creates a EnrollOttNotFound with default headers values -func NewEnrollOttNotFound() *EnrollOttNotFound { - return &EnrollOttNotFound{} -} - -/* EnrollOttNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type EnrollOttNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollOttNotFound) Error() string { - return fmt.Sprintf("[POST /enroll/ott][%d] enrollOttNotFound %+v", 404, o.Payload) -} -func (o *EnrollOttNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollOttNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/enroll_parameters.go b/rest_client_api_client/enroll/enroll_parameters.go deleted file mode 100644 index 27bb6dc7a..000000000 --- a/rest_client_api_client/enroll/enroll_parameters.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollParams creates a new EnrollParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollParams() *EnrollParams { - return &EnrollParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollParamsWithTimeout creates a new EnrollParams object -// with the ability to set a timeout on a request. -func NewEnrollParamsWithTimeout(timeout time.Duration) *EnrollParams { - return &EnrollParams{ - timeout: timeout, - } -} - -// NewEnrollParamsWithContext creates a new EnrollParams object -// with the ability to set a context for a request. -func NewEnrollParamsWithContext(ctx context.Context) *EnrollParams { - return &EnrollParams{ - Context: ctx, - } -} - -// NewEnrollParamsWithHTTPClient creates a new EnrollParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollParamsWithHTTPClient(client *http.Client) *EnrollParams { - return &EnrollParams{ - HTTPClient: client, - } -} - -/* EnrollParams contains all the parameters to send to the API endpoint - for the enroll operation. - - Typically these are written to a http.Request. -*/ -type EnrollParams struct { - - // Token. - // - // Format: uuid - Token *strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollParams) WithDefaults() *EnrollParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll params -func (o *EnrollParams) WithTimeout(timeout time.Duration) *EnrollParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll params -func (o *EnrollParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll params -func (o *EnrollParams) WithContext(ctx context.Context) *EnrollParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll params -func (o *EnrollParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll params -func (o *EnrollParams) WithHTTPClient(client *http.Client) *EnrollParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll params -func (o *EnrollParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithToken adds the token to the enroll params -func (o *EnrollParams) WithToken(token *strfmt.UUID) *EnrollParams { - o.SetToken(token) - return o -} - -// SetToken adds the token to the enroll params -func (o *EnrollParams) SetToken(token *strfmt.UUID) { - o.Token = token -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Token != nil { - - // query param token - var qrToken strfmt.UUID - - if o.Token != nil { - qrToken = *o.Token - } - qToken := qrToken.String() - if qToken != "" { - - if err := r.SetQueryParam("token", qToken); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/enroll_responses.go b/rest_client_api_client/enroll/enroll_responses.go deleted file mode 100644 index 5e1fa5b9a..000000000 --- a/rest_client_api_client/enroll/enroll_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollReader is a Reader for the Enroll structure. -type EnrollReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnrollOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewEnrollNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollOK creates a EnrollOK with default headers values -func NewEnrollOK() *EnrollOK { - return &EnrollOK{} -} - -/* EnrollOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type EnrollOK struct { - Payload *rest_model.Empty -} - -func (o *EnrollOK) Error() string { - return fmt.Sprintf("[POST /enroll][%d] enrollOK %+v", 200, o.Payload) -} -func (o *EnrollOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *EnrollOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollNotFound creates a EnrollNotFound with default headers values -func NewEnrollNotFound() *EnrollNotFound { - return &EnrollNotFound{} -} - -/* EnrollNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type EnrollNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollNotFound) Error() string { - return fmt.Sprintf("[POST /enroll][%d] enrollNotFound %+v", 404, o.Payload) -} -func (o *EnrollNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/ernoll_updb_parameters.go b/rest_client_api_client/enroll/ernoll_updb_parameters.go deleted file mode 100644 index b54536ad6..000000000 --- a/rest_client_api_client/enroll/ernoll_updb_parameters.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewErnollUpdbParams creates a new ErnollUpdbParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewErnollUpdbParams() *ErnollUpdbParams { - return &ErnollUpdbParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewErnollUpdbParamsWithTimeout creates a new ErnollUpdbParams object -// with the ability to set a timeout on a request. -func NewErnollUpdbParamsWithTimeout(timeout time.Duration) *ErnollUpdbParams { - return &ErnollUpdbParams{ - timeout: timeout, - } -} - -// NewErnollUpdbParamsWithContext creates a new ErnollUpdbParams object -// with the ability to set a context for a request. -func NewErnollUpdbParamsWithContext(ctx context.Context) *ErnollUpdbParams { - return &ErnollUpdbParams{ - Context: ctx, - } -} - -// NewErnollUpdbParamsWithHTTPClient creates a new ErnollUpdbParams object -// with the ability to set a custom HTTPClient for a request. -func NewErnollUpdbParamsWithHTTPClient(client *http.Client) *ErnollUpdbParams { - return &ErnollUpdbParams{ - HTTPClient: client, - } -} - -/* ErnollUpdbParams contains all the parameters to send to the API endpoint - for the ernoll updb operation. - - Typically these are written to a http.Request. -*/ -type ErnollUpdbParams struct { - - // Token. - // - // Format: uuid - Token strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the ernoll updb params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ErnollUpdbParams) WithDefaults() *ErnollUpdbParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the ernoll updb params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ErnollUpdbParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the ernoll updb params -func (o *ErnollUpdbParams) WithTimeout(timeout time.Duration) *ErnollUpdbParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the ernoll updb params -func (o *ErnollUpdbParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the ernoll updb params -func (o *ErnollUpdbParams) WithContext(ctx context.Context) *ErnollUpdbParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the ernoll updb params -func (o *ErnollUpdbParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the ernoll updb params -func (o *ErnollUpdbParams) WithHTTPClient(client *http.Client) *ErnollUpdbParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the ernoll updb params -func (o *ErnollUpdbParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithToken adds the token to the ernoll updb params -func (o *ErnollUpdbParams) WithToken(token strfmt.UUID) *ErnollUpdbParams { - o.SetToken(token) - return o -} - -// SetToken adds the token to the ernoll updb params -func (o *ErnollUpdbParams) SetToken(token strfmt.UUID) { - o.Token = token -} - -// WriteToRequest writes these params to a swagger request -func (o *ErnollUpdbParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // query param token - qrToken := o.Token - qToken := qrToken.String() - if qToken != "" { - - if err := r.SetQueryParam("token", qToken); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/ernoll_updb_responses.go b/rest_client_api_client/enroll/ernoll_updb_responses.go deleted file mode 100644 index a4fb9d52a..000000000 --- a/rest_client_api_client/enroll/ernoll_updb_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ErnollUpdbReader is a Reader for the ErnollUpdb structure. -type ErnollUpdbReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ErnollUpdbReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewErnollUpdbOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewErnollUpdbNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewErnollUpdbOK creates a ErnollUpdbOK with default headers values -func NewErnollUpdbOK() *ErnollUpdbOK { - return &ErnollUpdbOK{} -} - -/* ErnollUpdbOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type ErnollUpdbOK struct { - Payload *rest_model.Empty -} - -func (o *ErnollUpdbOK) Error() string { - return fmt.Sprintf("[POST /enroll/updb][%d] ernollUpdbOK %+v", 200, o.Payload) -} -func (o *ErnollUpdbOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *ErnollUpdbOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewErnollUpdbNotFound creates a ErnollUpdbNotFound with default headers values -func NewErnollUpdbNotFound() *ErnollUpdbNotFound { - return &ErnollUpdbNotFound{} -} - -/* ErnollUpdbNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ErnollUpdbNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ErnollUpdbNotFound) Error() string { - return fmt.Sprintf("[POST /enroll/updb][%d] ernollUpdbNotFound %+v", 404, o.Payload) -} -func (o *ErnollUpdbNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ErnollUpdbNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/enroll/extend_router_enrollment_parameters.go b/rest_client_api_client/enroll/extend_router_enrollment_parameters.go deleted file mode 100644 index 3e583783f..000000000 --- a/rest_client_api_client/enroll/extend_router_enrollment_parameters.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendRouterEnrollmentParams creates a new ExtendRouterEnrollmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExtendRouterEnrollmentParams() *ExtendRouterEnrollmentParams { - return &ExtendRouterEnrollmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExtendRouterEnrollmentParamsWithTimeout creates a new ExtendRouterEnrollmentParams object -// with the ability to set a timeout on a request. -func NewExtendRouterEnrollmentParamsWithTimeout(timeout time.Duration) *ExtendRouterEnrollmentParams { - return &ExtendRouterEnrollmentParams{ - timeout: timeout, - } -} - -// NewExtendRouterEnrollmentParamsWithContext creates a new ExtendRouterEnrollmentParams object -// with the ability to set a context for a request. -func NewExtendRouterEnrollmentParamsWithContext(ctx context.Context) *ExtendRouterEnrollmentParams { - return &ExtendRouterEnrollmentParams{ - Context: ctx, - } -} - -// NewExtendRouterEnrollmentParamsWithHTTPClient creates a new ExtendRouterEnrollmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewExtendRouterEnrollmentParamsWithHTTPClient(client *http.Client) *ExtendRouterEnrollmentParams { - return &ExtendRouterEnrollmentParams{ - HTTPClient: client, - } -} - -/* ExtendRouterEnrollmentParams contains all the parameters to send to the API endpoint - for the extend router enrollment operation. - - Typically these are written to a http.Request. -*/ -type ExtendRouterEnrollmentParams struct { - - // RouterExtendEnrollmentRequest. - RouterExtendEnrollmentRequest *rest_model.RouterExtendEnrollmentRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the extend router enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendRouterEnrollmentParams) WithDefaults() *ExtendRouterEnrollmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the extend router enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendRouterEnrollmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) WithTimeout(timeout time.Duration) *ExtendRouterEnrollmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) WithContext(ctx context.Context) *ExtendRouterEnrollmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) WithHTTPClient(client *http.Client) *ExtendRouterEnrollmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRouterExtendEnrollmentRequest adds the routerExtendEnrollmentRequest to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) WithRouterExtendEnrollmentRequest(routerExtendEnrollmentRequest *rest_model.RouterExtendEnrollmentRequest) *ExtendRouterEnrollmentParams { - o.SetRouterExtendEnrollmentRequest(routerExtendEnrollmentRequest) - return o -} - -// SetRouterExtendEnrollmentRequest adds the routerExtendEnrollmentRequest to the extend router enrollment params -func (o *ExtendRouterEnrollmentParams) SetRouterExtendEnrollmentRequest(routerExtendEnrollmentRequest *rest_model.RouterExtendEnrollmentRequest) { - o.RouterExtendEnrollmentRequest = routerExtendEnrollmentRequest -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtendRouterEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.RouterExtendEnrollmentRequest != nil { - if err := r.SetBodyParam(o.RouterExtendEnrollmentRequest); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/enroll/extend_router_enrollment_responses.go b/rest_client_api_client/enroll/extend_router_enrollment_responses.go deleted file mode 100644 index c104cdf45..000000000 --- a/rest_client_api_client/enroll/extend_router_enrollment_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ExtendRouterEnrollmentReader is a Reader for the ExtendRouterEnrollment structure. -type ExtendRouterEnrollmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExtendRouterEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExtendRouterEnrollmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewExtendRouterEnrollmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExtendRouterEnrollmentOK creates a ExtendRouterEnrollmentOK with default headers values -func NewExtendRouterEnrollmentOK() *ExtendRouterEnrollmentOK { - return &ExtendRouterEnrollmentOK{} -} - -/* ExtendRouterEnrollmentOK describes a response with status code 200, with default header values. - -A response containg the edge routers new signed certificates (server chain, server cert, CAs). -*/ -type ExtendRouterEnrollmentOK struct { - Payload *rest_model.EnrollmentCertsEnvelope -} - -func (o *ExtendRouterEnrollmentOK) Error() string { - return fmt.Sprintf("[POST /enroll/extend/router][%d] extendRouterEnrollmentOK %+v", 200, o.Payload) -} -func (o *ExtendRouterEnrollmentOK) GetPayload() *rest_model.EnrollmentCertsEnvelope { - return o.Payload -} - -func (o *ExtendRouterEnrollmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.EnrollmentCertsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExtendRouterEnrollmentUnauthorized creates a ExtendRouterEnrollmentUnauthorized with default headers values -func NewExtendRouterEnrollmentUnauthorized() *ExtendRouterEnrollmentUnauthorized { - return &ExtendRouterEnrollmentUnauthorized{} -} - -/* ExtendRouterEnrollmentUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ExtendRouterEnrollmentUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ExtendRouterEnrollmentUnauthorized) Error() string { - return fmt.Sprintf("[POST /enroll/extend/router][%d] extendRouterEnrollmentUnauthorized %+v", 401, o.Payload) -} -func (o *ExtendRouterEnrollmentUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ExtendRouterEnrollmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/external_jwt_signer/external_jwt_signer_client.go b/rest_client_api_client/external_jwt_signer/external_jwt_signer_client.go deleted file mode 100644 index f3c7b7e96..000000000 --- a/rest_client_api_client/external_jwt_signer/external_jwt_signer_client.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new external jwt signer API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for external jwt signer API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ListExternalJWTSigners(params *ListExternalJWTSignersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListExternalJWTSignersOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - ListExternalJWTSigners lists client authentication external JWT - - Retrieves a list of external JWT signers for authentication -*/ -func (a *Client) ListExternalJWTSigners(params *ListExternalJWTSignersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListExternalJWTSignersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListExternalJWTSignersParams() - } - op := &runtime.ClientOperation{ - ID: "listExternalJwtSigners", - Method: "GET", - PathPattern: "/external-jwt-signers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListExternalJWTSignersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListExternalJWTSignersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listExternalJwtSigners: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/external_jwt_signer/list_external_jwt_signers_parameters.go b/rest_client_api_client/external_jwt_signer/list_external_jwt_signers_parameters.go deleted file mode 100644 index 1db550815..000000000 --- a/rest_client_api_client/external_jwt_signer/list_external_jwt_signers_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListExternalJWTSignersParams creates a new ListExternalJWTSignersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListExternalJWTSignersParams() *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListExternalJWTSignersParamsWithTimeout creates a new ListExternalJWTSignersParams object -// with the ability to set a timeout on a request. -func NewListExternalJWTSignersParamsWithTimeout(timeout time.Duration) *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - timeout: timeout, - } -} - -// NewListExternalJWTSignersParamsWithContext creates a new ListExternalJWTSignersParams object -// with the ability to set a context for a request. -func NewListExternalJWTSignersParamsWithContext(ctx context.Context) *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - Context: ctx, - } -} - -// NewListExternalJWTSignersParamsWithHTTPClient creates a new ListExternalJWTSignersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListExternalJWTSignersParamsWithHTTPClient(client *http.Client) *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - HTTPClient: client, - } -} - -/* ListExternalJWTSignersParams contains all the parameters to send to the API endpoint - for the list external Jwt signers operation. - - Typically these are written to a http.Request. -*/ -type ListExternalJWTSignersParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list external Jwt signers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListExternalJWTSignersParams) WithDefaults() *ListExternalJWTSignersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list external Jwt signers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListExternalJWTSignersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithTimeout(timeout time.Duration) *ListExternalJWTSignersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithContext(ctx context.Context) *ListExternalJWTSignersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithHTTPClient(client *http.Client) *ListExternalJWTSignersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithFilter(filter *string) *ListExternalJWTSignersParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithLimit(limit *int64) *ListExternalJWTSignersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithOffset(offset *int64) *ListExternalJWTSignersParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListExternalJWTSignersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/external_jwt_signer/list_external_jwt_signers_responses.go b/rest_client_api_client/external_jwt_signer/list_external_jwt_signers_responses.go deleted file mode 100644 index ed20ade56..000000000 --- a/rest_client_api_client/external_jwt_signer/list_external_jwt_signers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListExternalJWTSignersReader is a Reader for the ListExternalJWTSigners structure. -type ListExternalJWTSignersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListExternalJWTSignersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListExternalJWTSignersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListExternalJWTSignersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListExternalJWTSignersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListExternalJWTSignersOK creates a ListExternalJWTSignersOK with default headers values -func NewListExternalJWTSignersOK() *ListExternalJWTSignersOK { - return &ListExternalJWTSignersOK{} -} - -/* ListExternalJWTSignersOK describes a response with status code 200, with default header values. - -A list of External JWT Signers -*/ -type ListExternalJWTSignersOK struct { - Payload *rest_model.ListClientExternalJWTSignersEnvelope -} - -func (o *ListExternalJWTSignersOK) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers][%d] listExternalJwtSignersOK %+v", 200, o.Payload) -} -func (o *ListExternalJWTSignersOK) GetPayload() *rest_model.ListClientExternalJWTSignersEnvelope { - return o.Payload -} - -func (o *ListExternalJWTSignersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListClientExternalJWTSignersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListExternalJWTSignersBadRequest creates a ListExternalJWTSignersBadRequest with default headers values -func NewListExternalJWTSignersBadRequest() *ListExternalJWTSignersBadRequest { - return &ListExternalJWTSignersBadRequest{} -} - -/* ListExternalJWTSignersBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListExternalJWTSignersBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListExternalJWTSignersBadRequest) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers][%d] listExternalJwtSignersBadRequest %+v", 400, o.Payload) -} -func (o *ListExternalJWTSignersBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListExternalJWTSignersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListExternalJWTSignersUnauthorized creates a ListExternalJWTSignersUnauthorized with default headers values -func NewListExternalJWTSignersUnauthorized() *ListExternalJWTSignersUnauthorized { - return &ListExternalJWTSignersUnauthorized{} -} - -/* ListExternalJWTSignersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListExternalJWTSignersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListExternalJWTSignersUnauthorized) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers][%d] listExternalJwtSignersUnauthorized %+v", 401, o.Payload) -} -func (o *ListExternalJWTSignersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListExternalJWTSignersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/informational/detail_spec_body_parameters.go b/rest_client_api_client/informational/detail_spec_body_parameters.go deleted file mode 100644 index 49fad06ba..000000000 --- a/rest_client_api_client/informational/detail_spec_body_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecBodyParams creates a new DetailSpecBodyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSpecBodyParams() *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSpecBodyParamsWithTimeout creates a new DetailSpecBodyParams object -// with the ability to set a timeout on a request. -func NewDetailSpecBodyParamsWithTimeout(timeout time.Duration) *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - timeout: timeout, - } -} - -// NewDetailSpecBodyParamsWithContext creates a new DetailSpecBodyParams object -// with the ability to set a context for a request. -func NewDetailSpecBodyParamsWithContext(ctx context.Context) *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - Context: ctx, - } -} - -// NewDetailSpecBodyParamsWithHTTPClient creates a new DetailSpecBodyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSpecBodyParamsWithHTTPClient(client *http.Client) *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - HTTPClient: client, - } -} - -/* DetailSpecBodyParams contains all the parameters to send to the API endpoint - for the detail spec body operation. - - Typically these are written to a http.Request. -*/ -type DetailSpecBodyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail spec body params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecBodyParams) WithDefaults() *DetailSpecBodyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail spec body params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecBodyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail spec body params -func (o *DetailSpecBodyParams) WithTimeout(timeout time.Duration) *DetailSpecBodyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail spec body params -func (o *DetailSpecBodyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail spec body params -func (o *DetailSpecBodyParams) WithContext(ctx context.Context) *DetailSpecBodyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail spec body params -func (o *DetailSpecBodyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail spec body params -func (o *DetailSpecBodyParams) WithHTTPClient(client *http.Client) *DetailSpecBodyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail spec body params -func (o *DetailSpecBodyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail spec body params -func (o *DetailSpecBodyParams) WithID(id string) *DetailSpecBodyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail spec body params -func (o *DetailSpecBodyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSpecBodyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/informational/detail_spec_body_responses.go b/rest_client_api_client/informational/detail_spec_body_responses.go deleted file mode 100644 index 795f4b4a3..000000000 --- a/rest_client_api_client/informational/detail_spec_body_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecBodyReader is a Reader for the DetailSpecBody structure. -type DetailSpecBodyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSpecBodyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSpecBodyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSpecBodyOK creates a DetailSpecBodyOK with default headers values -func NewDetailSpecBodyOK() *DetailSpecBodyOK { - return &DetailSpecBodyOK{} -} - -/* DetailSpecBodyOK describes a response with status code 200, with default header values. - -Returns the document that represents the specification -*/ -type DetailSpecBodyOK struct { - Payload *rest_model.DetailSpecBodyEnvelope -} - -func (o *DetailSpecBodyOK) Error() string { - return fmt.Sprintf("[GET /specs/{id}/spec][%d] detailSpecBodyOK %+v", 200, o.Payload) -} -func (o *DetailSpecBodyOK) GetPayload() *rest_model.DetailSpecBodyEnvelope { - return o.Payload -} - -func (o *DetailSpecBodyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSpecBodyEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/informational/detail_spec_parameters.go b/rest_client_api_client/informational/detail_spec_parameters.go deleted file mode 100644 index fdf79c350..000000000 --- a/rest_client_api_client/informational/detail_spec_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecParams creates a new DetailSpecParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSpecParams() *DetailSpecParams { - return &DetailSpecParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSpecParamsWithTimeout creates a new DetailSpecParams object -// with the ability to set a timeout on a request. -func NewDetailSpecParamsWithTimeout(timeout time.Duration) *DetailSpecParams { - return &DetailSpecParams{ - timeout: timeout, - } -} - -// NewDetailSpecParamsWithContext creates a new DetailSpecParams object -// with the ability to set a context for a request. -func NewDetailSpecParamsWithContext(ctx context.Context) *DetailSpecParams { - return &DetailSpecParams{ - Context: ctx, - } -} - -// NewDetailSpecParamsWithHTTPClient creates a new DetailSpecParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSpecParamsWithHTTPClient(client *http.Client) *DetailSpecParams { - return &DetailSpecParams{ - HTTPClient: client, - } -} - -/* DetailSpecParams contains all the parameters to send to the API endpoint - for the detail spec operation. - - Typically these are written to a http.Request. -*/ -type DetailSpecParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail spec params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecParams) WithDefaults() *DetailSpecParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail spec params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail spec params -func (o *DetailSpecParams) WithTimeout(timeout time.Duration) *DetailSpecParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail spec params -func (o *DetailSpecParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail spec params -func (o *DetailSpecParams) WithContext(ctx context.Context) *DetailSpecParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail spec params -func (o *DetailSpecParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail spec params -func (o *DetailSpecParams) WithHTTPClient(client *http.Client) *DetailSpecParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail spec params -func (o *DetailSpecParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail spec params -func (o *DetailSpecParams) WithID(id string) *DetailSpecParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail spec params -func (o *DetailSpecParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSpecParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/informational/detail_spec_responses.go b/rest_client_api_client/informational/detail_spec_responses.go deleted file mode 100644 index 34c30fcd6..000000000 --- a/rest_client_api_client/informational/detail_spec_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecReader is a Reader for the DetailSpec structure. -type DetailSpecReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSpecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSpecOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSpecOK creates a DetailSpecOK with default headers values -func NewDetailSpecOK() *DetailSpecOK { - return &DetailSpecOK{} -} - -/* DetailSpecOK describes a response with status code 200, with default header values. - -A single specification -*/ -type DetailSpecOK struct { - Payload *rest_model.DetailSpecEnvelope -} - -func (o *DetailSpecOK) Error() string { - return fmt.Sprintf("[GET /specs/{id}][%d] detailSpecOK %+v", 200, o.Payload) -} -func (o *DetailSpecOK) GetPayload() *rest_model.DetailSpecEnvelope { - return o.Payload -} - -func (o *DetailSpecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSpecEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/informational/informational_client.go b/rest_client_api_client/informational/informational_client.go deleted file mode 100644 index 2cb5c7590..000000000 --- a/rest_client_api_client/informational/informational_client.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new informational API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for informational API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DetailSpec(params *DetailSpecParams, opts ...ClientOption) (*DetailSpecOK, error) - - DetailSpecBody(params *DetailSpecBodyParams, opts ...ClientOption) (*DetailSpecBodyOK, error) - - ListProtocols(params *ListProtocolsParams, opts ...ClientOption) (*ListProtocolsOK, error) - - ListRoot(params *ListRootParams, opts ...ClientOption) (*ListRootOK, error) - - ListSpecs(params *ListSpecsParams, opts ...ClientOption) (*ListSpecsOK, error) - - ListVersion(params *ListVersionParams, opts ...ClientOption) (*ListVersionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DetailSpec returns a single spec resource - - Returns single spec resource embedded within the controller for consumption/documentation/code geneartion -*/ -func (a *Client) DetailSpec(params *DetailSpecParams, opts ...ClientOption) (*DetailSpecOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSpecParams() - } - op := &runtime.ClientOperation{ - ID: "detailSpec", - Method: "GET", - PathPattern: "/specs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSpecReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSpecOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSpec: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailSpecBody returns the spec s file - - Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). -*/ -func (a *Client) DetailSpecBody(params *DetailSpecBodyParams, opts ...ClientOption) (*DetailSpecBodyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSpecBodyParams() - } - op := &runtime.ClientOperation{ - ID: "detailSpecBody", - Method: "GET", - PathPattern: "/specs/{id}/spec", - ProducesMediaTypes: []string{"application/json", "text/yaml"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSpecBodyReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSpecBodyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSpecBody: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListProtocols returns a list of the listening edge protocols -*/ -func (a *Client) ListProtocols(params *ListProtocolsParams, opts ...ClientOption) (*ListProtocolsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListProtocolsParams() - } - op := &runtime.ClientOperation{ - ID: "listProtocols", - Method: "GET", - PathPattern: "/protocols", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListProtocolsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListProtocolsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listProtocols: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListRoot returns version information -*/ -func (a *Client) ListRoot(params *ListRootParams, opts ...ClientOption) (*ListRootOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListRootParams() - } - op := &runtime.ClientOperation{ - ID: "listRoot", - Method: "GET", - PathPattern: "/", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListRootReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListRootOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listRoot: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListSpecs returns a list of API specs - - Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion -*/ -func (a *Client) ListSpecs(params *ListSpecsParams, opts ...ClientOption) (*ListSpecsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListSpecsParams() - } - op := &runtime.ClientOperation{ - ID: "listSpecs", - Method: "GET", - PathPattern: "/specs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListSpecsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListSpecsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listSpecs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListVersion returns version information -*/ -func (a *Client) ListVersion(params *ListVersionParams, opts ...ClientOption) (*ListVersionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListVersionParams() - } - op := &runtime.ClientOperation{ - ID: "listVersion", - Method: "GET", - PathPattern: "/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListVersionReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListVersionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/informational/list_protocols_parameters.go b/rest_client_api_client/informational/list_protocols_parameters.go deleted file mode 100644 index 194e22b9c..000000000 --- a/rest_client_api_client/informational/list_protocols_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListProtocolsParams creates a new ListProtocolsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListProtocolsParams() *ListProtocolsParams { - return &ListProtocolsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListProtocolsParamsWithTimeout creates a new ListProtocolsParams object -// with the ability to set a timeout on a request. -func NewListProtocolsParamsWithTimeout(timeout time.Duration) *ListProtocolsParams { - return &ListProtocolsParams{ - timeout: timeout, - } -} - -// NewListProtocolsParamsWithContext creates a new ListProtocolsParams object -// with the ability to set a context for a request. -func NewListProtocolsParamsWithContext(ctx context.Context) *ListProtocolsParams { - return &ListProtocolsParams{ - Context: ctx, - } -} - -// NewListProtocolsParamsWithHTTPClient creates a new ListProtocolsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListProtocolsParamsWithHTTPClient(client *http.Client) *ListProtocolsParams { - return &ListProtocolsParams{ - HTTPClient: client, - } -} - -/* ListProtocolsParams contains all the parameters to send to the API endpoint - for the list protocols operation. - - Typically these are written to a http.Request. -*/ -type ListProtocolsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list protocols params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListProtocolsParams) WithDefaults() *ListProtocolsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list protocols params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListProtocolsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list protocols params -func (o *ListProtocolsParams) WithTimeout(timeout time.Duration) *ListProtocolsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list protocols params -func (o *ListProtocolsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list protocols params -func (o *ListProtocolsParams) WithContext(ctx context.Context) *ListProtocolsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list protocols params -func (o *ListProtocolsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list protocols params -func (o *ListProtocolsParams) WithHTTPClient(client *http.Client) *ListProtocolsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list protocols params -func (o *ListProtocolsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListProtocolsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/informational/list_protocols_responses.go b/rest_client_api_client/informational/list_protocols_responses.go deleted file mode 100644 index 24abfab2b..000000000 --- a/rest_client_api_client/informational/list_protocols_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListProtocolsReader is a Reader for the ListProtocols structure. -type ListProtocolsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListProtocolsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListProtocolsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListProtocolsOK creates a ListProtocolsOK with default headers values -func NewListProtocolsOK() *ListProtocolsOK { - return &ListProtocolsOK{} -} - -/* ListProtocolsOK describes a response with status code 200, with default header values. - -A list of supported Edge protocols -*/ -type ListProtocolsOK struct { - Payload *rest_model.ListProtocolsEnvelope -} - -func (o *ListProtocolsOK) Error() string { - return fmt.Sprintf("[GET /protocols][%d] listProtocolsOK %+v", 200, o.Payload) -} -func (o *ListProtocolsOK) GetPayload() *rest_model.ListProtocolsEnvelope { - return o.Payload -} - -func (o *ListProtocolsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListProtocolsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/informational/list_root_parameters.go b/rest_client_api_client/informational/list_root_parameters.go deleted file mode 100644 index 17d320ebf..000000000 --- a/rest_client_api_client/informational/list_root_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListRootParams creates a new ListRootParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListRootParams() *ListRootParams { - return &ListRootParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListRootParamsWithTimeout creates a new ListRootParams object -// with the ability to set a timeout on a request. -func NewListRootParamsWithTimeout(timeout time.Duration) *ListRootParams { - return &ListRootParams{ - timeout: timeout, - } -} - -// NewListRootParamsWithContext creates a new ListRootParams object -// with the ability to set a context for a request. -func NewListRootParamsWithContext(ctx context.Context) *ListRootParams { - return &ListRootParams{ - Context: ctx, - } -} - -// NewListRootParamsWithHTTPClient creates a new ListRootParams object -// with the ability to set a custom HTTPClient for a request. -func NewListRootParamsWithHTTPClient(client *http.Client) *ListRootParams { - return &ListRootParams{ - HTTPClient: client, - } -} - -/* ListRootParams contains all the parameters to send to the API endpoint - for the list root operation. - - Typically these are written to a http.Request. -*/ -type ListRootParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list root params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRootParams) WithDefaults() *ListRootParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list root params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRootParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list root params -func (o *ListRootParams) WithTimeout(timeout time.Duration) *ListRootParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list root params -func (o *ListRootParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list root params -func (o *ListRootParams) WithContext(ctx context.Context) *ListRootParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list root params -func (o *ListRootParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list root params -func (o *ListRootParams) WithHTTPClient(client *http.Client) *ListRootParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list root params -func (o *ListRootParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListRootParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/informational/list_root_responses.go b/rest_client_api_client/informational/list_root_responses.go deleted file mode 100644 index 599813352..000000000 --- a/rest_client_api_client/informational/list_root_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListRootReader is a Reader for the ListRoot structure. -type ListRootReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListRootReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListRootOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListRootOK creates a ListRootOK with default headers values -func NewListRootOK() *ListRootOK { - return &ListRootOK{} -} - -/* ListRootOK describes a response with status code 200, with default header values. - -Version information for the controller -*/ -type ListRootOK struct { - Payload *rest_model.ListVersionEnvelope -} - -func (o *ListRootOK) Error() string { - return fmt.Sprintf("[GET /][%d] listRootOK %+v", 200, o.Payload) -} -func (o *ListRootOK) GetPayload() *rest_model.ListVersionEnvelope { - return o.Payload -} - -func (o *ListRootOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListVersionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/informational/list_specs_parameters.go b/rest_client_api_client/informational/list_specs_parameters.go deleted file mode 100644 index 9ad83c9e4..000000000 --- a/rest_client_api_client/informational/list_specs_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListSpecsParams creates a new ListSpecsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListSpecsParams() *ListSpecsParams { - return &ListSpecsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListSpecsParamsWithTimeout creates a new ListSpecsParams object -// with the ability to set a timeout on a request. -func NewListSpecsParamsWithTimeout(timeout time.Duration) *ListSpecsParams { - return &ListSpecsParams{ - timeout: timeout, - } -} - -// NewListSpecsParamsWithContext creates a new ListSpecsParams object -// with the ability to set a context for a request. -func NewListSpecsParamsWithContext(ctx context.Context) *ListSpecsParams { - return &ListSpecsParams{ - Context: ctx, - } -} - -// NewListSpecsParamsWithHTTPClient creates a new ListSpecsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListSpecsParamsWithHTTPClient(client *http.Client) *ListSpecsParams { - return &ListSpecsParams{ - HTTPClient: client, - } -} - -/* ListSpecsParams contains all the parameters to send to the API endpoint - for the list specs operation. - - Typically these are written to a http.Request. -*/ -type ListSpecsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list specs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSpecsParams) WithDefaults() *ListSpecsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list specs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSpecsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list specs params -func (o *ListSpecsParams) WithTimeout(timeout time.Duration) *ListSpecsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list specs params -func (o *ListSpecsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list specs params -func (o *ListSpecsParams) WithContext(ctx context.Context) *ListSpecsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list specs params -func (o *ListSpecsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list specs params -func (o *ListSpecsParams) WithHTTPClient(client *http.Client) *ListSpecsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list specs params -func (o *ListSpecsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListSpecsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/informational/list_specs_responses.go b/rest_client_api_client/informational/list_specs_responses.go deleted file mode 100644 index ad2e8f189..000000000 --- a/rest_client_api_client/informational/list_specs_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListSpecsReader is a Reader for the ListSpecs structure. -type ListSpecsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListSpecsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListSpecsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListSpecsOK creates a ListSpecsOK with default headers values -func NewListSpecsOK() *ListSpecsOK { - return &ListSpecsOK{} -} - -/* ListSpecsOK describes a response with status code 200, with default header values. - -A list of specifications -*/ -type ListSpecsOK struct { - Payload *rest_model.ListSpecsEnvelope -} - -func (o *ListSpecsOK) Error() string { - return fmt.Sprintf("[GET /specs][%d] listSpecsOK %+v", 200, o.Payload) -} -func (o *ListSpecsOK) GetPayload() *rest_model.ListSpecsEnvelope { - return o.Payload -} - -func (o *ListSpecsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListSpecsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/informational/list_version_parameters.go b/rest_client_api_client/informational/list_version_parameters.go deleted file mode 100644 index 23d7c2688..000000000 --- a/rest_client_api_client/informational/list_version_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListVersionParams creates a new ListVersionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListVersionParams() *ListVersionParams { - return &ListVersionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListVersionParamsWithTimeout creates a new ListVersionParams object -// with the ability to set a timeout on a request. -func NewListVersionParamsWithTimeout(timeout time.Duration) *ListVersionParams { - return &ListVersionParams{ - timeout: timeout, - } -} - -// NewListVersionParamsWithContext creates a new ListVersionParams object -// with the ability to set a context for a request. -func NewListVersionParamsWithContext(ctx context.Context) *ListVersionParams { - return &ListVersionParams{ - Context: ctx, - } -} - -// NewListVersionParamsWithHTTPClient creates a new ListVersionParams object -// with the ability to set a custom HTTPClient for a request. -func NewListVersionParamsWithHTTPClient(client *http.Client) *ListVersionParams { - return &ListVersionParams{ - HTTPClient: client, - } -} - -/* ListVersionParams contains all the parameters to send to the API endpoint - for the list version operation. - - Typically these are written to a http.Request. -*/ -type ListVersionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListVersionParams) WithDefaults() *ListVersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListVersionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list version params -func (o *ListVersionParams) WithTimeout(timeout time.Duration) *ListVersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list version params -func (o *ListVersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list version params -func (o *ListVersionParams) WithContext(ctx context.Context) *ListVersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list version params -func (o *ListVersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list version params -func (o *ListVersionParams) WithHTTPClient(client *http.Client) *ListVersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list version params -func (o *ListVersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/informational/list_version_responses.go b/rest_client_api_client/informational/list_version_responses.go deleted file mode 100644 index 9e9b0b4a2..000000000 --- a/rest_client_api_client/informational/list_version_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListVersionReader is a Reader for the ListVersion structure. -type ListVersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListVersionOK creates a ListVersionOK with default headers values -func NewListVersionOK() *ListVersionOK { - return &ListVersionOK{} -} - -/* ListVersionOK describes a response with status code 200, with default header values. - -Version information for the controller -*/ -type ListVersionOK struct { - Payload *rest_model.ListVersionEnvelope -} - -func (o *ListVersionOK) Error() string { - return fmt.Sprintf("[GET /version][%d] listVersionOK %+v", 200, o.Payload) -} -func (o *ListVersionOK) GetPayload() *rest_model.ListVersionEnvelope { - return o.Payload -} - -func (o *ListVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListVersionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/posture_checks/create_posture_response_bulk_parameters.go b/rest_client_api_client/posture_checks/create_posture_response_bulk_parameters.go deleted file mode 100644 index b060c06b5..000000000 --- a/rest_client_api_client/posture_checks/create_posture_response_bulk_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreatePostureResponseBulkParams creates a new CreatePostureResponseBulkParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreatePostureResponseBulkParams() *CreatePostureResponseBulkParams { - return &CreatePostureResponseBulkParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreatePostureResponseBulkParamsWithTimeout creates a new CreatePostureResponseBulkParams object -// with the ability to set a timeout on a request. -func NewCreatePostureResponseBulkParamsWithTimeout(timeout time.Duration) *CreatePostureResponseBulkParams { - return &CreatePostureResponseBulkParams{ - timeout: timeout, - } -} - -// NewCreatePostureResponseBulkParamsWithContext creates a new CreatePostureResponseBulkParams object -// with the ability to set a context for a request. -func NewCreatePostureResponseBulkParamsWithContext(ctx context.Context) *CreatePostureResponseBulkParams { - return &CreatePostureResponseBulkParams{ - Context: ctx, - } -} - -// NewCreatePostureResponseBulkParamsWithHTTPClient creates a new CreatePostureResponseBulkParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreatePostureResponseBulkParamsWithHTTPClient(client *http.Client) *CreatePostureResponseBulkParams { - return &CreatePostureResponseBulkParams{ - HTTPClient: client, - } -} - -/* CreatePostureResponseBulkParams contains all the parameters to send to the API endpoint - for the create posture response bulk operation. - - Typically these are written to a http.Request. -*/ -type CreatePostureResponseBulkParams struct { - - /* PostureResponse. - - A Posture Response - */ - PostureResponse []rest_model.PostureResponseCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create posture response bulk params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePostureResponseBulkParams) WithDefaults() *CreatePostureResponseBulkParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create posture response bulk params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePostureResponseBulkParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) WithTimeout(timeout time.Duration) *CreatePostureResponseBulkParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) WithContext(ctx context.Context) *CreatePostureResponseBulkParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) WithHTTPClient(client *http.Client) *CreatePostureResponseBulkParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPostureResponse adds the postureResponse to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) WithPostureResponse(postureResponse []rest_model.PostureResponseCreate) *CreatePostureResponseBulkParams { - o.SetPostureResponse(postureResponse) - return o -} - -// SetPostureResponse adds the postureResponse to the create posture response bulk params -func (o *CreatePostureResponseBulkParams) SetPostureResponse(postureResponse []rest_model.PostureResponseCreate) { - o.PostureResponse = postureResponse -} - -// WriteToRequest writes these params to a swagger request -func (o *CreatePostureResponseBulkParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.PostureResponse != nil { - if err := r.SetBodyParam(o.PostureResponse); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/posture_checks/create_posture_response_bulk_responses.go b/rest_client_api_client/posture_checks/create_posture_response_bulk_responses.go deleted file mode 100644 index 7f8993faf..000000000 --- a/rest_client_api_client/posture_checks/create_posture_response_bulk_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreatePostureResponseBulkReader is a Reader for the CreatePostureResponseBulk structure. -type CreatePostureResponseBulkReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreatePostureResponseBulkReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreatePostureResponseBulkOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreatePostureResponseBulkBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreatePostureResponseBulkUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreatePostureResponseBulkOK creates a CreatePostureResponseBulkOK with default headers values -func NewCreatePostureResponseBulkOK() *CreatePostureResponseBulkOK { - return &CreatePostureResponseBulkOK{} -} - -/* CreatePostureResponseBulkOK describes a response with status code 200, with default header values. - -Contains a list of services that have had their timers altered -*/ -type CreatePostureResponseBulkOK struct { - Payload *rest_model.PostureResponseEnvelope -} - -func (o *CreatePostureResponseBulkOK) Error() string { - return fmt.Sprintf("[POST /posture-response-bulk][%d] createPostureResponseBulkOK %+v", 200, o.Payload) -} -func (o *CreatePostureResponseBulkOK) GetPayload() *rest_model.PostureResponseEnvelope { - return o.Payload -} - -func (o *CreatePostureResponseBulkOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.PostureResponseEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePostureResponseBulkBadRequest creates a CreatePostureResponseBulkBadRequest with default headers values -func NewCreatePostureResponseBulkBadRequest() *CreatePostureResponseBulkBadRequest { - return &CreatePostureResponseBulkBadRequest{} -} - -/* CreatePostureResponseBulkBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreatePostureResponseBulkBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreatePostureResponseBulkBadRequest) Error() string { - return fmt.Sprintf("[POST /posture-response-bulk][%d] createPostureResponseBulkBadRequest %+v", 400, o.Payload) -} -func (o *CreatePostureResponseBulkBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreatePostureResponseBulkBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePostureResponseBulkUnauthorized creates a CreatePostureResponseBulkUnauthorized with default headers values -func NewCreatePostureResponseBulkUnauthorized() *CreatePostureResponseBulkUnauthorized { - return &CreatePostureResponseBulkUnauthorized{} -} - -/* CreatePostureResponseBulkUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreatePostureResponseBulkUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreatePostureResponseBulkUnauthorized) Error() string { - return fmt.Sprintf("[POST /posture-response-bulk][%d] createPostureResponseBulkUnauthorized %+v", 401, o.Payload) -} -func (o *CreatePostureResponseBulkUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreatePostureResponseBulkUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/posture_checks/create_posture_response_parameters.go b/rest_client_api_client/posture_checks/create_posture_response_parameters.go deleted file mode 100644 index 62ae188da..000000000 --- a/rest_client_api_client/posture_checks/create_posture_response_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreatePostureResponseParams creates a new CreatePostureResponseParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreatePostureResponseParams() *CreatePostureResponseParams { - return &CreatePostureResponseParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreatePostureResponseParamsWithTimeout creates a new CreatePostureResponseParams object -// with the ability to set a timeout on a request. -func NewCreatePostureResponseParamsWithTimeout(timeout time.Duration) *CreatePostureResponseParams { - return &CreatePostureResponseParams{ - timeout: timeout, - } -} - -// NewCreatePostureResponseParamsWithContext creates a new CreatePostureResponseParams object -// with the ability to set a context for a request. -func NewCreatePostureResponseParamsWithContext(ctx context.Context) *CreatePostureResponseParams { - return &CreatePostureResponseParams{ - Context: ctx, - } -} - -// NewCreatePostureResponseParamsWithHTTPClient creates a new CreatePostureResponseParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreatePostureResponseParamsWithHTTPClient(client *http.Client) *CreatePostureResponseParams { - return &CreatePostureResponseParams{ - HTTPClient: client, - } -} - -/* CreatePostureResponseParams contains all the parameters to send to the API endpoint - for the create posture response operation. - - Typically these are written to a http.Request. -*/ -type CreatePostureResponseParams struct { - - /* PostureResponse. - - A Posture Response - */ - PostureResponse rest_model.PostureResponseCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create posture response params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePostureResponseParams) WithDefaults() *CreatePostureResponseParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create posture response params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePostureResponseParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create posture response params -func (o *CreatePostureResponseParams) WithTimeout(timeout time.Duration) *CreatePostureResponseParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create posture response params -func (o *CreatePostureResponseParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create posture response params -func (o *CreatePostureResponseParams) WithContext(ctx context.Context) *CreatePostureResponseParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create posture response params -func (o *CreatePostureResponseParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create posture response params -func (o *CreatePostureResponseParams) WithHTTPClient(client *http.Client) *CreatePostureResponseParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create posture response params -func (o *CreatePostureResponseParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPostureResponse adds the postureResponse to the create posture response params -func (o *CreatePostureResponseParams) WithPostureResponse(postureResponse rest_model.PostureResponseCreate) *CreatePostureResponseParams { - o.SetPostureResponse(postureResponse) - return o -} - -// SetPostureResponse adds the postureResponse to the create posture response params -func (o *CreatePostureResponseParams) SetPostureResponse(postureResponse rest_model.PostureResponseCreate) { - o.PostureResponse = postureResponse -} - -// WriteToRequest writes these params to a swagger request -func (o *CreatePostureResponseParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.PostureResponse); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/posture_checks/create_posture_response_responses.go b/rest_client_api_client/posture_checks/create_posture_response_responses.go deleted file mode 100644 index 1da05ef13..000000000 --- a/rest_client_api_client/posture_checks/create_posture_response_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreatePostureResponseReader is a Reader for the CreatePostureResponse structure. -type CreatePostureResponseReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreatePostureResponseReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreatePostureResponseCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreatePostureResponseBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreatePostureResponseUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreatePostureResponseCreated creates a CreatePostureResponseCreated with default headers values -func NewCreatePostureResponseCreated() *CreatePostureResponseCreated { - return &CreatePostureResponseCreated{} -} - -/* CreatePostureResponseCreated describes a response with status code 201, with default header values. - -Contains a list of services that have had their timers altered -*/ -type CreatePostureResponseCreated struct { - Payload *rest_model.PostureResponseEnvelope -} - -func (o *CreatePostureResponseCreated) Error() string { - return fmt.Sprintf("[POST /posture-response][%d] createPostureResponseCreated %+v", 201, o.Payload) -} -func (o *CreatePostureResponseCreated) GetPayload() *rest_model.PostureResponseEnvelope { - return o.Payload -} - -func (o *CreatePostureResponseCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.PostureResponseEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePostureResponseBadRequest creates a CreatePostureResponseBadRequest with default headers values -func NewCreatePostureResponseBadRequest() *CreatePostureResponseBadRequest { - return &CreatePostureResponseBadRequest{} -} - -/* CreatePostureResponseBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreatePostureResponseBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreatePostureResponseBadRequest) Error() string { - return fmt.Sprintf("[POST /posture-response][%d] createPostureResponseBadRequest %+v", 400, o.Payload) -} -func (o *CreatePostureResponseBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreatePostureResponseBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePostureResponseUnauthorized creates a CreatePostureResponseUnauthorized with default headers values -func NewCreatePostureResponseUnauthorized() *CreatePostureResponseUnauthorized { - return &CreatePostureResponseUnauthorized{} -} - -/* CreatePostureResponseUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreatePostureResponseUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreatePostureResponseUnauthorized) Error() string { - return fmt.Sprintf("[POST /posture-response][%d] createPostureResponseUnauthorized %+v", 401, o.Payload) -} -func (o *CreatePostureResponseUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreatePostureResponseUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/posture_checks/posture_checks_client.go b/rest_client_api_client/posture_checks/posture_checks_client.go deleted file mode 100644 index d9d06592e..000000000 --- a/rest_client_api_client/posture_checks/posture_checks_client.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new posture checks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for posture checks API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreatePostureResponse(params *CreatePostureResponseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureResponseCreated, error) - - CreatePostureResponseBulk(params *CreatePostureResponseBulkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureResponseBulkOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreatePostureResponse submits a posture response to a posture query - - Submits posture responses -*/ -func (a *Client) CreatePostureResponse(params *CreatePostureResponseParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureResponseCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePostureResponseParams() - } - op := &runtime.ClientOperation{ - ID: "createPostureResponse", - Method: "POST", - PathPattern: "/posture-response", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreatePostureResponseReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreatePostureResponseCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createPostureResponse: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreatePostureResponseBulk submits multiple posture responses - - Submits posture responses -*/ -func (a *Client) CreatePostureResponseBulk(params *CreatePostureResponseBulkParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureResponseBulkOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePostureResponseBulkParams() - } - op := &runtime.ClientOperation{ - ID: "createPostureResponseBulk", - Method: "POST", - PathPattern: "/posture-response-bulk", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreatePostureResponseBulkReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreatePostureResponseBulkOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createPostureResponseBulk: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/service/delete_service_parameters.go b/rest_client_api_client/service/delete_service_parameters.go deleted file mode 100644 index 5eb86ff71..000000000 --- a/rest_client_api_client/service/delete_service_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceParams creates a new DeleteServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteServiceParams() *DeleteServiceParams { - return &DeleteServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteServiceParamsWithTimeout creates a new DeleteServiceParams object -// with the ability to set a timeout on a request. -func NewDeleteServiceParamsWithTimeout(timeout time.Duration) *DeleteServiceParams { - return &DeleteServiceParams{ - timeout: timeout, - } -} - -// NewDeleteServiceParamsWithContext creates a new DeleteServiceParams object -// with the ability to set a context for a request. -func NewDeleteServiceParamsWithContext(ctx context.Context) *DeleteServiceParams { - return &DeleteServiceParams{ - Context: ctx, - } -} - -// NewDeleteServiceParamsWithHTTPClient creates a new DeleteServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteServiceParamsWithHTTPClient(client *http.Client) *DeleteServiceParams { - return &DeleteServiceParams{ - HTTPClient: client, - } -} - -/* DeleteServiceParams contains all the parameters to send to the API endpoint - for the delete service operation. - - Typically these are written to a http.Request. -*/ -type DeleteServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServiceParams) WithDefaults() *DeleteServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete service params -func (o *DeleteServiceParams) WithTimeout(timeout time.Duration) *DeleteServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete service params -func (o *DeleteServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete service params -func (o *DeleteServiceParams) WithContext(ctx context.Context) *DeleteServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete service params -func (o *DeleteServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete service params -func (o *DeleteServiceParams) WithHTTPClient(client *http.Client) *DeleteServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete service params -func (o *DeleteServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete service params -func (o *DeleteServiceParams) WithID(id string) *DeleteServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete service params -func (o *DeleteServiceParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/service/delete_service_responses.go b/rest_client_api_client/service/delete_service_responses.go deleted file mode 100644 index 400e12b78..000000000 --- a/rest_client_api_client/service/delete_service_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServiceReader is a Reader for the DeleteService structure. -type DeleteServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteServiceConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteServiceOK creates a DeleteServiceOK with default headers values -func NewDeleteServiceOK() *DeleteServiceOK { - return &DeleteServiceOK{} -} - -/* DeleteServiceOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteServiceOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteServiceOK) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceOK %+v", 200, o.Payload) -} -func (o *DeleteServiceOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceBadRequest creates a DeleteServiceBadRequest with default headers values -func NewDeleteServiceBadRequest() *DeleteServiceBadRequest { - return &DeleteServiceBadRequest{} -} - -/* DeleteServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceBadRequest) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceBadRequest %+v", 400, o.Payload) -} -func (o *DeleteServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceUnauthorized creates a DeleteServiceUnauthorized with default headers values -func NewDeleteServiceUnauthorized() *DeleteServiceUnauthorized { - return &DeleteServiceUnauthorized{} -} - -/* DeleteServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceConflict creates a DeleteServiceConflict with default headers values -func NewDeleteServiceConflict() *DeleteServiceConflict { - return &DeleteServiceConflict{} -} - -/* DeleteServiceConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteServiceConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceConflict) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceConflict %+v", 409, o.Payload) -} -func (o *DeleteServiceConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/service/detail_service_parameters.go b/rest_client_api_client/service/detail_service_parameters.go deleted file mode 100644 index 850a20228..000000000 --- a/rest_client_api_client/service/detail_service_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailServiceParams creates a new DetailServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailServiceParams() *DetailServiceParams { - return &DetailServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailServiceParamsWithTimeout creates a new DetailServiceParams object -// with the ability to set a timeout on a request. -func NewDetailServiceParamsWithTimeout(timeout time.Duration) *DetailServiceParams { - return &DetailServiceParams{ - timeout: timeout, - } -} - -// NewDetailServiceParamsWithContext creates a new DetailServiceParams object -// with the ability to set a context for a request. -func NewDetailServiceParamsWithContext(ctx context.Context) *DetailServiceParams { - return &DetailServiceParams{ - Context: ctx, - } -} - -// NewDetailServiceParamsWithHTTPClient creates a new DetailServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailServiceParamsWithHTTPClient(client *http.Client) *DetailServiceParams { - return &DetailServiceParams{ - HTTPClient: client, - } -} - -/* DetailServiceParams contains all the parameters to send to the API endpoint - for the detail service operation. - - Typically these are written to a http.Request. -*/ -type DetailServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServiceParams) WithDefaults() *DetailServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail service params -func (o *DetailServiceParams) WithTimeout(timeout time.Duration) *DetailServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail service params -func (o *DetailServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail service params -func (o *DetailServiceParams) WithContext(ctx context.Context) *DetailServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail service params -func (o *DetailServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail service params -func (o *DetailServiceParams) WithHTTPClient(client *http.Client) *DetailServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail service params -func (o *DetailServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail service params -func (o *DetailServiceParams) WithID(id string) *DetailServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail service params -func (o *DetailServiceParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/service/detail_service_responses.go b/rest_client_api_client/service/detail_service_responses.go deleted file mode 100644 index d93778216..000000000 --- a/rest_client_api_client/service/detail_service_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailServiceReader is a Reader for the DetailService structure. -type DetailServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailServiceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailServiceOK creates a DetailServiceOK with default headers values -func NewDetailServiceOK() *DetailServiceOK { - return &DetailServiceOK{} -} - -/* DetailServiceOK describes a response with status code 200, with default header values. - -A single service -*/ -type DetailServiceOK struct { - Payload *rest_model.DetailServiceEnvelope -} - -func (o *DetailServiceOK) Error() string { - return fmt.Sprintf("[GET /services/{id}][%d] detailServiceOK %+v", 200, o.Payload) -} -func (o *DetailServiceOK) GetPayload() *rest_model.DetailServiceEnvelope { - return o.Payload -} - -func (o *DetailServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailServiceEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServiceUnauthorized creates a DetailServiceUnauthorized with default headers values -func NewDetailServiceUnauthorized() *DetailServiceUnauthorized { - return &DetailServiceUnauthorized{} -} - -/* DetailServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServiceUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}][%d] detailServiceUnauthorized %+v", 401, o.Payload) -} -func (o *DetailServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServiceNotFound creates a DetailServiceNotFound with default headers values -func NewDetailServiceNotFound() *DetailServiceNotFound { - return &DetailServiceNotFound{} -} - -/* DetailServiceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailServiceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServiceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{id}][%d] detailServiceNotFound %+v", 404, o.Payload) -} -func (o *DetailServiceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/service/list_service_terminators_parameters.go b/rest_client_api_client/service/list_service_terminators_parameters.go deleted file mode 100644 index c6024e506..000000000 --- a/rest_client_api_client/service/list_service_terminators_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceTerminatorsParams creates a new ListServiceTerminatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceTerminatorsParams() *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceTerminatorsParamsWithTimeout creates a new ListServiceTerminatorsParams object -// with the ability to set a timeout on a request. -func NewListServiceTerminatorsParamsWithTimeout(timeout time.Duration) *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - timeout: timeout, - } -} - -// NewListServiceTerminatorsParamsWithContext creates a new ListServiceTerminatorsParams object -// with the ability to set a context for a request. -func NewListServiceTerminatorsParamsWithContext(ctx context.Context) *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - Context: ctx, - } -} - -// NewListServiceTerminatorsParamsWithHTTPClient creates a new ListServiceTerminatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceTerminatorsParamsWithHTTPClient(client *http.Client) *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - HTTPClient: client, - } -} - -/* ListServiceTerminatorsParams contains all the parameters to send to the API endpoint - for the list service terminators operation. - - Typically these are written to a http.Request. -*/ -type ListServiceTerminatorsParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service terminators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceTerminatorsParams) WithDefaults() *ListServiceTerminatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service terminators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceTerminatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service terminators params -func (o *ListServiceTerminatorsParams) WithTimeout(timeout time.Duration) *ListServiceTerminatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service terminators params -func (o *ListServiceTerminatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service terminators params -func (o *ListServiceTerminatorsParams) WithContext(ctx context.Context) *ListServiceTerminatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service terminators params -func (o *ListServiceTerminatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service terminators params -func (o *ListServiceTerminatorsParams) WithHTTPClient(client *http.Client) *ListServiceTerminatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service terminators params -func (o *ListServiceTerminatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service terminators params -func (o *ListServiceTerminatorsParams) WithFilter(filter *string) *ListServiceTerminatorsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service terminators params -func (o *ListServiceTerminatorsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service terminators params -func (o *ListServiceTerminatorsParams) WithID(id string) *ListServiceTerminatorsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service terminators params -func (o *ListServiceTerminatorsParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service terminators params -func (o *ListServiceTerminatorsParams) WithLimit(limit *int64) *ListServiceTerminatorsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service terminators params -func (o *ListServiceTerminatorsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service terminators params -func (o *ListServiceTerminatorsParams) WithOffset(offset *int64) *ListServiceTerminatorsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service terminators params -func (o *ListServiceTerminatorsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceTerminatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/service/list_service_terminators_responses.go b/rest_client_api_client/service/list_service_terminators_responses.go deleted file mode 100644 index a8f7a8585..000000000 --- a/rest_client_api_client/service/list_service_terminators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceTerminatorsReader is a Reader for the ListServiceTerminators structure. -type ListServiceTerminatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceTerminatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceTerminatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceTerminatorsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceTerminatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceTerminatorsOK creates a ListServiceTerminatorsOK with default headers values -func NewListServiceTerminatorsOK() *ListServiceTerminatorsOK { - return &ListServiceTerminatorsOK{} -} - -/* ListServiceTerminatorsOK describes a response with status code 200, with default header values. - -A list of terminators -*/ -type ListServiceTerminatorsOK struct { - Payload *rest_model.ListClientTerminatorsEnvelope -} - -func (o *ListServiceTerminatorsOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/terminators][%d] listServiceTerminatorsOK %+v", 200, o.Payload) -} -func (o *ListServiceTerminatorsOK) GetPayload() *rest_model.ListClientTerminatorsEnvelope { - return o.Payload -} - -func (o *ListServiceTerminatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListClientTerminatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceTerminatorsBadRequest creates a ListServiceTerminatorsBadRequest with default headers values -func NewListServiceTerminatorsBadRequest() *ListServiceTerminatorsBadRequest { - return &ListServiceTerminatorsBadRequest{} -} - -/* ListServiceTerminatorsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceTerminatorsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceTerminatorsBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/terminators][%d] listServiceTerminatorsBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceTerminatorsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceTerminatorsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceTerminatorsUnauthorized creates a ListServiceTerminatorsUnauthorized with default headers values -func NewListServiceTerminatorsUnauthorized() *ListServiceTerminatorsUnauthorized { - return &ListServiceTerminatorsUnauthorized{} -} - -/* ListServiceTerminatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceTerminatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceTerminatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/terminators][%d] listServiceTerminatorsUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceTerminatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceTerminatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/service/list_services_parameters.go b/rest_client_api_client/service/list_services_parameters.go deleted file mode 100644 index d70f664bf..000000000 --- a/rest_client_api_client/service/list_services_parameters.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicesParams creates a new ListServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServicesParams() *ListServicesParams { - return &ListServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicesParamsWithTimeout creates a new ListServicesParams object -// with the ability to set a timeout on a request. -func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { - return &ListServicesParams{ - timeout: timeout, - } -} - -// NewListServicesParamsWithContext creates a new ListServicesParams object -// with the ability to set a context for a request. -func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { - return &ListServicesParams{ - Context: ctx, - } -} - -// NewListServicesParamsWithHTTPClient creates a new ListServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { - return &ListServicesParams{ - HTTPClient: client, - } -} - -/* ListServicesParams contains all the parameters to send to the API endpoint - for the list services operation. - - Typically these are written to a http.Request. -*/ -type ListServicesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - // RoleFilter. - RoleFilter []string - - // RoleSemantic. - RoleSemantic *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) WithDefaults() *ListServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list services params -func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list services params -func (o *ListServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list services params -func (o *ListServicesParams) WithContext(ctx context.Context) *ListServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list services params -func (o *ListServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) WithHTTPClient(client *http.Client) *ListServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list services params -func (o *ListServicesParams) WithFilter(filter *string) *ListServicesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list services params -func (o *ListServicesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list services params -func (o *ListServicesParams) WithLimit(limit *int64) *ListServicesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list services params -func (o *ListServicesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list services params -func (o *ListServicesParams) WithOffset(offset *int64) *ListServicesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list services params -func (o *ListServicesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithRoleFilter adds the roleFilter to the list services params -func (o *ListServicesParams) WithRoleFilter(roleFilter []string) *ListServicesParams { - o.SetRoleFilter(roleFilter) - return o -} - -// SetRoleFilter adds the roleFilter to the list services params -func (o *ListServicesParams) SetRoleFilter(roleFilter []string) { - o.RoleFilter = roleFilter -} - -// WithRoleSemantic adds the roleSemantic to the list services params -func (o *ListServicesParams) WithRoleSemantic(roleSemantic *string) *ListServicesParams { - o.SetRoleSemantic(roleSemantic) - return o -} - -// SetRoleSemantic adds the roleSemantic to the list services params -func (o *ListServicesParams) SetRoleSemantic(roleSemantic *string) { - o.RoleSemantic = roleSemantic -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if o.RoleFilter != nil { - - // binding items for roleFilter - joinedRoleFilter := o.bindParamRoleFilter(reg) - - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err - } - } - - if o.RoleSemantic != nil { - - // query param roleSemantic - var qrRoleSemantic string - - if o.RoleSemantic != nil { - qrRoleSemantic = *o.RoleSemantic - } - qRoleSemantic := qrRoleSemantic - if qRoleSemantic != "" { - - if err := r.SetQueryParam("roleSemantic", qRoleSemantic); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamListServices binds the parameter roleFilter -func (o *ListServicesParams) bindParamRoleFilter(formats strfmt.Registry) []string { - roleFilterIR := o.RoleFilter - - var roleFilterIC []string - for _, roleFilterIIR := range roleFilterIR { // explode []string - - roleFilterIIV := roleFilterIIR // string as string - roleFilterIC = append(roleFilterIC, roleFilterIIV) - } - - // items.CollectionFormat: "multi" - roleFilterIS := swag.JoinByFormat(roleFilterIC, "multi") - - return roleFilterIS -} diff --git a/rest_client_api_client/service/list_services_responses.go b/rest_client_api_client/service/list_services_responses.go deleted file mode 100644 index 491f48a56..000000000 --- a/rest_client_api_client/service/list_services_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServicesReader is a Reader for the ListServices structure. -type ListServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServicesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServicesOK creates a ListServicesOK with default headers values -func NewListServicesOK() *ListServicesOK { - return &ListServicesOK{} -} - -/* ListServicesOK describes a response with status code 200, with default header values. - -A list of services -*/ -type ListServicesOK struct { - Payload *rest_model.ListServicesEnvelope -} - -func (o *ListServicesOK) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesOK %+v", 200, o.Payload) -} -func (o *ListServicesOK) GetPayload() *rest_model.ListServicesEnvelope { - return o.Payload -} - -func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicesBadRequest creates a ListServicesBadRequest with default headers values -func NewListServicesBadRequest() *ListServicesBadRequest { - return &ListServicesBadRequest{} -} - -/* ListServicesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServicesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicesBadRequest) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesBadRequest %+v", 400, o.Payload) -} -func (o *ListServicesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicesUnauthorized creates a ListServicesUnauthorized with default headers values -func NewListServicesUnauthorized() *ListServicesUnauthorized { - return &ListServicesUnauthorized{} -} - -/* ListServicesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServicesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/service/patch_service_parameters.go b/rest_client_api_client/service/patch_service_parameters.go deleted file mode 100644 index 0a57ec77d..000000000 --- a/rest_client_api_client/service/patch_service_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServiceParams creates a new PatchServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchServiceParams() *PatchServiceParams { - return &PatchServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchServiceParamsWithTimeout creates a new PatchServiceParams object -// with the ability to set a timeout on a request. -func NewPatchServiceParamsWithTimeout(timeout time.Duration) *PatchServiceParams { - return &PatchServiceParams{ - timeout: timeout, - } -} - -// NewPatchServiceParamsWithContext creates a new PatchServiceParams object -// with the ability to set a context for a request. -func NewPatchServiceParamsWithContext(ctx context.Context) *PatchServiceParams { - return &PatchServiceParams{ - Context: ctx, - } -} - -// NewPatchServiceParamsWithHTTPClient creates a new PatchServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchServiceParamsWithHTTPClient(client *http.Client) *PatchServiceParams { - return &PatchServiceParams{ - HTTPClient: client, - } -} - -/* PatchServiceParams contains all the parameters to send to the API endpoint - for the patch service operation. - - Typically these are written to a http.Request. -*/ -type PatchServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Service. - - A service patch object - */ - Service *rest_model.ServicePatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServiceParams) WithDefaults() *PatchServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch service params -func (o *PatchServiceParams) WithTimeout(timeout time.Duration) *PatchServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch service params -func (o *PatchServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch service params -func (o *PatchServiceParams) WithContext(ctx context.Context) *PatchServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch service params -func (o *PatchServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch service params -func (o *PatchServiceParams) WithHTTPClient(client *http.Client) *PatchServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch service params -func (o *PatchServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch service params -func (o *PatchServiceParams) WithID(id string) *PatchServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch service params -func (o *PatchServiceParams) SetID(id string) { - o.ID = id -} - -// WithService adds the service to the patch service params -func (o *PatchServiceParams) WithService(service *rest_model.ServicePatch) *PatchServiceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the patch service params -func (o *PatchServiceParams) SetService(service *rest_model.ServicePatch) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Service != nil { - if err := r.SetBodyParam(o.Service); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/service/patch_service_responses.go b/rest_client_api_client/service/patch_service_responses.go deleted file mode 100644 index abec63fd2..000000000 --- a/rest_client_api_client/service/patch_service_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchServiceReader is a Reader for the PatchService structure. -type PatchServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchServiceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchServiceOK creates a PatchServiceOK with default headers values -func NewPatchServiceOK() *PatchServiceOK { - return &PatchServiceOK{} -} - -/* PatchServiceOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchServiceOK struct { - Payload *rest_model.Empty -} - -func (o *PatchServiceOK) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceOK %+v", 200, o.Payload) -} -func (o *PatchServiceOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceBadRequest creates a PatchServiceBadRequest with default headers values -func NewPatchServiceBadRequest() *PatchServiceBadRequest { - return &PatchServiceBadRequest{} -} - -/* PatchServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceBadRequest) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceBadRequest %+v", 400, o.Payload) -} -func (o *PatchServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceUnauthorized creates a PatchServiceUnauthorized with default headers values -func NewPatchServiceUnauthorized() *PatchServiceUnauthorized { - return &PatchServiceUnauthorized{} -} - -/* PatchServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceUnauthorized %+v", 401, o.Payload) -} -func (o *PatchServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceNotFound creates a PatchServiceNotFound with default headers values -func NewPatchServiceNotFound() *PatchServiceNotFound { - return &PatchServiceNotFound{} -} - -/* PatchServiceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchServiceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceNotFound) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceNotFound %+v", 404, o.Payload) -} -func (o *PatchServiceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/service/service_client.go b/rest_client_api_client/service/service_client.go deleted file mode 100644 index 2b4571372..000000000 --- a/rest_client_api_client/service/service_client.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) - - DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceOK, error) - - ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceTerminatorsOK, error) - - ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) - - PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceOK, error) - - UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteService deletes a service - - Delete a service by id. Requires admin access. -*/ -func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteServiceParams() - } - op := &runtime.ClientOperation{ - ID: "deleteService", - Method: "DELETE", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailService retrieves a single service - - Retrieves a single service by id. Requires admin access. -*/ -func (a *Client) DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailServiceParams() - } - op := &runtime.ClientOperation{ - ID: "detailService", - Method: "GET", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceTerminators lists of terminators assigned to a service - - Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. - -*/ -func (a *Client) ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceTerminatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceTerminatorsParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceTerminators", - Method: "GET", - PathPattern: "/services/{id}/terminators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceTerminatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceTerminatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceTerminators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServices lists services - - Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicesParams() - } - op := &runtime.ClientOperation{ - ID: "listServices", - Method: "GET", - PathPattern: "/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchService updates the supplied fields on a service - - Update the supplied fields on a service. Requires admin access. -*/ -func (a *Client) PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchServiceParams() - } - op := &runtime.ClientOperation{ - ID: "patchService", - Method: "PATCH", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateService updates all fields on a service - - Update all fields on a service by id. Requires admin access. -*/ -func (a *Client) UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateServiceParams() - } - op := &runtime.ClientOperation{ - ID: "updateService", - Method: "PUT", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/service/update_service_parameters.go b/rest_client_api_client/service/update_service_parameters.go deleted file mode 100644 index 1f4f628c0..000000000 --- a/rest_client_api_client/service/update_service_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServiceParams creates a new UpdateServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateServiceParams() *UpdateServiceParams { - return &UpdateServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateServiceParamsWithTimeout creates a new UpdateServiceParams object -// with the ability to set a timeout on a request. -func NewUpdateServiceParamsWithTimeout(timeout time.Duration) *UpdateServiceParams { - return &UpdateServiceParams{ - timeout: timeout, - } -} - -// NewUpdateServiceParamsWithContext creates a new UpdateServiceParams object -// with the ability to set a context for a request. -func NewUpdateServiceParamsWithContext(ctx context.Context) *UpdateServiceParams { - return &UpdateServiceParams{ - Context: ctx, - } -} - -// NewUpdateServiceParamsWithHTTPClient creates a new UpdateServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateServiceParamsWithHTTPClient(client *http.Client) *UpdateServiceParams { - return &UpdateServiceParams{ - HTTPClient: client, - } -} - -/* UpdateServiceParams contains all the parameters to send to the API endpoint - for the update service operation. - - Typically these are written to a http.Request. -*/ -type UpdateServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Service. - - A service update object - */ - Service *rest_model.ServiceUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServiceParams) WithDefaults() *UpdateServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update service params -func (o *UpdateServiceParams) WithTimeout(timeout time.Duration) *UpdateServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update service params -func (o *UpdateServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update service params -func (o *UpdateServiceParams) WithContext(ctx context.Context) *UpdateServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update service params -func (o *UpdateServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update service params -func (o *UpdateServiceParams) WithHTTPClient(client *http.Client) *UpdateServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update service params -func (o *UpdateServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update service params -func (o *UpdateServiceParams) WithID(id string) *UpdateServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update service params -func (o *UpdateServiceParams) SetID(id string) { - o.ID = id -} - -// WithService adds the service to the update service params -func (o *UpdateServiceParams) WithService(service *rest_model.ServiceUpdate) *UpdateServiceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the update service params -func (o *UpdateServiceParams) SetService(service *rest_model.ServiceUpdate) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Service != nil { - if err := r.SetBodyParam(o.Service); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/service/update_service_responses.go b/rest_client_api_client/service/update_service_responses.go deleted file mode 100644 index bee4a5482..000000000 --- a/rest_client_api_client/service/update_service_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServiceReader is a Reader for the UpdateService structure. -type UpdateServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateServiceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateServiceOK creates a UpdateServiceOK with default headers values -func NewUpdateServiceOK() *UpdateServiceOK { - return &UpdateServiceOK{} -} - -/* UpdateServiceOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateServiceOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateServiceOK) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceOK %+v", 200, o.Payload) -} -func (o *UpdateServiceOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceBadRequest creates a UpdateServiceBadRequest with default headers values -func NewUpdateServiceBadRequest() *UpdateServiceBadRequest { - return &UpdateServiceBadRequest{} -} - -/* UpdateServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceBadRequest) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceBadRequest %+v", 400, o.Payload) -} -func (o *UpdateServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceUnauthorized creates a UpdateServiceUnauthorized with default headers values -func NewUpdateServiceUnauthorized() *UpdateServiceUnauthorized { - return &UpdateServiceUnauthorized{} -} - -/* UpdateServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceUnauthorized) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceNotFound creates a UpdateServiceNotFound with default headers values -func NewUpdateServiceNotFound() *UpdateServiceNotFound { - return &UpdateServiceNotFound{} -} - -/* UpdateServiceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateServiceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceNotFound) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceNotFound %+v", 404, o.Payload) -} -func (o *UpdateServiceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/session/create_session_parameters.go b/rest_client_api_client/session/create_session_parameters.go deleted file mode 100644 index 5c5223b3e..000000000 --- a/rest_client_api_client/session/create_session_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateSessionParams creates a new CreateSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateSessionParams() *CreateSessionParams { - return &CreateSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateSessionParamsWithTimeout creates a new CreateSessionParams object -// with the ability to set a timeout on a request. -func NewCreateSessionParamsWithTimeout(timeout time.Duration) *CreateSessionParams { - return &CreateSessionParams{ - timeout: timeout, - } -} - -// NewCreateSessionParamsWithContext creates a new CreateSessionParams object -// with the ability to set a context for a request. -func NewCreateSessionParamsWithContext(ctx context.Context) *CreateSessionParams { - return &CreateSessionParams{ - Context: ctx, - } -} - -// NewCreateSessionParamsWithHTTPClient creates a new CreateSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateSessionParamsWithHTTPClient(client *http.Client) *CreateSessionParams { - return &CreateSessionParams{ - HTTPClient: client, - } -} - -/* CreateSessionParams contains all the parameters to send to the API endpoint - for the create session operation. - - Typically these are written to a http.Request. -*/ -type CreateSessionParams struct { - - /* Session. - - A session to create - */ - Session *rest_model.SessionCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateSessionParams) WithDefaults() *CreateSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateSessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create session params -func (o *CreateSessionParams) WithTimeout(timeout time.Duration) *CreateSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create session params -func (o *CreateSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create session params -func (o *CreateSessionParams) WithContext(ctx context.Context) *CreateSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create session params -func (o *CreateSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create session params -func (o *CreateSessionParams) WithHTTPClient(client *http.Client) *CreateSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create session params -func (o *CreateSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSession adds the session to the create session params -func (o *CreateSessionParams) WithSession(session *rest_model.SessionCreate) *CreateSessionParams { - o.SetSession(session) - return o -} - -// SetSession adds the session to the create session params -func (o *CreateSessionParams) SetSession(session *rest_model.SessionCreate) { - o.Session = session -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Session != nil { - if err := r.SetBodyParam(o.Session); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/session/create_session_responses.go b/rest_client_api_client/session/create_session_responses.go deleted file mode 100644 index 2e6e7e423..000000000 --- a/rest_client_api_client/session/create_session_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateSessionReader is a Reader for the CreateSession structure. -type CreateSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateSessionCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateSessionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateSessionCreated creates a CreateSessionCreated with default headers values -func NewCreateSessionCreated() *CreateSessionCreated { - return &CreateSessionCreated{} -} - -/* CreateSessionCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateSessionCreated struct { - Payload *rest_model.SessionCreateEnvelope -} - -func (o *CreateSessionCreated) Error() string { - return fmt.Sprintf("[POST /sessions][%d] createSessionCreated %+v", 201, o.Payload) -} -func (o *CreateSessionCreated) GetPayload() *rest_model.SessionCreateEnvelope { - return o.Payload -} - -func (o *CreateSessionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.SessionCreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSessionBadRequest creates a CreateSessionBadRequest with default headers values -func NewCreateSessionBadRequest() *CreateSessionBadRequest { - return &CreateSessionBadRequest{} -} - -/* CreateSessionBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateSessionBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateSessionBadRequest) Error() string { - return fmt.Sprintf("[POST /sessions][%d] createSessionBadRequest %+v", 400, o.Payload) -} -func (o *CreateSessionBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateSessionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSessionUnauthorized creates a CreateSessionUnauthorized with default headers values -func NewCreateSessionUnauthorized() *CreateSessionUnauthorized { - return &CreateSessionUnauthorized{} -} - -/* CreateSessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateSessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateSessionUnauthorized) Error() string { - return fmt.Sprintf("[POST /sessions][%d] createSessionUnauthorized %+v", 401, o.Payload) -} -func (o *CreateSessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/session/delete_session_parameters.go b/rest_client_api_client/session/delete_session_parameters.go deleted file mode 100644 index 7913c8ac1..000000000 --- a/rest_client_api_client/session/delete_session_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteSessionParams creates a new DeleteSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteSessionParams() *DeleteSessionParams { - return &DeleteSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteSessionParamsWithTimeout creates a new DeleteSessionParams object -// with the ability to set a timeout on a request. -func NewDeleteSessionParamsWithTimeout(timeout time.Duration) *DeleteSessionParams { - return &DeleteSessionParams{ - timeout: timeout, - } -} - -// NewDeleteSessionParamsWithContext creates a new DeleteSessionParams object -// with the ability to set a context for a request. -func NewDeleteSessionParamsWithContext(ctx context.Context) *DeleteSessionParams { - return &DeleteSessionParams{ - Context: ctx, - } -} - -// NewDeleteSessionParamsWithHTTPClient creates a new DeleteSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteSessionParamsWithHTTPClient(client *http.Client) *DeleteSessionParams { - return &DeleteSessionParams{ - HTTPClient: client, - } -} - -/* DeleteSessionParams contains all the parameters to send to the API endpoint - for the delete session operation. - - Typically these are written to a http.Request. -*/ -type DeleteSessionParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteSessionParams) WithDefaults() *DeleteSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteSessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete session params -func (o *DeleteSessionParams) WithTimeout(timeout time.Duration) *DeleteSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete session params -func (o *DeleteSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete session params -func (o *DeleteSessionParams) WithContext(ctx context.Context) *DeleteSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete session params -func (o *DeleteSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete session params -func (o *DeleteSessionParams) WithHTTPClient(client *http.Client) *DeleteSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete session params -func (o *DeleteSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete session params -func (o *DeleteSessionParams) WithID(id string) *DeleteSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete session params -func (o *DeleteSessionParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/session/delete_session_responses.go b/rest_client_api_client/session/delete_session_responses.go deleted file mode 100644 index 7145f0668..000000000 --- a/rest_client_api_client/session/delete_session_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteSessionReader is a Reader for the DeleteSession structure. -type DeleteSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteSessionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteSessionConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteSessionOK creates a DeleteSessionOK with default headers values -func NewDeleteSessionOK() *DeleteSessionOK { - return &DeleteSessionOK{} -} - -/* DeleteSessionOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteSessionOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteSessionOK) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionOK %+v", 200, o.Payload) -} -func (o *DeleteSessionOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSessionBadRequest creates a DeleteSessionBadRequest with default headers values -func NewDeleteSessionBadRequest() *DeleteSessionBadRequest { - return &DeleteSessionBadRequest{} -} - -/* DeleteSessionBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteSessionBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteSessionBadRequest) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionBadRequest %+v", 400, o.Payload) -} -func (o *DeleteSessionBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteSessionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSessionUnauthorized creates a DeleteSessionUnauthorized with default headers values -func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized { - return &DeleteSessionUnauthorized{} -} - -/* DeleteSessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteSessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteSessionUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteSessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSessionConflict creates a DeleteSessionConflict with default headers values -func NewDeleteSessionConflict() *DeleteSessionConflict { - return &DeleteSessionConflict{} -} - -/* DeleteSessionConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteSessionConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteSessionConflict) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionConflict %+v", 409, o.Payload) -} -func (o *DeleteSessionConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteSessionConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/session/detail_session_parameters.go b/rest_client_api_client/session/detail_session_parameters.go deleted file mode 100644 index 38f318abc..000000000 --- a/rest_client_api_client/session/detail_session_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSessionParams creates a new DetailSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSessionParams() *DetailSessionParams { - return &DetailSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSessionParamsWithTimeout creates a new DetailSessionParams object -// with the ability to set a timeout on a request. -func NewDetailSessionParamsWithTimeout(timeout time.Duration) *DetailSessionParams { - return &DetailSessionParams{ - timeout: timeout, - } -} - -// NewDetailSessionParamsWithContext creates a new DetailSessionParams object -// with the ability to set a context for a request. -func NewDetailSessionParamsWithContext(ctx context.Context) *DetailSessionParams { - return &DetailSessionParams{ - Context: ctx, - } -} - -// NewDetailSessionParamsWithHTTPClient creates a new DetailSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSessionParamsWithHTTPClient(client *http.Client) *DetailSessionParams { - return &DetailSessionParams{ - HTTPClient: client, - } -} - -/* DetailSessionParams contains all the parameters to send to the API endpoint - for the detail session operation. - - Typically these are written to a http.Request. -*/ -type DetailSessionParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSessionParams) WithDefaults() *DetailSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail session params -func (o *DetailSessionParams) WithTimeout(timeout time.Duration) *DetailSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail session params -func (o *DetailSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail session params -func (o *DetailSessionParams) WithContext(ctx context.Context) *DetailSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail session params -func (o *DetailSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail session params -func (o *DetailSessionParams) WithHTTPClient(client *http.Client) *DetailSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail session params -func (o *DetailSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail session params -func (o *DetailSessionParams) WithID(id string) *DetailSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail session params -func (o *DetailSessionParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/session/detail_session_responses.go b/rest_client_api_client/session/detail_session_responses.go deleted file mode 100644 index 20d53e996..000000000 --- a/rest_client_api_client/session/detail_session_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSessionReader is a Reader for the DetailSession structure. -type DetailSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailSessionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSessionOK creates a DetailSessionOK with default headers values -func NewDetailSessionOK() *DetailSessionOK { - return &DetailSessionOK{} -} - -/* DetailSessionOK describes a response with status code 200, with default header values. - -A single session -*/ -type DetailSessionOK struct { - Payload *rest_model.DetailSessionEnvelope -} - -func (o *DetailSessionOK) Error() string { - return fmt.Sprintf("[GET /sessions/{id}][%d] detailSessionOK %+v", 200, o.Payload) -} -func (o *DetailSessionOK) GetPayload() *rest_model.DetailSessionEnvelope { - return o.Payload -} - -func (o *DetailSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSessionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailSessionUnauthorized creates a DetailSessionUnauthorized with default headers values -func NewDetailSessionUnauthorized() *DetailSessionUnauthorized { - return &DetailSessionUnauthorized{} -} - -/* DetailSessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailSessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailSessionUnauthorized) Error() string { - return fmt.Sprintf("[GET /sessions/{id}][%d] detailSessionUnauthorized %+v", 401, o.Payload) -} -func (o *DetailSessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailSessionNotFound creates a DetailSessionNotFound with default headers values -func NewDetailSessionNotFound() *DetailSessionNotFound { - return &DetailSessionNotFound{} -} - -/* DetailSessionNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailSessionNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailSessionNotFound) Error() string { - return fmt.Sprintf("[GET /sessions/{id}][%d] detailSessionNotFound %+v", 404, o.Payload) -} -func (o *DetailSessionNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/session/list_sessions_parameters.go b/rest_client_api_client/session/list_sessions_parameters.go deleted file mode 100644 index b6257b293..000000000 --- a/rest_client_api_client/session/list_sessions_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListSessionsParams creates a new ListSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListSessionsParams() *ListSessionsParams { - return &ListSessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListSessionsParamsWithTimeout creates a new ListSessionsParams object -// with the ability to set a timeout on a request. -func NewListSessionsParamsWithTimeout(timeout time.Duration) *ListSessionsParams { - return &ListSessionsParams{ - timeout: timeout, - } -} - -// NewListSessionsParamsWithContext creates a new ListSessionsParams object -// with the ability to set a context for a request. -func NewListSessionsParamsWithContext(ctx context.Context) *ListSessionsParams { - return &ListSessionsParams{ - Context: ctx, - } -} - -// NewListSessionsParamsWithHTTPClient creates a new ListSessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListSessionsParamsWithHTTPClient(client *http.Client) *ListSessionsParams { - return &ListSessionsParams{ - HTTPClient: client, - } -} - -/* ListSessionsParams contains all the parameters to send to the API endpoint - for the list sessions operation. - - Typically these are written to a http.Request. -*/ -type ListSessionsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSessionsParams) WithDefaults() *ListSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSessionsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list sessions params -func (o *ListSessionsParams) WithTimeout(timeout time.Duration) *ListSessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list sessions params -func (o *ListSessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list sessions params -func (o *ListSessionsParams) WithContext(ctx context.Context) *ListSessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list sessions params -func (o *ListSessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list sessions params -func (o *ListSessionsParams) WithHTTPClient(client *http.Client) *ListSessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list sessions params -func (o *ListSessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list sessions params -func (o *ListSessionsParams) WithFilter(filter *string) *ListSessionsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list sessions params -func (o *ListSessionsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list sessions params -func (o *ListSessionsParams) WithLimit(limit *int64) *ListSessionsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list sessions params -func (o *ListSessionsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list sessions params -func (o *ListSessionsParams) WithOffset(offset *int64) *ListSessionsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list sessions params -func (o *ListSessionsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/session/list_sessions_responses.go b/rest_client_api_client/session/list_sessions_responses.go deleted file mode 100644 index 2fcbc07a1..000000000 --- a/rest_client_api_client/session/list_sessions_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListSessionsReader is a Reader for the ListSessions structure. -type ListSessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListSessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListSessionsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListSessionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListSessionsOK creates a ListSessionsOK with default headers values -func NewListSessionsOK() *ListSessionsOK { - return &ListSessionsOK{} -} - -/* ListSessionsOK describes a response with status code 200, with default header values. - -A list of sessions -*/ -type ListSessionsOK struct { - Payload *rest_model.ListSessionsEnvelope -} - -func (o *ListSessionsOK) Error() string { - return fmt.Sprintf("[GET /sessions][%d] listSessionsOK %+v", 200, o.Payload) -} -func (o *ListSessionsOK) GetPayload() *rest_model.ListSessionsEnvelope { - return o.Payload -} - -func (o *ListSessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListSessionsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListSessionsBadRequest creates a ListSessionsBadRequest with default headers values -func NewListSessionsBadRequest() *ListSessionsBadRequest { - return &ListSessionsBadRequest{} -} - -/* ListSessionsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListSessionsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListSessionsBadRequest) Error() string { - return fmt.Sprintf("[GET /sessions][%d] listSessionsBadRequest %+v", 400, o.Payload) -} -func (o *ListSessionsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListSessionsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListSessionsUnauthorized creates a ListSessionsUnauthorized with default headers values -func NewListSessionsUnauthorized() *ListSessionsUnauthorized { - return &ListSessionsUnauthorized{} -} - -/* ListSessionsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListSessionsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListSessionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /sessions][%d] listSessionsUnauthorized %+v", 401, o.Payload) -} -func (o *ListSessionsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListSessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/session/session_client.go b/rest_client_api_client/session/session_client.go deleted file mode 100644 index 5a9d5ab4e..000000000 --- a/rest_client_api_client/session/session_client.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new session API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for session API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateSession(params *CreateSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSessionCreated, error) - - DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionOK, error) - - DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionOK, error) - - ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSessionsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateSession creates a session resource - - Create a session resource. -*/ -func (a *Client) CreateSession(params *CreateSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateSessionCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateSessionParams() - } - op := &runtime.ClientOperation{ - ID: "createSession", - Method: "POST", - PathPattern: "/sessions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateSessionCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteSession deletes a session - - Delete a session by id. -*/ -func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteSessionParams() - } - op := &runtime.ClientOperation{ - ID: "deleteSession", - Method: "DELETE", - PathPattern: "/sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailSession retrieves a single session - - Retrieves a single session by id. -*/ -func (a *Client) DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSessionParams() - } - op := &runtime.ClientOperation{ - ID: "detailSession", - Method: "GET", - PathPattern: "/sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListSessions lists sessions - - Retrieves a list of active sessions resources; supports filtering, sorting, and pagination. - -Sessions are tied to an API session and are moved when an API session times out or logs out. Active sessions -(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active. - -*/ -func (a *Client) ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListSessionsParams() - } - op := &runtime.ClientOperation{ - ID: "listSessions", - Method: "GET", - PathPattern: "/sessions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListSessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListSessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/well_known/list_well_known_cas_parameters.go b/rest_client_api_client/well_known/list_well_known_cas_parameters.go deleted file mode 100644 index 766f096dc..000000000 --- a/rest_client_api_client/well_known/list_well_known_cas_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListWellKnownCasParams creates a new ListWellKnownCasParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListWellKnownCasParams() *ListWellKnownCasParams { - return &ListWellKnownCasParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListWellKnownCasParamsWithTimeout creates a new ListWellKnownCasParams object -// with the ability to set a timeout on a request. -func NewListWellKnownCasParamsWithTimeout(timeout time.Duration) *ListWellKnownCasParams { - return &ListWellKnownCasParams{ - timeout: timeout, - } -} - -// NewListWellKnownCasParamsWithContext creates a new ListWellKnownCasParams object -// with the ability to set a context for a request. -func NewListWellKnownCasParamsWithContext(ctx context.Context) *ListWellKnownCasParams { - return &ListWellKnownCasParams{ - Context: ctx, - } -} - -// NewListWellKnownCasParamsWithHTTPClient creates a new ListWellKnownCasParams object -// with the ability to set a custom HTTPClient for a request. -func NewListWellKnownCasParamsWithHTTPClient(client *http.Client) *ListWellKnownCasParams { - return &ListWellKnownCasParams{ - HTTPClient: client, - } -} - -/* ListWellKnownCasParams contains all the parameters to send to the API endpoint - for the list well known cas operation. - - Typically these are written to a http.Request. -*/ -type ListWellKnownCasParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list well known cas params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListWellKnownCasParams) WithDefaults() *ListWellKnownCasParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list well known cas params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListWellKnownCasParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list well known cas params -func (o *ListWellKnownCasParams) WithTimeout(timeout time.Duration) *ListWellKnownCasParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list well known cas params -func (o *ListWellKnownCasParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list well known cas params -func (o *ListWellKnownCasParams) WithContext(ctx context.Context) *ListWellKnownCasParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list well known cas params -func (o *ListWellKnownCasParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list well known cas params -func (o *ListWellKnownCasParams) WithHTTPClient(client *http.Client) *ListWellKnownCasParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list well known cas params -func (o *ListWellKnownCasParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListWellKnownCasParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_client/well_known/list_well_known_cas_responses.go b/rest_client_api_client/well_known/list_well_known_cas_responses.go deleted file mode 100644 index 5af0dc48d..000000000 --- a/rest_client_api_client/well_known/list_well_known_cas_responses.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// ListWellKnownCasReader is a Reader for the ListWellKnownCas structure. -type ListWellKnownCasReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListWellKnownCasReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListWellKnownCasOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListWellKnownCasOK creates a ListWellKnownCasOK with default headers values -func NewListWellKnownCasOK() *ListWellKnownCasOK { - return &ListWellKnownCasOK{} -} - -/* ListWellKnownCasOK describes a response with status code 200, with default header values. - -A base64 encoded PKCS7 store -*/ -type ListWellKnownCasOK struct { - Payload string -} - -func (o *ListWellKnownCasOK) Error() string { - return fmt.Sprintf("[GET /.well-known/est/cacerts][%d] listWellKnownCasOK %+v", 200, o.Payload) -} -func (o *ListWellKnownCasOK) GetPayload() string { - return o.Payload -} - -func (o *ListWellKnownCasOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_client_api_client/well_known/well_known_client.go b/rest_client_api_client/well_known/well_known_client.go deleted file mode 100644 index 74201f405..000000000 --- a/rest_client_api_client/well_known/well_known_client.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new well known API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for well known API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ListWellKnownCas(params *ListWellKnownCasParams, opts ...ClientOption) (*ListWellKnownCasOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - ListWellKnownCas gets c a cert store - - This endpoint is used during enrollments to bootstrap trust between enrolling clients and the Ziti Edge API. -This endpoint returns a base64 encoded PKCS7 store. The content can be base64 decoded and parsed by any library -that supports parsing PKCS7 stores. - -*/ -func (a *Client) ListWellKnownCas(params *ListWellKnownCasParams, opts ...ClientOption) (*ListWellKnownCasOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListWellKnownCasParams() - } - op := &runtime.ClientOperation{ - ID: "listWellKnownCas", - Method: "GET", - PathPattern: "/.well-known/est/cacerts", - ProducesMediaTypes: []string{"application/pkcs7-mime"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListWellKnownCasReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListWellKnownCasOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listWellKnownCas: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_client_api_client/ziti_edge_client_client.go b/rest_client_api_client/ziti_edge_client_client.go deleted file mode 100644 index 28a818c00..000000000 --- a/rest_client_api_client/ziti_edge_client_client.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_client_api_client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_client_api_client/authentication" - "github.com/openziti/edge/rest_client_api_client/current_api_session" - "github.com/openziti/edge/rest_client_api_client/current_identity" - "github.com/openziti/edge/rest_client_api_client/enroll" - "github.com/openziti/edge/rest_client_api_client/external_jwt_signer" - "github.com/openziti/edge/rest_client_api_client/informational" - "github.com/openziti/edge/rest_client_api_client/posture_checks" - "github.com/openziti/edge/rest_client_api_client/service" - "github.com/openziti/edge/rest_client_api_client/session" - "github.com/openziti/edge/rest_client_api_client/well_known" -) - -// Default ziti edge client HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "demo.ziti.dev" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/edge/client/v1" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"https"} - -// NewHTTPClient creates a new ziti edge client HTTP client. -func NewHTTPClient(formats strfmt.Registry) *ZitiEdgeClient { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new ziti edge client HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ZitiEdgeClient { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new ziti edge client client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *ZitiEdgeClient { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(ZitiEdgeClient) - cli.Transport = transport - cli.Authentication = authentication.New(transport, formats) - cli.CurrentAPISession = current_api_session.New(transport, formats) - cli.CurrentIdentity = current_identity.New(transport, formats) - cli.Enroll = enroll.New(transport, formats) - cli.ExternalJWTSigner = external_jwt_signer.New(transport, formats) - cli.Informational = informational.New(transport, formats) - cli.PostureChecks = posture_checks.New(transport, formats) - cli.Service = service.New(transport, formats) - cli.Session = session.New(transport, formats) - cli.WellKnown = well_known.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// ZitiEdgeClient is a client for ziti edge client -type ZitiEdgeClient struct { - Authentication authentication.ClientService - - CurrentAPISession current_api_session.ClientService - - CurrentIdentity current_identity.ClientService - - Enroll enroll.ClientService - - ExternalJWTSigner external_jwt_signer.ClientService - - Informational informational.ClientService - - PostureChecks posture_checks.ClientService - - Service service.ClientService - - Session session.ClientService - - WellKnown well_known.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *ZitiEdgeClient) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.Authentication.SetTransport(transport) - c.CurrentAPISession.SetTransport(transport) - c.CurrentIdentity.SetTransport(transport) - c.Enroll.SetTransport(transport) - c.ExternalJWTSigner.SetTransport(transport) - c.Informational.SetTransport(transport) - c.PostureChecks.SetTransport(transport) - c.Service.SetTransport(transport) - c.Session.SetTransport(transport) - c.WellKnown.SetTransport(transport) -} diff --git a/rest_client_api_server/configure_ziti_edge_client.go b/rest_client_api_server/configure_ziti_edge_client.go deleted file mode 100644 index b406359db..000000000 --- a/rest_client_api_server/configure_ziti_edge_client.go +++ /dev/null @@ -1,393 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_client_api_server - -import ( - "crypto/tls" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/openziti/edge/rest_client_api_server/operations" - "github.com/openziti/edge/rest_client_api_server/operations/authentication" - "github.com/openziti/edge/rest_client_api_server/operations/current_api_session" - "github.com/openziti/edge/rest_client_api_server/operations/current_identity" - "github.com/openziti/edge/rest_client_api_server/operations/enroll" - "github.com/openziti/edge/rest_client_api_server/operations/external_jwt_signer" - "github.com/openziti/edge/rest_client_api_server/operations/informational" - "github.com/openziti/edge/rest_client_api_server/operations/posture_checks" - "github.com/openziti/edge/rest_client_api_server/operations/service" - "github.com/openziti/edge/rest_client_api_server/operations/session" - "github.com/openziti/edge/rest_client_api_server/operations/well_known" -) - -//go:generate swagger generate server --target ../../edge --name ZitiEdgeClient --spec ../specs/client.yml --model-package rest_model --server-package rest_client_api_server --principal interface{} --exclude-main - -func configureFlags(api *operations.ZitiEdgeClientAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *operations.ZitiEdgeClientAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.ApplicationPkcs10Consumer = runtime.ConsumerFunc(func(r io.Reader, target interface{}) error { - return errors.NotImplemented("applicationPkcs10 consumer has not yet been implemented") - }) - api.ApplicationXPemFileConsumer = runtime.ConsumerFunc(func(r io.Reader, target interface{}) error { - return errors.NotImplemented("applicationXPemFile consumer has not yet been implemented") - }) - api.JSONConsumer = runtime.JSONConsumer() - api.TxtConsumer = runtime.TextConsumer() - - api.ApplicationPkcs7MimeProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationPkcs7Mime producer has not yet been implemented") - }) - api.ApplicationXPemFileProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationXPemFile producer has not yet been implemented") - }) - api.ApplicationXX509UserCertProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationXX509UserCert producer has not yet been implemented") - }) - api.BinProducer = runtime.ByteStreamProducer() - api.JSONProducer = runtime.JSONProducer() - api.TextYamlProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("textYaml producer has not yet been implemented") - }) - - // Applies when the "zt-session" header is set - if api.ZtSessionAuth == nil { - api.ZtSessionAuth = func(token string) (interface{}, error) { - return nil, errors.NotImplemented("api key auth (ztSession) zt-session from header param [zt-session] has not yet been implemented") - } - } - - // Set your custom authorizer if needed. Default one is security.Authorized() - // Expected interface runtime.Authorizer - // - // Example: - // api.APIAuthorizer = security.Authorized() - - if api.CurrentAPISessionDeleteCurrentAPISessionHandler == nil { - api.CurrentAPISessionDeleteCurrentAPISessionHandler = current_api_session.DeleteCurrentAPISessionHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISession has not yet been implemented") - }) - } - if api.AuthenticationAuthenticateHandler == nil { - api.AuthenticationAuthenticateHandler = authentication.AuthenticateHandlerFunc(func(params authentication.AuthenticateParams) middleware.Responder { - return middleware.NotImplemented("operation authentication.Authenticate has not yet been implemented") - }) - } - if api.AuthenticationAuthenticateMfaHandler == nil { - api.AuthenticationAuthenticateMfaHandler = authentication.AuthenticateMfaHandlerFunc(func(params authentication.AuthenticateMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authentication.AuthenticateMfa has not yet been implemented") - }) - } - if api.CurrentAPISessionCreateCurrentAPISessionCertificateHandler == nil { - api.CurrentAPISessionCreateCurrentAPISessionCertificateHandler = current_api_session.CreateCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.CreateCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.CreateCurrentAPISessionCertificate has not yet been implemented") - }) - } - if api.CurrentIdentityCreateMfaRecoveryCodesHandler == nil { - api.CurrentIdentityCreateMfaRecoveryCodesHandler = current_identity.CreateMfaRecoveryCodesHandlerFunc(func(params current_identity.CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.CreateMfaRecoveryCodes has not yet been implemented") - }) - } - if api.PostureChecksCreatePostureResponseHandler == nil { - api.PostureChecksCreatePostureResponseHandler = posture_checks.CreatePostureResponseHandlerFunc(func(params posture_checks.CreatePostureResponseParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.CreatePostureResponse has not yet been implemented") - }) - } - if api.PostureChecksCreatePostureResponseBulkHandler == nil { - api.PostureChecksCreatePostureResponseBulkHandler = posture_checks.CreatePostureResponseBulkHandlerFunc(func(params posture_checks.CreatePostureResponseBulkParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.CreatePostureResponseBulk has not yet been implemented") - }) - } - if api.SessionCreateSessionHandler == nil { - api.SessionCreateSessionHandler = session.CreateSessionHandlerFunc(func(params session.CreateSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.CreateSession has not yet been implemented") - }) - } - if api.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler == nil { - api.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler = current_api_session.DeleteCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISessionCertificate has not yet been implemented") - }) - } - if api.CurrentIdentityDeleteMfaHandler == nil { - api.CurrentIdentityDeleteMfaHandler = current_identity.DeleteMfaHandlerFunc(func(params current_identity.DeleteMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DeleteMfa has not yet been implemented") - }) - } - if api.ServiceDeleteServiceHandler == nil { - api.ServiceDeleteServiceHandler = service.DeleteServiceHandlerFunc(func(params service.DeleteServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DeleteService has not yet been implemented") - }) - } - if api.SessionDeleteSessionHandler == nil { - api.SessionDeleteSessionHandler = session.DeleteSessionHandlerFunc(func(params session.DeleteSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DeleteSession has not yet been implemented") - }) - } - if api.CurrentAPISessionDetailCurrentAPISessionCertificateHandler == nil { - api.CurrentAPISessionDetailCurrentAPISessionCertificateHandler = current_api_session.DetailCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DetailCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DetailCurrentAPISessionCertificate has not yet been implemented") - }) - } - if api.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler = current_api_session.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DetailCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.CurrentIdentityDetailMfaHandler == nil { - api.CurrentIdentityDetailMfaHandler = current_identity.DetailMfaHandlerFunc(func(params current_identity.DetailMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfa has not yet been implemented") - }) - } - if api.CurrentIdentityDetailMfaQrCodeHandler == nil { - api.CurrentIdentityDetailMfaQrCodeHandler = current_identity.DetailMfaQrCodeHandlerFunc(func(params current_identity.DetailMfaQrCodeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaQrCode has not yet been implemented") - }) - } - if api.CurrentIdentityDetailMfaRecoveryCodesHandler == nil { - api.CurrentIdentityDetailMfaRecoveryCodesHandler = current_identity.DetailMfaRecoveryCodesHandlerFunc(func(params current_identity.DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaRecoveryCodes has not yet been implemented") - }) - } - if api.ServiceDetailServiceHandler == nil { - api.ServiceDetailServiceHandler = service.DetailServiceHandlerFunc(func(params service.DetailServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DetailService has not yet been implemented") - }) - } - if api.SessionDetailSessionHandler == nil { - api.SessionDetailSessionHandler = session.DetailSessionHandlerFunc(func(params session.DetailSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DetailSession has not yet been implemented") - }) - } - if api.InformationalDetailSpecHandler == nil { - api.InformationalDetailSpecHandler = informational.DetailSpecHandlerFunc(func(params informational.DetailSpecParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpec has not yet been implemented") - }) - } - if api.InformationalDetailSpecBodyHandler == nil { - api.InformationalDetailSpecBodyHandler = informational.DetailSpecBodyHandlerFunc(func(params informational.DetailSpecBodyParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpecBody has not yet been implemented") - }) - } - if api.EnrollEnrollHandler == nil { - api.EnrollEnrollHandler = enroll.EnrollHandlerFunc(func(params enroll.EnrollParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.Enroll has not yet been implemented") - }) - } - if api.EnrollEnrollCaHandler == nil { - api.EnrollEnrollCaHandler = enroll.EnrollCaHandlerFunc(func(params enroll.EnrollCaParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollCa has not yet been implemented") - }) - } - if api.EnrollEnrollErOttHandler == nil { - api.EnrollEnrollErOttHandler = enroll.EnrollErOttHandlerFunc(func(params enroll.EnrollErOttParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollErOtt has not yet been implemented") - }) - } - if api.CurrentIdentityEnrollMfaHandler == nil { - api.CurrentIdentityEnrollMfaHandler = current_identity.EnrollMfaHandlerFunc(func(params current_identity.EnrollMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.EnrollMfa has not yet been implemented") - }) - } - if api.EnrollEnrollOttHandler == nil { - api.EnrollEnrollOttHandler = enroll.EnrollOttHandlerFunc(func(params enroll.EnrollOttParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollOtt has not yet been implemented") - }) - } - if api.EnrollEnrollOttCaHandler == nil { - api.EnrollEnrollOttCaHandler = enroll.EnrollOttCaHandlerFunc(func(params enroll.EnrollOttCaParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollOttCa has not yet been implemented") - }) - } - if api.EnrollErnollUpdbHandler == nil { - api.EnrollErnollUpdbHandler = enroll.ErnollUpdbHandlerFunc(func(params enroll.ErnollUpdbParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.ErnollUpdb has not yet been implemented") - }) - } - if api.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler = current_api_session.ExtendCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.EnrollExtendRouterEnrollmentHandler == nil { - api.EnrollExtendRouterEnrollmentHandler = enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.ExtendRouterEnrollment has not yet been implemented") - }) - } - if api.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler = current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendVerifyCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.CurrentAPISessionGetCurrentAPISessionHandler == nil { - api.CurrentAPISessionGetCurrentAPISessionHandler = current_api_session.GetCurrentAPISessionHandlerFunc(func(params current_api_session.GetCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.GetCurrentAPISession has not yet been implemented") - }) - } - if api.CurrentIdentityGetCurrentIdentityHandler == nil { - api.CurrentIdentityGetCurrentIdentityHandler = current_identity.GetCurrentIdentityHandlerFunc(func(params current_identity.GetCurrentIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.GetCurrentIdentity has not yet been implemented") - }) - } - if api.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler == nil { - api.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler = current_identity.GetCurrentIdentityEdgeRoutersHandlerFunc(func(params current_identity.GetCurrentIdentityEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.GetCurrentIdentityEdgeRouters has not yet been implemented") - }) - } - if api.CurrentAPISessionListCurrentAPISessionCertificatesHandler == nil { - api.CurrentAPISessionListCurrentAPISessionCertificatesHandler = current_api_session.ListCurrentAPISessionCertificatesHandlerFunc(func(params current_api_session.ListCurrentAPISessionCertificatesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListCurrentAPISessionCertificates has not yet been implemented") - }) - } - if api.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler == nil { - api.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler = current_api_session.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params current_api_session.ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListCurrentIdentityAuthenticators has not yet been implemented") - }) - } - if api.ExternalJWTSignerListExternalJWTSignersHandler == nil { - api.ExternalJWTSignerListExternalJWTSignersHandler = external_jwt_signer.ListExternalJWTSignersHandlerFunc(func(params external_jwt_signer.ListExternalJWTSignersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.ListExternalJWTSigners has not yet been implemented") - }) - } - if api.InformationalListProtocolsHandler == nil { - api.InformationalListProtocolsHandler = informational.ListProtocolsHandlerFunc(func(params informational.ListProtocolsParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListProtocols has not yet been implemented") - }) - } - if api.InformationalListRootHandler == nil { - api.InformationalListRootHandler = informational.ListRootHandlerFunc(func(params informational.ListRootParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListRoot has not yet been implemented") - }) - } - if api.ServiceListServiceTerminatorsHandler == nil { - api.ServiceListServiceTerminatorsHandler = service.ListServiceTerminatorsHandlerFunc(func(params service.ListServiceTerminatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceTerminators has not yet been implemented") - }) - } - if api.CurrentAPISessionListServiceUpdatesHandler == nil { - api.CurrentAPISessionListServiceUpdatesHandler = current_api_session.ListServiceUpdatesHandlerFunc(func(params current_api_session.ListServiceUpdatesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListServiceUpdates has not yet been implemented") - }) - } - if api.ServiceListServicesHandler == nil { - api.ServiceListServicesHandler = service.ListServicesHandlerFunc(func(params service.ListServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServices has not yet been implemented") - }) - } - if api.SessionListSessionsHandler == nil { - api.SessionListSessionsHandler = session.ListSessionsHandlerFunc(func(params session.ListSessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.ListSessions has not yet been implemented") - }) - } - if api.InformationalListSpecsHandler == nil { - api.InformationalListSpecsHandler = informational.ListSpecsHandlerFunc(func(params informational.ListSpecsParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListSpecs has not yet been implemented") - }) - } - if api.InformationalListVersionHandler == nil { - api.InformationalListVersionHandler = informational.ListVersionHandlerFunc(func(params informational.ListVersionParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListVersion has not yet been implemented") - }) - } - if api.WellKnownListWellKnownCasHandler == nil { - api.WellKnownListWellKnownCasHandler = well_known.ListWellKnownCasHandlerFunc(func(params well_known.ListWellKnownCasParams) middleware.Responder { - return middleware.NotImplemented("operation well_known.ListWellKnownCas has not yet been implemented") - }) - } - if api.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler = current_api_session.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.PatchCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.ServicePatchServiceHandler == nil { - api.ServicePatchServiceHandler = service.PatchServiceHandlerFunc(func(params service.PatchServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.PatchService has not yet been implemented") - }) - } - if api.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler = current_api_session.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.UpdateCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.ServiceUpdateServiceHandler == nil { - api.ServiceUpdateServiceHandler = service.UpdateServiceHandlerFunc(func(params service.UpdateServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.UpdateService has not yet been implemented") - }) - } - if api.CurrentIdentityVerifyMfaHandler == nil { - api.CurrentIdentityVerifyMfaHandler = current_identity.VerifyMfaHandlerFunc(func(params current_identity.VerifyMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.VerifyMfa has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/rest_client_api_server/doc.go b/rest_client_api_server/doc.go deleted file mode 100644 index 59a13bec7..000000000 --- a/rest_client_api_server/doc.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -// Package rest_client_api_server Ziti Edge Client -// -// OpenZiti Edge Client API -// Schemes: -// https -// Host: demo.ziti.dev -// BasePath: /edge/client/v1 -// Version: 0.25.5 -// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html -// Contact: OpenZiti https://openziti.discourse.group -// -// Consumes: -// - application/pkcs10 -// - application/x-pem-file -// - application/json -// - text/plain -// -// Produces: -// - application/pkcs7-mime -// - application/x-pem-file -// - application/x-x509-user-cert -// - image/png -// - application/json -// - text/yaml -// -// swagger:meta -package rest_client_api_server diff --git a/rest_client_api_server/embedded_spec.go b/rest_client_api_server/embedded_spec.go deleted file mode 100644 index 6fa125c41..000000000 --- a/rest_client_api_server/embedded_spec.go +++ /dev/null @@ -1,11976 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_client_api_server - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "description": "OpenZiti Edge Client API", - "title": "Ziti Edge Client", - "contact": { - "name": "OpenZiti", - "url": "https://openziti.discourse.group", - "email": "help@openziti.org" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "0.25.5" - }, - "host": "demo.ziti.dev", - "basePath": "/edge/client/v1", - "paths": { - "/": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listRoot", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - }, - "/.well-known/est/cacerts": { - "get": { - "security": [], - "description": "This endpoint is used during enrollments to bootstrap trust between enrolling clients and the Ziti Edge API.\nThis endpoint returns a base64 encoded PKCS7 store. The content can be base64 decoded and parsed by any library\nthat supports parsing PKCS7 stores.\n", - "produces": [ - "application/pkcs7-mime" - ], - "tags": [ - "Well Known" - ], - "summary": "Get CA Cert Store", - "operationId": "listWellKnownCas", - "responses": { - "200": { - "description": "A base64 encoded PKCS7 store", - "schema": { - "type": "string", - "example": "MIIMUQYJKoZIhvcNAQcCoIIMQjCCDD4CAQExADALBgkqhkiG9w0BBwGgggwkMIIG\nBjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw\nFQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD\nVQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl\nIEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx\nODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI\nDA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg\nTmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv\ndW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC\nCgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z\nKIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ\nNJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa\nVK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl\n7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s\n6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb\nQGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010\nXdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU\nHe16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW\nghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb\nryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw\nHQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu\nOuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD\nAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE\ngRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS\nCpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7\nKOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+\nrMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X\n6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI\nFximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN\n8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw\nBHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2\nYSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo\nLLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq\ndH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB\nlzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH\nDAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv\ndW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5\nIFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy\nbG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg\nQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg\nQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD\nDIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw\nHDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f\nWsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV\nXO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv\npnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD\nw2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI\nKyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo\n783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm\npQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE\nWFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F\n6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa\nbADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD\nVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB\nACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy\n3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY\nuEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn\ncCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS\nWI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg\nAX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO\nwEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y\nqQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m\nfGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh\ndprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8\n3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA==\n" - } - } - } - } - }, - "/authenticate": { - "post": { - "security": [], - "description": "Allows authentication Methods include \"password\" and \"cert\"\n", - "tags": [ - "Authentication" - ], - "summary": "Authenticate via a method supplied via a query string parameter", - "operationId": "authenticate", - "parameters": [ - { - "name": "auth", - "in": "body", - "schema": { - "$ref": "#/definitions/authenticate" - } - } - ], - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": null, - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "403": { - "description": "The authentication request could not be processed as the credentials are invalid", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "INVALID_AUTH", - "message": "The authentication request failed", - "requestId": "5952ed10-3091-474f-a691-47ebab6990dc" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "enum": [ - "password", - "cert", - "ext-jwt" - ], - "type": "string", - "name": "method", - "in": "query", - "required": true - } - ] - }, - "/authenticate/mfa": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA authentication by submitting a MFA time based one time token or backup code.", - "tags": [ - "Authentication", - "MFA" - ], - "summary": "Complete MFA authentication", - "operationId": "authenticateMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaAuth", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - } - } - } - }, - "/current-api-session": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves the API session that was used to issue the current request", - "tags": [ - "Current API Session" - ], - "summary": "Return the current API session", - "operationId": "getCurrentAPISession", - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": null, - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Terminates the current API session", - "tags": [ - "Current API Session" - ], - "summary": "Logout", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-api-session/certificates": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination", - "tags": [ - "Current API Session" - ], - "summary": "List the ephemeral certificates available for the current API Session", - "operationId": "listCurrentApiSessionCertificates", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of the current API Session's certificate", - "schema": { - "$ref": "#/definitions/listCurrentApiSessionCertificatesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an ephemeral certificate for the current API Session. This endpoint expects a PEM encoded CSRs to be provided for fulfillment as a property of a JSON payload. It is up to the client to manage the private key backing the CSR request.", - "tags": [ - "Current API Session" - ], - "summary": "Creates an ephemeral certificate for the current API Session", - "operationId": "createCurrentApiSessionCertificate", - "parameters": [ - { - "description": "The payload describing the CSR used to create a session certificate", - "name": "sessionCertificate", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/currentApiSessionCertificateCreate" - } - } - ], - "responses": { - "201": { - "description": "A response of a create API Session certificate", - "schema": { - "$ref": "#/definitions/createCurrentApiSessionCertificateEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-api-session/certificates/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single ephemeral certificate by id", - "tags": [ - "Current API Session" - ], - "summary": "Retrieves an ephemeral certificate", - "operationId": "detailCurrentApiSessionCertificate", - "responses": { - "200": { - "description": "A response containing a single API Session certificate", - "schema": { - "$ref": "#/definitions/detailCurrentApiSessionCertificateEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an ephemeral certificateby id\n", - "tags": [ - "Current API Session" - ], - "summary": "Delete an ephemeral certificate", - "operationId": "deleteCurrentApiSessionCertificate", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-api-session/service-updates": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate\nservice refreshes.\n", - "tags": [ - "Current API Session", - "Services" - ], - "summary": "Returns data indicating whether a client should updates it service list", - "operationId": "listServiceUpdates", - "responses": { - "200": { - "description": "Data indicating necessary service updates", - "schema": { - "$ref": "#/definitions/listCurrentApiSessionServiceUpdatesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns the identity associated with the API sessions used to issue the current request", - "tags": [ - "Current Identity" - ], - "summary": "Return the current identity", - "operationId": "getCurrentIdentity", - "responses": { - "200": { - "description": "The identity associated with the API Session used to issue the request", - "schema": { - "$ref": "#/definitions/currentIdentityDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "edge-router-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/edge-routers" - }, - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - }, - "service-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/identities" - } - }, - "authenticators": { - "updb": { - "username": "admin" - } - }, - "createdAt": "2020-01-13T16:38:13.6854788Z", - "enrollment": {}, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "isAdmin": true, - "isDefaultAdmin": true, - "name": "Default Admin", - "roleAttributes": null, - "tags": {}, - "type": { - "_links": { - "self": { - "href": "./identity-types/User" - } - }, - "id": "User", - "name": "User", - "urlName": "identity-types" - }, - "updatedAt": "2020-01-13T16:38:13.6854788Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination.", - "tags": [ - "Current API Session" - ], - "summary": "List authenticators for the current identity", - "operationId": "listCurrentIdentityAuthenticators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity.", - "tags": [ - "Current API Session" - ], - "summary": "Retrieve an authenticator for the current identity", - "operationId": "detailCurrentIdentityAuthenticator", - "responses": { - "200": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's\nidentity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update all fields on an authenticator of this identity", - "operationId": "updateCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator put object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorUpdateWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API\nsession's identity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update the supplied fields on an authenticator of this identity", - "operationId": "patchCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator patch object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorPatchWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled.\nAllows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation.\nThe response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint.\nAfter verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to recieve a new certificate associated with a certificate based authenticator", - "operationId": "extendCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "A response containg the identity's new certificate", - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend-verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt.\nAfter receipt, the new client certificate must be used for new authentication requests.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to validate reciept of a new client certificate", - "operationId": "extendVerifyCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendValidateEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Lists the Edge Routers that the current identity has access to via policies. The data returned\nincludes their address and online status\n", - "tags": [ - "Current Identity", - "Edge Router" - ], - "summary": "Return this list of Edge Routers the identity has access to", - "operationId": "getCurrentIdentityEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listCurrentIdentityEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a ` + "`" + `POST /current-identity/mfa/verify` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Returns the current status of MFA enrollment", - "operationId": "detailMfa", - "responses": { - "200": { - "description": "The details of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via ` + "`" + `POST /current-identity/mfa/verify` + "`" + `\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Initiate MFA enrollment", - "operationId": "enrollMfa", - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The identity is already enrolled in MFA", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": null, - "cause": null, - "causeMessage": "", - "code": "ALREADY_MFA_ENROLLED", - "message": "The identity is already enrolled in MFA", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via ` + "`" + `DELETE /identities/\u003cid\u003e/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Disable MFA for the current identity", - "operationId": "deleteMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/qr-code": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started.\n", - "produces": [ - "image/png", - "application/json" - ], - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Show a QR code for unverified MFA enrollments", - "operationId": "detailMfaQrCode", - "responses": { - "200": { - "description": "OK" - }, - "404": { - "description": "No MFA enrollment or MFA enrollment is completed" - } - } - } - }, - "/current-identity/mfa/recovery-codes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment view the current recovery codes", - "operationId": "detailMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment regenerate the recovery codes", - "operationId": "createMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "The recovery codes of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaRecoveryCodesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via ` + "`" + `POST /current-identity/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Complete MFA enrollment by verifying a time based one time token", - "operationId": "verifyMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/enroll": { - "post": { - "description": "endpoint defers to the logic in the more specific ` + "`" + `enroll/*` + "`" + ` endpoints", - "consumes": [ - "application/pkcs10", - "application/json", - "application/x-pem-file", - "text/plain" - ], - "produces": [ - "application/x-pem-file", - "application/json" - ], - "tags": [ - "Enroll" - ], - "summary": "Legacy enrollment endpoint", - "operationId": "enroll", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query" - } - ] - }, - "/enroll/ca": { - "post": { - "description": "For CA auto enrollment, an identity is not created beforehand.\nInstead one will be created during enrollment. The client will present a client certificate that is signed by a\nCertificate Authority that has been added and verified (See POST /cas and POST /cas/{id}/verify).\n\nDuring this process no CSRs are requires as the client should already be in possession of a valid certificate.\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity with a pre-exchanged certificate", - "operationId": "enrollCa", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/enroll/erott": { - "post": { - "description": "Enrolls an edge-router via a one-time-token to establish a certificate based identity.\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an edge-router", - "operationId": "enrollErOtt", - "responses": { - "200": { - "description": "A response containing the edge routers signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/enroll/extend/router": { - "post": { - "description": "Allows a router to extend its certificates' expiration date by\nusing its current and valid client certificate to submit a CSR. This CSR may\nbe passed in using a new private key, thus allowing private key rotation or swapping.\n\nAfter completion any new connections must be made with certificates returned from a 200 OK\nresponse. The previous client certificate is rendered invalid for use with the controller even if it\nhas not expired.\n\nThis request must be made using the existing, valid, client certificate.\n", - "tags": [ - "Enroll", - "Extend Enrollment" - ], - "summary": "Extend the life of a currently enrolled router's certificates", - "operationId": "extendRouterEnrollment", - "parameters": [ - { - "name": "routerExtendEnrollmentRequest", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerExtendEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "A response containg the edge routers new signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/enroll/ott": { - "post": { - "description": "Enroll an identity via a one-time-token which is supplied via a query string parameter. This enrollment method\nexpects a PEM encoded CSRs to be provided for fulfillment. It is up to the enrolling identity to manage the\nprivate key backing the CSR request.\n", - "consumes": [ - "application/pkcs10" - ], - "produces": [ - "application/x-x509-user-cert" - ], - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity via one-time-token", - "operationId": "enrollOtt", - "responses": { - "200": { - "description": "A PEM encoded certificate signed by the internal Ziti CA", - "schema": { - "type": "string" - }, - "examples": { - "application/x-x509-user-cert": "-----BEGIN CERTIFICATE-----\nMIICzDCCAlGgAwIBAgIRAPkVg1jVKqnNGFpSB3lPbaIwCgYIKoZIzj0EAwIwXjEL\nMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0w\nKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkgRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwHhcN\nMTgxMTE1MTI1NzE3WhcNMTkxMTI1MTI1NzE3WjBrMQswCQYDVQQGEwJVUzELMAkG\nA1UECAwCTkMxEjAQBgNVBAcMCUNoYXJsb3R0ZTETMBEGA1UECgwKTmV0Rm91bmRy\neTEPMA0GA1UECwwGQWR2RGV2MRUwEwYDVQQDDAxaaXRpQ2xpZW50MDEwdjAQBgcq\nhkjOPQIBBgUrgQQAIgNiAATTl2ft+/K9RvDgki9gSr9udNcV2bxD4LrWEdCdXNzF\niVUiEcEte9z/M0JRt8lgo17OjFvS+ecrAmLtIZNmQnH3+9YeafjeNPpvQsMKxlTN\nMnU7Hka11GHc6swQZSyHvlKjgcUwgcIwCQYDVR0TBAIwADARBglghkgBhvhCAQEE\nBAMCBaAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2VuZXJhdGVkIENsaWVudCBD\nZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUtx+Tej6lSYdjb8Jbc2QuvoEsI/swHwYDVR0j\nBBgwFoAUcdTlRrnP43ZbQ3PGAbZMPE26+H4wDgYDVR0PAQH/BAQDAgXgMB0GA1Ud\nJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAKBggqhkjOPQQDAgNpADBmAjEAuXDS\nH7KKMr+la+Yuh8d8Q9cLtXzdS0j6a8e7iOyPJmdWq2WuzNdbCfAfLgKXuxhSAjEA\nsadZrXl1OBv11RGAKdYBIyRmfYUotCFAtCNKcfgBUxci0TDaKDA7r3jnjKT1d7Fs\n-----END CERTIFICATE-----\n" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/enroll/ottca": { - "post": { - "description": "Enroll an identity via a one-time-token that also requires a pre-exchanged client certificate to match a\nCertificate Authority that has been added and verified (See POST /cas and POST /cas{id}/verify). The client\nmust present a client certificate signed by CA associated with the enrollment. This enrollment is similar to\nCA auto enrollment except that is required the identity to be pre-created.\n\nAs the client certificate has been pre-exchanged there is no CSR input to this enrollment method.\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity via one-time-token with a pre-exchanged client certificate", - "operationId": "enrollOttCa", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/enroll/updb": { - "post": { - "description": "Enrolls an identity via a one-time-token to establish an initial username and password combination\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity via one-time-token", - "operationId": "ernollUpdb", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/external-jwt-signers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of external JWT signers for authentication", - "tags": [ - "External JWT Signer" - ], - "summary": "List Client Authentication External JWT", - "operationId": "listExternalJwtSigners", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of External JWT Signers", - "schema": { - "$ref": "#/definitions/listClientExternalJwtSignersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-response": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Submits posture responses", - "tags": [ - "Posture Checks" - ], - "summary": "Submit a posture response to a posture query", - "operationId": "createPostureResponse", - "parameters": [ - { - "description": "A Posture Response", - "name": "postureResponse", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureResponseCreate" - } - } - ], - "responses": { - "201": { - "description": "Contains a list of services that have had their timers altered", - "schema": { - "$ref": "#/definitions/postureResponseEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-response-bulk": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Submits posture responses", - "tags": [ - "Posture Checks" - ], - "summary": "Submit multiple posture responses", - "operationId": "createPostureResponseBulk", - "parameters": [ - { - "description": "A Posture Response", - "name": "postureResponse", - "in": "body", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/postureResponseCreate" - } - } - } - ], - "responses": { - "200": { - "description": "Contains a list of services that have had their timers altered", - "schema": { - "$ref": "#/definitions/postureResponseEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/protocols": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Return a list of the listening Edge protocols", - "operationId": "listProtocols", - "responses": { - "200": { - "description": "A list of supported Edge protocols", - "schema": { - "$ref": "#/definitions/listProtocolsEnvelope" - } - } - } - } - }, - "/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List services", - "operationId": "listServices", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/services/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Retrieves a single service", - "operationId": "detailService", - "responses": { - "200": { - "description": "A single service", - "schema": { - "$ref": "#/definitions/detailServiceEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update all fields on a service", - "operationId": "updateService", - "parameters": [ - { - "description": "A service update object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Delete a service", - "operationId": "deleteService", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update the supplied fields on a service", - "operationId": "patchService", - "parameters": [ - { - "description": "A service patch object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/terminators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination.\n", - "tags": [ - "Service" - ], - "summary": "List of terminators assigned to a service", - "operationId": "listServiceTerminators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listClientTerminatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/sessions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of active sessions resources; supports filtering, sorting, and pagination.\n\nSessions are tied to an API session and are moved when an API session times out or logs out. Active sessions\n(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active.\n", - "tags": [ - "Session" - ], - "summary": "List sessions", - "operationId": "listSessions", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of sessions", - "schema": { - "$ref": "#/definitions/listSessionsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a session resource.", - "tags": [ - "Session" - ], - "summary": "Create a session resource", - "operationId": "createSession", - "parameters": [ - { - "description": "A session to create", - "name": "session", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/sessionCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/sessionCreateEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/sessions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single session by id.", - "tags": [ - "Session" - ], - "summary": "Retrieves a single session", - "operationId": "detailSession", - "responses": { - "200": { - "description": "A single session", - "schema": { - "$ref": "#/definitions/detailSessionEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a session by id.", - "tags": [ - "Session" - ], - "summary": "Delete a session", - "operationId": "deleteSession", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs": { - "get": { - "security": [], - "description": "Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Returns a list of API specs", - "operationId": "listSpecs", - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listSpecsEnvelope" - } - } - } - } - }, - "/specs/{id}": { - "get": { - "security": [], - "description": "Returns single spec resource embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Return a single spec resource", - "operationId": "detailSpec", - "responses": { - "200": { - "description": "A single specification", - "schema": { - "$ref": "#/definitions/detailSpecEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs/{id}/spec": { - "get": { - "security": [], - "description": "Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc).", - "produces": [ - "text/yaml", - "application/json" - ], - "tags": [ - "Informational" - ], - "summary": "Returns the spec's file", - "operationId": "detailSpecBody", - "responses": { - "200": { - "description": "Returns the document that represents the specification", - "schema": { - "$ref": "#/definitions/detailSpecBodyEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/version": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listVersion", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - } - }, - "definitions": { - "apiError": { - "type": "object", - "properties": { - "args": { - "$ref": "#/definitions/apiErrorArgs" - }, - "cause": { - "$ref": "#/definitions/apiErrorCause" - }, - "causeMessage": { - "type": "string" - }, - "code": { - "type": "string" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "message": { - "type": "string" - }, - "requestId": { - "type": "string" - } - } - }, - "apiErrorArgs": { - "type": "object", - "properties": { - "urlVars": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "apiErrorCause": { - "allOf": [ - { - "$ref": "#/definitions/apiFieldError" - }, - { - "$ref": "#/definitions/apiError" - } - ] - }, - "apiErrorEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/apiError" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "apiFieldError": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "value": { - "description": "can be any value - string, number, boolean, array or object" - } - } - }, - "apiSessionDetail": { - "description": "An API Session object", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "identity", - "identityId", - "configTypes", - "ipAddress", - "authQueries", - "cachedUpdatedAt", - "isMfaRequired", - "isMfaComplete", - "authenticatorId" - ], - "properties": { - "authQueries": { - "$ref": "#/definitions/authQueryList" - }, - "authenticatorId": { - "type": "string" - }, - "cachedLastActivityAt": { - "type": "string", - "format": "date-time" - }, - "configTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "ipAddress": { - "type": "string" - }, - "isMfaComplete": { - "type": "boolean" - }, - "isMfaRequired": { - "type": "boolean" - }, - "lastActivityAt": { - "type": "string", - "format": "date-time" - }, - "token": { - "type": "string" - } - } - } - ] - }, - "apiVersion": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "apiBaseUrls": { - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "attributes": { - "description": "A set of strings used to loosly couple this resource to policies", - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true, - "x-omitempty": true - }, - "authQueryDetail": { - "type": "object", - "required": [ - "provider" - ], - "properties": { - "format": { - "$ref": "#/definitions/mfaFormats" - }, - "httpMethod": { - "type": "string" - }, - "httpUrl": { - "type": "string" - }, - "maxLength": { - "type": "integer" - }, - "minLength": { - "type": "integer" - }, - "provider": { - "$ref": "#/definitions/mfaProviders" - }, - "typeId": { - "type": "string" - } - } - }, - "authQueryList": { - "type": "array", - "items": { - "$ref": "#/definitions/authQueryDetail" - } - }, - "authenticate": { - "description": "A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method.", - "type": "object", - "properties": { - "configTypes": { - "$ref": "#/definitions/configTypes" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "password": { - "$ref": "#/definitions/password" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorDetail": { - "description": "A singular authenticator resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "method", - "identityId", - "identity" - ], - "properties": { - "certPem": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "method": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - ] - }, - "authenticatorList": { - "description": "An array of authenticator resources", - "type": "array", - "items": { - "$ref": "#/definitions/authenticatorDetail" - } - }, - "authenticatorPatch": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "properties": { - "password": { - "$ref": "#/definitions/passwordNullable" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/usernameNullable" - } - } - }, - "authenticatorPatchWithCurrent": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorPatch" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "authenticatorUpdate": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "password": { - "$ref": "#/definitions/password" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorUpdateWithCurrent": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorUpdate" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "baseEntity": { - "description": "Fields shared by all Edge API entities", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "_links" - ], - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "clientExternalJwtSignerDetail": { - "description": "A External JWT Signer resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "externalAuthUrl" - ], - "properties": { - "externalAuthUrl": { - "type": "string", - "format": "url" - }, - "name": { - "type": "string", - "example": "MyApps Signer" - } - } - } - ] - }, - "clientExternalJwtSignerList": { - "description": "An array of External JWT Signers resources", - "type": "array", - "items": { - "$ref": "#/definitions/clientExternalJwtSignerDetail" - } - }, - "commonEdgeRouterProperties": { - "type": "object", - "required": [ - "hostname", - "name", - "supportedProtocols", - "syncStatus", - "isOnline", - "cost", - "noTraversal" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "hostname": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "supportedProtocols": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "syncStatus": { - "type": "string" - } - } - }, - "configTypes": { - "description": "Specific configuration types that should be returned", - "type": "array", - "items": { - "type": "string" - } - }, - "createCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateCreateResponse" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "createEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/createLocation" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "createLocation": { - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "id": { - "type": "string" - } - } - }, - "currentApiSessionCertificateCreate": { - "type": "object", - "required": [ - "csr" - ], - "properties": { - "csr": { - "type": "string" - } - } - }, - "currentApiSessionCertificateCreateResponse": { - "allOf": [ - { - "$ref": "#/definitions/createLocation" - }, - { - "type": "object", - "required": [ - "certificate" - ], - "properties": { - "cas": { - "type": "string" - }, - "certificate": { - "type": "string" - } - } - } - ] - }, - "currentApiSessionCertificateDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "subject", - "fingerprint", - "validFrom", - "validTo", - "certificate" - ], - "properties": { - "certificate": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "validFrom": { - "type": "string", - "format": "date-time" - }, - "validTo": { - "type": "string", - "format": "date-time" - } - } - } - ] - }, - "currentApiSessionCertificateList": { - "type": "array", - "items": { - "$ref": "#/definitions/currentApiSessionCertificateDetail" - } - }, - "currentApiSessionDetail": { - "description": "An API Session object for the current API session", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/apiSessionDetail" - }, - { - "type": "object", - "required": [ - "expiresAt", - "expirationSeconds" - ], - "properties": { - "expirationSeconds": { - "type": "integer" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - } - ] - }, - "currentApiSessionDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "currentApiSessionServiceUpdateList": { - "type": "object", - "required": [ - "lastChangeAt" - ], - "properties": { - "lastChangeAt": { - "type": "string", - "format": "date-time" - } - } - }, - "currentIdentityDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "currentIdentityEdgeRouterDetail": { - "description": "A detail edge router resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "$ref": "#/definitions/commonEdgeRouterProperties" - } - ] - }, - "currentIdentityEdgeRouterList": { - "description": "A list of edge router resources", - "type": "array", - "items": { - "$ref": "#/definitions/currentIdentityEdgeRouterDetail" - } - }, - "detailAuthenticatorEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authenticatorDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfa": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "isVerified" - ], - "properties": { - "isVerified": { - "type": "boolean" - }, - "provisioningUrl": { - "description": "Not provided if MFA verification has been completed", - "type": "string" - }, - "recoveryCodes": { - "description": "Not provided if MFA verification has been completed", - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/detailMfa" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfaRecoveryCodes": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "recoveryCodes" - ], - "properties": { - "recoveryCodes": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaRecoveryCodesEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/detailMfaRecoveryCodes" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServiceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSessionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecBodyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specBodyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "dialBind": { - "type": "string", - "enum": [ - "Dial", - "Bind" - ] - }, - "dialBindArray": { - "type": "array", - "items": { - "$ref": "#/definitions/dialBind" - } - }, - "empty": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "type": "object", - "example": {} - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "enrollmentCerts": { - "type": "object", - "properties": { - "ca": { - "description": "A PEM encoded set of CA certificates to trust", - "type": "string" - }, - "cert": { - "description": "A PEM encoded cert for the server", - "type": "string" - }, - "serverCert": { - "description": "A PEM encoded set of certificates to use as the servers chain", - "type": "string" - } - } - }, - "enrollmentCertsEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/enrollmentCerts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "entityRef": { - "description": "A reference to another resource and links to interact with it", - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "entity": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "envInfo": { - "description": "Environment information an authenticating client may provide", - "type": "object", - "properties": { - "arch": { - "type": "string" - }, - "os": { - "type": "string" - }, - "osRelease": { - "type": "string" - }, - "osVersion": { - "type": "string" - } - } - }, - "identityAuthenticators": { - "type": "object", - "properties": { - "cert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - } - }, - "identityDetail": { - "description": "Detail of a specific identity", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "type", - "typeId", - "isDefaultAdmin", - "isAdmin", - "authenticators", - "enrollment", - "envInfo", - "sdkInfo", - "roleAttributes", - "hasEdgeRouterConnection", - "hasApiSession", - "isMfaEnabled", - "serviceHostingPrecedences", - "serviceHostingCosts", - "defaultHostingCost", - "authPolicyId", - "externalId", - "disabled" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string" - }, - "authenticators": { - "$ref": "#/definitions/identityAuthenticators" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "disabled": { - "type": "boolean" - }, - "disabledAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "disabledUntil": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollment": { - "$ref": "#/definitions/identityEnrollments" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "hasApiSession": { - "type": "boolean" - }, - "hasEdgeRouterConnection": { - "type": "boolean" - }, - "isAdmin": { - "type": "boolean" - }, - "isDefaultAdmin": { - "type": "boolean" - }, - "isMfaEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "type": { - "$ref": "#/definitions/entityRef" - }, - "typeId": { - "type": "string" - } - } - } - ] - }, - "identityEnrollments": { - "type": "object", - "properties": { - "ott": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "ottca": { - "type": "object", - "properties": { - "ca": { - "$ref": "#/definitions/entityRef" - }, - "caId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - } - } - }, - "identityExtendCerts": { - "type": "object", - "properties": { - "ca": { - "description": "A PEM encoded set of CA certificates", - "type": "string" - }, - "clientCert": { - "description": "A PEM encoded client certificate", - "type": "string" - } - } - }, - "identityExtendEnrollmentEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/identityExtendCerts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityExtendEnrollmentRequest": { - "type": "object", - "required": [ - "clientCertCsr" - ], - "properties": { - "clientCertCsr": { - "type": "string" - } - } - }, - "identityExtendValidateEnrollmentRequest": { - "type": "object", - "required": [ - "clientCert" - ], - "properties": { - "clientCert": { - "description": "A PEM encoded client certificate previously returned after an extension request", - "type": "string" - } - } - }, - "link": { - "description": "A link to another resource", - "type": "object", - "required": [ - "href" - ], - "properties": { - "comment": { - "type": "string" - }, - "href": { - "type": "string", - "format": "uri" - }, - "method": { - "type": "string" - } - } - }, - "links": { - "description": "A map of named links", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/link" - }, - "x-omitempty": false - }, - "listAuthenticatorsEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/authenticatorList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listClientExternalJwtSignersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/clientExternalJwtSignerList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listClientTerminatorsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/terminatorClientList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCurrentApiSessionCertificatesEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCurrentApiSessionServiceUpdatesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionServiceUpdateList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCurrentIdentityEdgeRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentIdentityEdgeRouterList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listProtocols": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/protocol" - } - }, - "listProtocolsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/listProtocols" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServicesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSessionsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSpecsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listVersionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/version" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "meta": { - "type": "object", - "properties": { - "apiEnrollmentVersion": { - "type": "string" - }, - "apiVersion": { - "type": "string" - }, - "filterableFields": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": true - }, - "pagination": { - "$ref": "#/definitions/pagination" - } - } - }, - "mfaCode": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string" - } - } - }, - "mfaFormats": { - "type": "string", - "enum": [ - "numeric", - "alpha", - "alphaNumeric" - ] - }, - "mfaProviders": { - "type": "string", - "enum": [ - "ziti", - "url" - ] - }, - "osType": { - "type": "string", - "enum": [ - "Windows", - "WindowsServer", - "Android", - "iOS", - "Linux", - "macOS" - ] - }, - "pagination": { - "type": "object", - "required": [ - "limit", - "offset", - "totalCount" - ], - "properties": { - "limit": { - "type": "number", - "format": "int64" - }, - "offset": { - "type": "number", - "format": "int64" - }, - "totalCount": { - "type": "number", - "format": "int64" - } - } - }, - "password": { - "type": "string", - "maxLength": 100, - "minLength": 5 - }, - "passwordNullable": { - "type": "string", - "maxLength": 100, - "minLength": 5, - "x-nullable": true - }, - "postureCheckType": { - "type": "string", - "enum": [ - "OS", - "PROCESS", - "DOMAIN", - "MAC", - "MFA", - "PROCESS_MULTI" - ] - }, - "postureQueries": { - "type": "object", - "required": [ - "policyId", - "isPassing", - "postureQueries" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "policyId": { - "type": "string" - }, - "policyType": { - "$ref": "#/definitions/dialBind" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQuery" - } - } - } - }, - "postureQuery": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "queryType", - "isPassing", - "timeout", - "timeoutRemaining" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "process": { - "$ref": "#/definitions/postureQueryProcess" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueryProcess" - } - }, - "queryType": { - "$ref": "#/definitions/postureCheckType" - }, - "timeout": { - "type": "integer" - }, - "timeoutRemaining": { - "type": "integer" - } - } - } - ] - }, - "postureQueryProcess": { - "type": "object", - "properties": { - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - } - } - }, - "postureResponse": { - "type": "object", - "required": [ - "services" - ], - "properties": { - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/postureResponseService" - } - } - } - }, - "postureResponseCreate": { - "type": "object", - "required": [ - "id", - "typeId" - ], - "properties": { - "id": { - "type": "string" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureResponseDomainCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "domain" - ], - "properties": { - "domain": { - "type": "string" - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureResponseEndpointStateCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "properties": { - "unlocked": { - "type": "boolean" - }, - "woken": { - "type": "boolean" - } - } - } - ], - "x-class": "ENDPOINT_STATE" - }, - "postureResponseEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureResponse" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "postureResponseMacAddressCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureResponseOperatingSystemCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "type", - "version" - ], - "properties": { - "build": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - ], - "x-class": "OS" - }, - "postureResponseProcessCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "hash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "PROCESS" - }, - "postureResponseService": { - "type": "object", - "required": [ - "id", - "name", - "postureQueryType", - "timeout", - "timeoutRemaining" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "postureQueryType": { - "type": "string" - }, - "timeout": { - "type": "integer" - }, - "timeoutRemaining": { - "type": "integer" - } - } - }, - "protocol": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "type": "string" - } - } - }, - "routerExtendEnrollmentRequest": { - "type": "object", - "required": [ - "serverCertCsr", - "certCsr" - ], - "properties": { - "certCsr": { - "type": "string" - }, - "serverCertCsr": { - "type": "string" - } - } - }, - "sdkInfo": { - "description": "SDK information an authenticating client may provide", - "type": "object", - "properties": { - "appId": { - "type": "string" - }, - "appVersion": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "serviceDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "terminatorStrategy", - "roleAttributes", - "permissions", - "configs", - "config", - "encryptionRequired", - "postureQueries" - ], - "properties": { - "config": { - "description": "map of config data for this service keyed by the config type name. Only configs of the types requested will be returned.", - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/dialBindArray" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueries" - } - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "terminatorStrategy": { - "type": "string" - } - } - } - ] - }, - "serviceList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceDetail" - } - }, - "servicePatch": { - "type": "object", - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "serviceUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "sessionCreate": { - "type": "object", - "properties": { - "serviceId": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "sessionCreateEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/sessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "sessionDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "type", - "apiSessionId", - "apiSession", - "serviceId", - "service", - "token", - "edgeRouters", - "identityId" - ], - "properties": { - "apiSession": { - "$ref": "#/definitions/entityRef" - }, - "apiSessionId": { - "type": "string" - }, - "edgeRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionEdgeRouter" - } - }, - "identityId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - } - ] - }, - "sessionEdgeRouter": { - "allOf": [ - { - "$ref": "#/definitions/commonEdgeRouterProperties" - }, - { - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - ] - }, - "sessionList": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionDetail" - } - }, - "specBodyDetail": { - "type": "string" - }, - "specDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "specList": { - "type": "array", - "items": { - "$ref": "#/definitions/specDetail" - } - }, - "subTags": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "tags": { - "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", - "allOf": [ - { - "$ref": "#/definitions/subTags" - } - ], - "x-nullable": true - }, - "terminatorClientDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "serviceId", - "service", - "routerId", - "identity" - ], - "properties": { - "identity": { - "type": "string" - }, - "routerId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - } - } - } - ] - }, - "terminatorClientList": { - "type": "array", - "items": { - "$ref": "#/definitions/terminatorClientDetail" - } - }, - "terminatorCost": { - "type": "integer", - "maximum": 65535 - }, - "terminatorCostMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorCost" - } - }, - "terminatorPrecedence": { - "type": "string", - "enum": [ - "default", - "required", - "failed" - ] - }, - "terminatorPrecedenceMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorPrecedence" - } - }, - "username": { - "type": "string", - "maxLength": 100, - "minLength": 4 - }, - "usernameNullable": { - "type": "string", - "maxLength": 100, - "minLength": 4, - "x-nullable": true - }, - "version": { - "type": "object", - "properties": { - "apiVersions": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/apiVersion" - } - } - }, - "buildDate": { - "type": "string", - "example": "2020-02-11 16:09:08" - }, - "revision": { - "type": "string", - "example": "ea556fc18740" - }, - "runtimeVersion": { - "type": "string", - "example": "go1.13.5" - }, - "version": { - "type": "string", - "example": "v0.9.0" - } - } - } - }, - "securityDefinitions": { - "ztSession": { - "description": "An API Key that is provided post authentication", - "type": "apiKey", - "name": "zt-session", - "in": "header" - } - } -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "description": "OpenZiti Edge Client API", - "title": "Ziti Edge Client", - "contact": { - "name": "OpenZiti", - "url": "https://openziti.discourse.group", - "email": "help@openziti.org" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "0.25.5" - }, - "host": "demo.ziti.dev", - "basePath": "/edge/client/v1", - "paths": { - "/": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listRoot", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - }, - "/.well-known/est/cacerts": { - "get": { - "security": [], - "description": "This endpoint is used during enrollments to bootstrap trust between enrolling clients and the Ziti Edge API.\nThis endpoint returns a base64 encoded PKCS7 store. The content can be base64 decoded and parsed by any library\nthat supports parsing PKCS7 stores.\n", - "produces": [ - "application/pkcs7-mime" - ], - "tags": [ - "Well Known" - ], - "summary": "Get CA Cert Store", - "operationId": "listWellKnownCas", - "responses": { - "200": { - "description": "A base64 encoded PKCS7 store", - "schema": { - "type": "string", - "example": "MIIMUQYJKoZIhvcNAQcCoIIMQjCCDD4CAQExADALBgkqhkiG9w0BBwGgggwkMIIG\nBjCCA+6gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAlVTMRcw\nFQYDVQQIDA5Ob3J0aCBDYXJvbGluYTESMBAGA1UEBwwJQ2hhcmxvdHRlMRMwEQYD\nVQQKDApOZXRGb3VuZHJ5MSkwJwYDVQQLDCBOZXRGb3VuZHJ5IENlcnRpZmljYXRl\nIEF1dGhvcml0eTEbMBkGA1UEAwwSTmV0Rm91bmRyeSBSb290IENBMB4XDTE4MDUx\nODE2NTcyM1oXDTI4MDUxNTE2NTcyM1owgYsxCzAJBgNVBAYTAlVTMRcwFQYDVQQI\nDA5Ob3J0aCBDYXJvbGluYTETMBEGA1UECgwKTmV0Rm91bmRyeTEpMCcGA1UECwwg\nTmV0Rm91bmRyeSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgNVBAMMGk5ldEZv\ndW5kcnkgSW50ZXJtZWRpYXRlIENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC\nCgKCAgEAsb1EPhMUweS9WpjT7L54xAOmZqugJ6fhSrFfLUwNUy172q+ASvZTpT1z\nKIPcZpGmPB3TX2bHaAR67BbRkUR11JgWE3U8+FsGrYmPZtaKM6fg8Mh0WZ41oMYQ\nNJyQixOktrgqfybyJoT5PeT5AA7QQmd8mku2X9nkAu6gWPf2nHNc7SeQdijmyQQa\nVK3oqyaxOzWzsU/XbfMEz/ObkefUxgt5Z6jlK0xcW0Q+QgtawMKLUiuo6obWRPcl\n7Hm9Sze8XJS5pbvS5JkUszxoRZuDVHZylrlHIpA/IL+BnvS+M7SP28UWe9skrv/s\n6ACpJtuPJ1EYf5fakugOpY7i+hq7YNi//csbc49Qjn2OtttrR7JcTaHUEU1I/tQb\nQGAtNkI4pJjRVUdDawQFQlWHZD1COixNLErs2HzAI00DhLrY6SKITI/kjN0Xx010\nXdMcdfay0PLWm6RwxiRmMQFL4GNIC895NF1q6xV4W4rWgqUNlcvKpy+i1chWpRbU\nHe16ul0qh10fcESrRvAbXn5YrQJLrwbSr+85ubN8lYdNLE0qg2cIXZlUilarZZzW\nghtCe+KkUpjfRuAi/CqfSwNK3QXEfeVEK6S49mHeSekOizFIw7fmDhCz9vXwMOnb\nryRSLEJks0gIRcSDVChXheAqC98y4kcQdniNWFnqJXoqA+rrSokCAwEAAaNmMGQw\nHQYDVR0OBBYEFK8UXC/sq6dGVFAqEXHsQDzqzwuUMB8GA1UdIwQYMBaAFEHz6RRu\nOuXj2mwAzOeUinfWeivpMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQD\nAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBDAAaOE2Nbb49eOjyTNxIeOB+ZKQjJ1hUE\ngRrootAA8NYbtKW/vyxTWnNi5XOGXd4DFS9OKZ0mL/7NyLc0mbTwPH2ZT8KTPUTS\nCpo6yktZ/7TMjyAtWZiOMg2EH+6m/nlNSXk/v5fb8+JQLdZfpxoA017dHh3tc8l7\nKOskCZNwQHgF/YMXrPXUNbsGkXRuJLtpjPw5O9GvPys7p+a1aJH1WCTly9zfB6j+\nrMF+UGCPDT30sxitVlohik83j6pKLgEAP/gi8nJbILlTP7ce+gJeHR2tfDvmK91X\n6QgCF2STUFBU7/9H1/pPRRykOxQpAd8xqSgqGEyp9Ie4tysZjwoUEnG8IVJ5ykrI\nFximvnb4B+LABV9WEo08n8m1R8wEryrISi8fBPn3Pr5nuayOfFLa15CLTkZF40FN\n8ika1qNZy8bWRDwTZJQUUb7VCheRWcMwdZdNmhl3J+VZLpQ+ruW7b2ajwacHz5Nw\nBHKNcmxXb/4vHq/BnlcayHnSqT6036+OZQ+owDegcYmWV6LaM7xLErjHz2EE38M2\nYSiW5SU1zluDe+iHb6l3Gd3Fj/X1gkMWFgYh0XPMSUSyimLNYzy4THKzmWlcQNFo\nLLiIDbLrMt+vk+vBkIsNTTPXRJOFPBhmIF6uIUj+2YhzNotX/pQtqMKms3pPlmHq\ndH6biwygETCCBhYwggP+oAMCAQICCQDquKpymLJ5WzANBgkqhkiG9w0BAQsFADCB\nlzELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQH\nDAlDaGFybG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZv\ndW5kcnkgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5\nIFJvb3QgQ0EwHhcNMTgwNTE4MTY1NDQ3WhcNMzgwNTEzMTY1NDQ3WjCBlzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRIwEAYDVQQHDAlDaGFy\nbG90dGUxEzARBgNVBAoMCk5ldEZvdW5kcnkxKTAnBgNVBAsMIE5ldEZvdW5kcnkg\nQ2VydGlmaWNhdGUgQXV0aG9yaXR5MRswGQYDVQQDDBJOZXRGb3VuZHJ5IFJvb3Qg\nQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKq/Xa+749Cr3WJGYD\nDIEtNKIRnTFc6TeiRSm/O7hG2+1Nrh/dObjZJuDjsopWP8NFA/DwlNyEphYKAeSw\nHDmu+4nFd6ifoeDE2lYq6bNhLcgN+A3MlN5Phb2rnO32YYZwHXGWov+jtd2gaK0f\nWsH8CQxn6n2v7qvPMTeYFP8p4jqTZw2bvZWw+LMYTFCy541DFqQLQasMg10mXRAV\nXO7Oa9y+D1re1zLq4wS6u8ItJoKzfmvZkMvD90C/tQ4u0iJaL7GB2SE9MOPDeGVv\npnoSAIkSVmvRDUAj2x9PuukykzoL1OAWzc5Cg+5LxRmLejVE7PvPcHaTtNag2tRD\nw2vbMeFKN8NvQH1QYcaPWZe4Vl9b6DAuTaH5RN919H/F+ZHyjZybVPwC14lflneI\nKyNy8JEV/YMIbEADWnuiedzDehk2Opn+0+9Zr2X/xfjCo8iWHFbNaVnQX7wdRaOo\n783lEouncqe46FDBLBpyAuDKHQpIT3MK8rkC/1yBNxsH44vMweUZuK0u7PC9KHtm\npQfuflYGfxA34kY6WU3jzyQHetoLYjoxTqNEEjuGpwy2o1j7RaCBEFIbYlnlbhpE\nWFTaQf96z2GQ6m1U3y7JyDflHSu9Fo1JNkG3qXsjDwda/6W7NRJRgdFrhnOwrm7F\n6L9X4P1HnzU/VJL66LwPmiHVjQIDAQABo2MwYTAdBgNVHQ4EFgQUQfPpFG465ePa\nbADM55SKd9Z6K+kwHwYDVR0jBBgwFoAUQfPpFG465ePabADM55SKd9Z6K+kwDwYD\nVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIB\nACfU74aKWROaxnue8tZb5PFkEbnDRcRrKXRhnptA0vrgB4ydnYxX9hEBZD8o6PBy\n3rewvl5meSOBE6zyb4JD80lHdzHSVFIwbzsNOeEjCslv/PA/3Y+J7DCt6gPNMDeY\nuEssdqeSiMoYz2gnven4flSMKgTAJd3/SpVrn35HzXiU9MkmFVpPEMnTctOjw+Jn\ncCkG5+D9N14dxtgZ/tUfbH+GUfhyGVxRdPrX5KQqAyapMfEaMXXa8KNs7PG+sDiS\nWI+Sg9jUGtxgkfKdVNtFW+QMXyy7eT3iXPA+1r2hFAhgfIaGtBJUhxPHMhKtjbAg\nAX+6+2D3GAbaD1+lcQHhKry3hygQ3OX79FJW6zyPS0tiV/LfovHqX/3x9q5PTVBO\nwEOS2/LCc4R2M7S+HIPf4eSJ+nH4uCIdJ42WCror/mRsuL7geCksi70GHuCynP4y\nqQFszu/UtbBEsN8loTnLpOInxaGB1Y8UPm14b2Lo1/3HkoMVh0/UaHJ0TmnZ1r7m\nfGhfRyAZYRdvT1sB+Eb4b5A2zEZqsTc9IwFOhnI4ZilPoZ5s2xejqrVw3GSvovEh\ndprrQmvxuh+VQ23y/+/4z9b2xWyDu2zVveB4whqPe2rkgxJrEl4GfLk2DW+dN6j8\n3Zl4lPoUZYwzkC6raCaHyFlAoaTbqz0H6rvVJYxJPS6UoQAxAA==\n" - } - } - } - } - }, - "/authenticate": { - "post": { - "security": [], - "description": "Allows authentication Methods include \"password\" and \"cert\"\n", - "tags": [ - "Authentication" - ], - "summary": "Authenticate via a method supplied via a query string parameter", - "operationId": "authenticate", - "parameters": [ - { - "name": "auth", - "in": "body", - "schema": { - "$ref": "#/definitions/authenticate" - } - } - ], - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": [], - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "403": { - "description": "The authentication request could not be processed as the credentials are invalid", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "INVALID_AUTH", - "message": "The authentication request failed", - "requestId": "5952ed10-3091-474f-a691-47ebab6990dc" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "enum": [ - "password", - "cert", - "ext-jwt" - ], - "type": "string", - "name": "method", - "in": "query", - "required": true - } - ] - }, - "/authenticate/mfa": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA authentication by submitting a MFA time based one time token or backup code.", - "tags": [ - "Authentication", - "MFA" - ], - "summary": "Complete MFA authentication", - "operationId": "authenticateMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaAuth", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - } - } - } - }, - "/current-api-session": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves the API session that was used to issue the current request", - "tags": [ - "Current API Session" - ], - "summary": "Return the current API session", - "operationId": "getCurrentAPISession", - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": [], - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Terminates the current API session", - "tags": [ - "Current API Session" - ], - "summary": "Logout", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-api-session/certificates": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination", - "tags": [ - "Current API Session" - ], - "summary": "List the ephemeral certificates available for the current API Session", - "operationId": "listCurrentApiSessionCertificates", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of the current API Session's certificate", - "schema": { - "$ref": "#/definitions/listCurrentApiSessionCertificatesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an ephemeral certificate for the current API Session. This endpoint expects a PEM encoded CSRs to be provided for fulfillment as a property of a JSON payload. It is up to the client to manage the private key backing the CSR request.", - "tags": [ - "Current API Session" - ], - "summary": "Creates an ephemeral certificate for the current API Session", - "operationId": "createCurrentApiSessionCertificate", - "parameters": [ - { - "description": "The payload describing the CSR used to create a session certificate", - "name": "sessionCertificate", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/currentApiSessionCertificateCreate" - } - } - ], - "responses": { - "201": { - "description": "A response of a create API Session certificate", - "schema": { - "$ref": "#/definitions/createCurrentApiSessionCertificateEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-api-session/certificates/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single ephemeral certificate by id", - "tags": [ - "Current API Session" - ], - "summary": "Retrieves an ephemeral certificate", - "operationId": "detailCurrentApiSessionCertificate", - "responses": { - "200": { - "description": "A response containing a single API Session certificate", - "schema": { - "$ref": "#/definitions/detailCurrentApiSessionCertificateEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an ephemeral certificateby id\n", - "tags": [ - "Current API Session" - ], - "summary": "Delete an ephemeral certificate", - "operationId": "deleteCurrentApiSessionCertificate", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-api-session/service-updates": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate\nservice refreshes.\n", - "tags": [ - "Current API Session", - "Services" - ], - "summary": "Returns data indicating whether a client should updates it service list", - "operationId": "listServiceUpdates", - "responses": { - "200": { - "description": "Data indicating necessary service updates", - "schema": { - "$ref": "#/definitions/listCurrentApiSessionServiceUpdatesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns the identity associated with the API sessions used to issue the current request", - "tags": [ - "Current Identity" - ], - "summary": "Return the current identity", - "operationId": "getCurrentIdentity", - "responses": { - "200": { - "description": "The identity associated with the API Session used to issue the request", - "schema": { - "$ref": "#/definitions/currentIdentityDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "edge-router-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/edge-routers" - }, - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - }, - "service-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/identities" - } - }, - "authenticators": { - "updb": { - "username": "admin" - } - }, - "createdAt": "2020-01-13T16:38:13.6854788Z", - "enrollment": {}, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "isAdmin": true, - "isDefaultAdmin": true, - "name": "Default Admin", - "roleAttributes": [], - "tags": {}, - "type": { - "_links": { - "self": { - "href": "./identity-types/User" - } - }, - "id": "User", - "name": "User", - "urlName": "identity-types" - }, - "updatedAt": "2020-01-13T16:38:13.6854788Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination.", - "tags": [ - "Current API Session" - ], - "summary": "List authenticators for the current identity", - "operationId": "listCurrentIdentityAuthenticators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity.", - "tags": [ - "Current API Session" - ], - "summary": "Retrieve an authenticator for the current identity", - "operationId": "detailCurrentIdentityAuthenticator", - "responses": { - "200": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's\nidentity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update all fields on an authenticator of this identity", - "operationId": "updateCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator put object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorUpdateWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API\nsession's identity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update the supplied fields on an authenticator of this identity", - "operationId": "patchCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator patch object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorPatchWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled.\nAllows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation.\nThe response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint.\nAfter verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to recieve a new certificate associated with a certificate based authenticator", - "operationId": "extendCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "A response containg the identity's new certificate", - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend-verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt.\nAfter receipt, the new client certificate must be used for new authentication requests.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to validate reciept of a new client certificate", - "operationId": "extendVerifyCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendValidateEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Lists the Edge Routers that the current identity has access to via policies. The data returned\nincludes their address and online status\n", - "tags": [ - "Current Identity", - "Edge Router" - ], - "summary": "Return this list of Edge Routers the identity has access to", - "operationId": "getCurrentIdentityEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listCurrentIdentityEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a ` + "`" + `POST /current-identity/mfa/verify` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Returns the current status of MFA enrollment", - "operationId": "detailMfa", - "responses": { - "200": { - "description": "The details of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via ` + "`" + `POST /current-identity/mfa/verify` + "`" + `\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Initiate MFA enrollment", - "operationId": "enrollMfa", - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The identity is already enrolled in MFA", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": null, - "cause": null, - "causeMessage": "", - "code": "ALREADY_MFA_ENROLLED", - "message": "The identity is already enrolled in MFA", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via ` + "`" + `DELETE /identities/\u003cid\u003e/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Disable MFA for the current identity", - "operationId": "deleteMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/qr-code": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started.\n", - "produces": [ - "application/json", - "image/png" - ], - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Show a QR code for unverified MFA enrollments", - "operationId": "detailMfaQrCode", - "responses": { - "200": { - "description": "OK" - }, - "404": { - "description": "No MFA enrollment or MFA enrollment is completed" - } - } - } - }, - "/current-identity/mfa/recovery-codes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment view the current recovery codes", - "operationId": "detailMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment regenerate the recovery codes", - "operationId": "createMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "The recovery codes of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaRecoveryCodesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via ` + "`" + `POST /current-identity/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Complete MFA enrollment by verifying a time based one time token", - "operationId": "verifyMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/enroll": { - "post": { - "description": "endpoint defers to the logic in the more specific ` + "`" + `enroll/*` + "`" + ` endpoints", - "consumes": [ - "application/json", - "application/pkcs10", - "application/x-pem-file", - "text/plain" - ], - "produces": [ - "application/json", - "application/x-pem-file" - ], - "tags": [ - "Enroll" - ], - "summary": "Legacy enrollment endpoint", - "operationId": "enroll", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query" - } - ] - }, - "/enroll/ca": { - "post": { - "description": "For CA auto enrollment, an identity is not created beforehand.\nInstead one will be created during enrollment. The client will present a client certificate that is signed by a\nCertificate Authority that has been added and verified (See POST /cas and POST /cas/{id}/verify).\n\nDuring this process no CSRs are requires as the client should already be in possession of a valid certificate.\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity with a pre-exchanged certificate", - "operationId": "enrollCa", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/enroll/erott": { - "post": { - "description": "Enrolls an edge-router via a one-time-token to establish a certificate based identity.\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an edge-router", - "operationId": "enrollErOtt", - "responses": { - "200": { - "description": "A response containing the edge routers signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/enroll/extend/router": { - "post": { - "description": "Allows a router to extend its certificates' expiration date by\nusing its current and valid client certificate to submit a CSR. This CSR may\nbe passed in using a new private key, thus allowing private key rotation or swapping.\n\nAfter completion any new connections must be made with certificates returned from a 200 OK\nresponse. The previous client certificate is rendered invalid for use with the controller even if it\nhas not expired.\n\nThis request must be made using the existing, valid, client certificate.\n", - "tags": [ - "Enroll", - "Extend Enrollment" - ], - "summary": "Extend the life of a currently enrolled router's certificates", - "operationId": "extendRouterEnrollment", - "parameters": [ - { - "name": "routerExtendEnrollmentRequest", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerExtendEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "A response containg the edge routers new signed certificates (server chain, server cert, CAs).", - "schema": { - "$ref": "#/definitions/enrollmentCertsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/enroll/ott": { - "post": { - "description": "Enroll an identity via a one-time-token which is supplied via a query string parameter. This enrollment method\nexpects a PEM encoded CSRs to be provided for fulfillment. It is up to the enrolling identity to manage the\nprivate key backing the CSR request.\n", - "consumes": [ - "application/pkcs10" - ], - "produces": [ - "application/x-x509-user-cert" - ], - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity via one-time-token", - "operationId": "enrollOtt", - "responses": { - "200": { - "description": "A PEM encoded certificate signed by the internal Ziti CA", - "schema": { - "type": "string" - }, - "examples": { - "application/x-x509-user-cert": "-----BEGIN CERTIFICATE-----\nMIICzDCCAlGgAwIBAgIRAPkVg1jVKqnNGFpSB3lPbaIwCgYIKoZIzj0EAwIwXjEL\nMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5DMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0w\nKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkgRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwHhcN\nMTgxMTE1MTI1NzE3WhcNMTkxMTI1MTI1NzE3WjBrMQswCQYDVQQGEwJVUzELMAkG\nA1UECAwCTkMxEjAQBgNVBAcMCUNoYXJsb3R0ZTETMBEGA1UECgwKTmV0Rm91bmRy\neTEPMA0GA1UECwwGQWR2RGV2MRUwEwYDVQQDDAxaaXRpQ2xpZW50MDEwdjAQBgcq\nhkjOPQIBBgUrgQQAIgNiAATTl2ft+/K9RvDgki9gSr9udNcV2bxD4LrWEdCdXNzF\niVUiEcEte9z/M0JRt8lgo17OjFvS+ecrAmLtIZNmQnH3+9YeafjeNPpvQsMKxlTN\nMnU7Hka11GHc6swQZSyHvlKjgcUwgcIwCQYDVR0TBAIwADARBglghkgBhvhCAQEE\nBAMCBaAwMwYJYIZIAYb4QgENBCYWJE9wZW5TU0wgR2VuZXJhdGVkIENsaWVudCBD\nZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUtx+Tej6lSYdjb8Jbc2QuvoEsI/swHwYDVR0j\nBBgwFoAUcdTlRrnP43ZbQ3PGAbZMPE26+H4wDgYDVR0PAQH/BAQDAgXgMB0GA1Ud\nJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDBDAKBggqhkjOPQQDAgNpADBmAjEAuXDS\nH7KKMr+la+Yuh8d8Q9cLtXzdS0j6a8e7iOyPJmdWq2WuzNdbCfAfLgKXuxhSAjEA\nsadZrXl1OBv11RGAKdYBIyRmfYUotCFAtCNKcfgBUxci0TDaKDA7r3jnjKT1d7Fs\n-----END CERTIFICATE-----\n" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/enroll/ottca": { - "post": { - "description": "Enroll an identity via a one-time-token that also requires a pre-exchanged client certificate to match a\nCertificate Authority that has been added and verified (See POST /cas and POST /cas{id}/verify). The client\nmust present a client certificate signed by CA associated with the enrollment. This enrollment is similar to\nCA auto enrollment except that is required the identity to be pre-created.\n\nAs the client certificate has been pre-exchanged there is no CSR input to this enrollment method.\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity via one-time-token with a pre-exchanged client certificate", - "operationId": "enrollOttCa", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/enroll/updb": { - "post": { - "description": "Enrolls an identity via a one-time-token to establish an initial username and password combination\n", - "tags": [ - "Enroll" - ], - "summary": "Enroll an identity via one-time-token", - "operationId": "ernollUpdb", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "token", - "in": "query", - "required": true - } - ] - }, - "/external-jwt-signers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of external JWT signers for authentication", - "tags": [ - "External JWT Signer" - ], - "summary": "List Client Authentication External JWT", - "operationId": "listExternalJwtSigners", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of External JWT Signers", - "schema": { - "$ref": "#/definitions/listClientExternalJwtSignersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-response": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Submits posture responses", - "tags": [ - "Posture Checks" - ], - "summary": "Submit a posture response to a posture query", - "operationId": "createPostureResponse", - "parameters": [ - { - "description": "A Posture Response", - "name": "postureResponse", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureResponseCreate" - } - } - ], - "responses": { - "201": { - "description": "Contains a list of services that have had their timers altered", - "schema": { - "$ref": "#/definitions/postureResponseEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-response-bulk": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Submits posture responses", - "tags": [ - "Posture Checks" - ], - "summary": "Submit multiple posture responses", - "operationId": "createPostureResponseBulk", - "parameters": [ - { - "description": "A Posture Response", - "name": "postureResponse", - "in": "body", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/postureResponseCreate" - } - } - } - ], - "responses": { - "200": { - "description": "Contains a list of services that have had their timers altered", - "schema": { - "$ref": "#/definitions/postureResponseEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/protocols": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Return a list of the listening Edge protocols", - "operationId": "listProtocols", - "responses": { - "200": { - "description": "A list of supported Edge protocols", - "schema": { - "$ref": "#/definitions/listProtocolsEnvelope" - } - } - } - } - }, - "/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List services", - "operationId": "listServices", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/services/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Retrieves a single service", - "operationId": "detailService", - "responses": { - "200": { - "description": "A single service", - "schema": { - "$ref": "#/definitions/detailServiceEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update all fields on a service", - "operationId": "updateService", - "parameters": [ - { - "description": "A service update object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Delete a service", - "operationId": "deleteService", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update the supplied fields on a service", - "operationId": "patchService", - "parameters": [ - { - "description": "A service patch object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/terminators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination.\n", - "tags": [ - "Service" - ], - "summary": "List of terminators assigned to a service", - "operationId": "listServiceTerminators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listClientTerminatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/sessions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of active sessions resources; supports filtering, sorting, and pagination.\n\nSessions are tied to an API session and are moved when an API session times out or logs out. Active sessions\n(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active.\n", - "tags": [ - "Session" - ], - "summary": "List sessions", - "operationId": "listSessions", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of sessions", - "schema": { - "$ref": "#/definitions/listSessionsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a session resource.", - "tags": [ - "Session" - ], - "summary": "Create a session resource", - "operationId": "createSession", - "parameters": [ - { - "description": "A session to create", - "name": "session", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/sessionCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/sessionCreateEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/sessions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single session by id.", - "tags": [ - "Session" - ], - "summary": "Retrieves a single session", - "operationId": "detailSession", - "responses": { - "200": { - "description": "A single session", - "schema": { - "$ref": "#/definitions/detailSessionEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a session by id.", - "tags": [ - "Session" - ], - "summary": "Delete a session", - "operationId": "deleteSession", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs": { - "get": { - "security": [], - "description": "Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Returns a list of API specs", - "operationId": "listSpecs", - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listSpecsEnvelope" - } - } - } - } - }, - "/specs/{id}": { - "get": { - "security": [], - "description": "Returns single spec resource embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Return a single spec resource", - "operationId": "detailSpec", - "responses": { - "200": { - "description": "A single specification", - "schema": { - "$ref": "#/definitions/detailSpecEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs/{id}/spec": { - "get": { - "security": [], - "description": "Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc).", - "produces": [ - "application/json", - "text/yaml" - ], - "tags": [ - "Informational" - ], - "summary": "Returns the spec's file", - "operationId": "detailSpecBody", - "responses": { - "200": { - "description": "Returns the document that represents the specification", - "schema": { - "$ref": "#/definitions/detailSpecBodyEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/version": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listVersion", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - } - }, - "definitions": { - "IdentityAuthenticatorsCert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "IdentityAuthenticatorsUpdb": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "IdentityEnrollmentsOtt": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "IdentityEnrollmentsOttca": { - "type": "object", - "properties": { - "ca": { - "$ref": "#/definitions/entityRef" - }, - "caId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "IdentityEnrollmentsUpdb": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "apiError": { - "type": "object", - "properties": { - "args": { - "$ref": "#/definitions/apiErrorArgs" - }, - "cause": { - "$ref": "#/definitions/apiErrorCause" - }, - "causeMessage": { - "type": "string" - }, - "code": { - "type": "string" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "message": { - "type": "string" - }, - "requestId": { - "type": "string" - } - } - }, - "apiErrorArgs": { - "type": "object", - "properties": { - "urlVars": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "apiErrorCause": { - "allOf": [ - { - "$ref": "#/definitions/apiFieldError" - }, - { - "$ref": "#/definitions/apiError" - } - ] - }, - "apiErrorEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/apiError" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "apiFieldError": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "value": { - "description": "can be any value - string, number, boolean, array or object" - } - } - }, - "apiSessionDetail": { - "description": "An API Session object", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "identity", - "identityId", - "configTypes", - "ipAddress", - "authQueries", - "cachedUpdatedAt", - "isMfaRequired", - "isMfaComplete", - "authenticatorId" - ], - "properties": { - "authQueries": { - "$ref": "#/definitions/authQueryList" - }, - "authenticatorId": { - "type": "string" - }, - "cachedLastActivityAt": { - "type": "string", - "format": "date-time" - }, - "configTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "ipAddress": { - "type": "string" - }, - "isMfaComplete": { - "type": "boolean" - }, - "isMfaRequired": { - "type": "boolean" - }, - "lastActivityAt": { - "type": "string", - "format": "date-time" - }, - "token": { - "type": "string" - } - } - } - ] - }, - "apiVersion": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "apiBaseUrls": { - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "attributes": { - "description": "A set of strings used to loosly couple this resource to policies", - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true, - "x-omitempty": true - }, - "authQueryDetail": { - "type": "object", - "required": [ - "provider" - ], - "properties": { - "format": { - "$ref": "#/definitions/mfaFormats" - }, - "httpMethod": { - "type": "string" - }, - "httpUrl": { - "type": "string" - }, - "maxLength": { - "type": "integer" - }, - "minLength": { - "type": "integer" - }, - "provider": { - "$ref": "#/definitions/mfaProviders" - }, - "typeId": { - "type": "string" - } - } - }, - "authQueryList": { - "type": "array", - "items": { - "$ref": "#/definitions/authQueryDetail" - } - }, - "authenticate": { - "description": "A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method.", - "type": "object", - "properties": { - "configTypes": { - "$ref": "#/definitions/configTypes" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "password": { - "$ref": "#/definitions/password" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorDetail": { - "description": "A singular authenticator resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "method", - "identityId", - "identity" - ], - "properties": { - "certPem": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "method": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - ] - }, - "authenticatorList": { - "description": "An array of authenticator resources", - "type": "array", - "items": { - "$ref": "#/definitions/authenticatorDetail" - } - }, - "authenticatorPatch": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "properties": { - "password": { - "$ref": "#/definitions/passwordNullable" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/usernameNullable" - } - } - }, - "authenticatorPatchWithCurrent": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorPatch" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "authenticatorUpdate": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "password": { - "$ref": "#/definitions/password" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorUpdateWithCurrent": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorUpdate" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "baseEntity": { - "description": "Fields shared by all Edge API entities", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "_links" - ], - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "clientExternalJwtSignerDetail": { - "description": "A External JWT Signer resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "externalAuthUrl" - ], - "properties": { - "externalAuthUrl": { - "type": "string", - "format": "url" - }, - "name": { - "type": "string", - "example": "MyApps Signer" - } - } - } - ] - }, - "clientExternalJwtSignerList": { - "description": "An array of External JWT Signers resources", - "type": "array", - "items": { - "$ref": "#/definitions/clientExternalJwtSignerDetail" - } - }, - "commonEdgeRouterProperties": { - "type": "object", - "required": [ - "hostname", - "name", - "supportedProtocols", - "syncStatus", - "isOnline", - "cost", - "noTraversal" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "hostname": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "supportedProtocols": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "syncStatus": { - "type": "string" - } - } - }, - "configTypes": { - "description": "Specific configuration types that should be returned", - "type": "array", - "items": { - "type": "string" - } - }, - "createCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateCreateResponse" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "createEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/createLocation" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "createLocation": { - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "id": { - "type": "string" - } - } - }, - "currentApiSessionCertificateCreate": { - "type": "object", - "required": [ - "csr" - ], - "properties": { - "csr": { - "type": "string" - } - } - }, - "currentApiSessionCertificateCreateResponse": { - "allOf": [ - { - "$ref": "#/definitions/createLocation" - }, - { - "type": "object", - "required": [ - "certificate" - ], - "properties": { - "cas": { - "type": "string" - }, - "certificate": { - "type": "string" - } - } - } - ] - }, - "currentApiSessionCertificateDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "subject", - "fingerprint", - "validFrom", - "validTo", - "certificate" - ], - "properties": { - "certificate": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "subject": { - "type": "string" - }, - "validFrom": { - "type": "string", - "format": "date-time" - }, - "validTo": { - "type": "string", - "format": "date-time" - } - } - } - ] - }, - "currentApiSessionCertificateList": { - "type": "array", - "items": { - "$ref": "#/definitions/currentApiSessionCertificateDetail" - } - }, - "currentApiSessionDetail": { - "description": "An API Session object for the current API session", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/apiSessionDetail" - }, - { - "type": "object", - "required": [ - "expiresAt", - "expirationSeconds" - ], - "properties": { - "expirationSeconds": { - "type": "integer" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - } - ] - }, - "currentApiSessionDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "currentApiSessionServiceUpdateList": { - "type": "object", - "required": [ - "lastChangeAt" - ], - "properties": { - "lastChangeAt": { - "type": "string", - "format": "date-time" - } - } - }, - "currentIdentityDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "currentIdentityEdgeRouterDetail": { - "description": "A detail edge router resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "$ref": "#/definitions/commonEdgeRouterProperties" - } - ] - }, - "currentIdentityEdgeRouterList": { - "description": "A list of edge router resources", - "type": "array", - "items": { - "$ref": "#/definitions/currentIdentityEdgeRouterDetail" - } - }, - "detailAuthenticatorEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authenticatorDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailCurrentApiSessionCertificateEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfa": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "isVerified" - ], - "properties": { - "isVerified": { - "type": "boolean" - }, - "provisioningUrl": { - "description": "Not provided if MFA verification has been completed", - "type": "string" - }, - "recoveryCodes": { - "description": "Not provided if MFA verification has been completed", - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/detailMfa" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfaRecoveryCodes": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "recoveryCodes" - ], - "properties": { - "recoveryCodes": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaRecoveryCodesEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/detailMfaRecoveryCodes" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServiceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSessionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecBodyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specBodyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "dialBind": { - "type": "string", - "enum": [ - "Dial", - "Bind" - ] - }, - "dialBindArray": { - "type": "array", - "items": { - "$ref": "#/definitions/dialBind" - } - }, - "empty": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "type": "object", - "example": {} - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "enrollmentCerts": { - "type": "object", - "properties": { - "ca": { - "description": "A PEM encoded set of CA certificates to trust", - "type": "string" - }, - "cert": { - "description": "A PEM encoded cert for the server", - "type": "string" - }, - "serverCert": { - "description": "A PEM encoded set of certificates to use as the servers chain", - "type": "string" - } - } - }, - "enrollmentCertsEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/enrollmentCerts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "entityRef": { - "description": "A reference to another resource and links to interact with it", - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "entity": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "envInfo": { - "description": "Environment information an authenticating client may provide", - "type": "object", - "properties": { - "arch": { - "type": "string" - }, - "os": { - "type": "string" - }, - "osRelease": { - "type": "string" - }, - "osVersion": { - "type": "string" - } - } - }, - "identityAuthenticators": { - "type": "object", - "properties": { - "cert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - } - }, - "identityDetail": { - "description": "Detail of a specific identity", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "type", - "typeId", - "isDefaultAdmin", - "isAdmin", - "authenticators", - "enrollment", - "envInfo", - "sdkInfo", - "roleAttributes", - "hasEdgeRouterConnection", - "hasApiSession", - "isMfaEnabled", - "serviceHostingPrecedences", - "serviceHostingCosts", - "defaultHostingCost", - "authPolicyId", - "externalId", - "disabled" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string" - }, - "authenticators": { - "$ref": "#/definitions/identityAuthenticators" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "disabled": { - "type": "boolean" - }, - "disabledAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "disabledUntil": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollment": { - "$ref": "#/definitions/identityEnrollments" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "hasApiSession": { - "type": "boolean" - }, - "hasEdgeRouterConnection": { - "type": "boolean" - }, - "isAdmin": { - "type": "boolean" - }, - "isDefaultAdmin": { - "type": "boolean" - }, - "isMfaEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "type": { - "$ref": "#/definitions/entityRef" - }, - "typeId": { - "type": "string" - } - } - } - ] - }, - "identityEnrollments": { - "type": "object", - "properties": { - "ott": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "ottca": { - "type": "object", - "properties": { - "ca": { - "$ref": "#/definitions/entityRef" - }, - "caId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - } - } - }, - "identityExtendCerts": { - "type": "object", - "properties": { - "ca": { - "description": "A PEM encoded set of CA certificates", - "type": "string" - }, - "clientCert": { - "description": "A PEM encoded client certificate", - "type": "string" - } - } - }, - "identityExtendEnrollmentEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/identityExtendCerts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityExtendEnrollmentRequest": { - "type": "object", - "required": [ - "clientCertCsr" - ], - "properties": { - "clientCertCsr": { - "type": "string" - } - } - }, - "identityExtendValidateEnrollmentRequest": { - "type": "object", - "required": [ - "clientCert" - ], - "properties": { - "clientCert": { - "description": "A PEM encoded client certificate previously returned after an extension request", - "type": "string" - } - } - }, - "link": { - "description": "A link to another resource", - "type": "object", - "required": [ - "href" - ], - "properties": { - "comment": { - "type": "string" - }, - "href": { - "type": "string", - "format": "uri" - }, - "method": { - "type": "string" - } - } - }, - "links": { - "description": "A map of named links", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/link" - }, - "x-omitempty": false - }, - "listAuthenticatorsEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/authenticatorList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listClientExternalJwtSignersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/clientExternalJwtSignerList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listClientTerminatorsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/terminatorClientList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCurrentApiSessionCertificatesEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionCertificateList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCurrentApiSessionServiceUpdatesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionServiceUpdateList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCurrentIdentityEdgeRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentIdentityEdgeRouterList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listProtocols": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/protocol" - } - }, - "listProtocolsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/listProtocols" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServicesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSessionsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSpecsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listVersionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/version" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "meta": { - "type": "object", - "properties": { - "apiEnrollmentVersion": { - "type": "string" - }, - "apiVersion": { - "type": "string" - }, - "filterableFields": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": true - }, - "pagination": { - "$ref": "#/definitions/pagination" - } - } - }, - "mfaCode": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string" - } - } - }, - "mfaFormats": { - "type": "string", - "enum": [ - "numeric", - "alpha", - "alphaNumeric" - ] - }, - "mfaProviders": { - "type": "string", - "enum": [ - "ziti", - "url" - ] - }, - "osType": { - "type": "string", - "enum": [ - "Windows", - "WindowsServer", - "Android", - "iOS", - "Linux", - "macOS" - ] - }, - "pagination": { - "type": "object", - "required": [ - "limit", - "offset", - "totalCount" - ], - "properties": { - "limit": { - "type": "number", - "format": "int64" - }, - "offset": { - "type": "number", - "format": "int64" - }, - "totalCount": { - "type": "number", - "format": "int64" - } - } - }, - "password": { - "type": "string", - "maxLength": 100, - "minLength": 5 - }, - "passwordNullable": { - "type": "string", - "maxLength": 100, - "minLength": 5, - "x-nullable": true - }, - "postureCheckType": { - "type": "string", - "enum": [ - "OS", - "PROCESS", - "DOMAIN", - "MAC", - "MFA", - "PROCESS_MULTI" - ] - }, - "postureQueries": { - "type": "object", - "required": [ - "policyId", - "isPassing", - "postureQueries" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "policyId": { - "type": "string" - }, - "policyType": { - "$ref": "#/definitions/dialBind" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQuery" - } - } - } - }, - "postureQuery": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "queryType", - "isPassing", - "timeout", - "timeoutRemaining" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "process": { - "$ref": "#/definitions/postureQueryProcess" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueryProcess" - } - }, - "queryType": { - "$ref": "#/definitions/postureCheckType" - }, - "timeout": { - "type": "integer" - }, - "timeoutRemaining": { - "type": "integer" - } - } - } - ] - }, - "postureQueryProcess": { - "type": "object", - "properties": { - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - } - } - }, - "postureResponse": { - "type": "object", - "required": [ - "services" - ], - "properties": { - "services": { - "type": "array", - "items": { - "$ref": "#/definitions/postureResponseService" - } - } - } - }, - "postureResponseCreate": { - "type": "object", - "required": [ - "id", - "typeId" - ], - "properties": { - "id": { - "type": "string" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureResponseDomainCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "domain" - ], - "properties": { - "domain": { - "type": "string" - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureResponseEndpointStateCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "properties": { - "unlocked": { - "type": "boolean" - }, - "woken": { - "type": "boolean" - } - } - } - ], - "x-class": "ENDPOINT_STATE" - }, - "postureResponseEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureResponse" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "postureResponseMacAddressCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureResponseOperatingSystemCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "type", - "version" - ], - "properties": { - "build": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - ], - "x-class": "OS" - }, - "postureResponseProcessCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureResponseCreate" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "hash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "PROCESS" - }, - "postureResponseService": { - "type": "object", - "required": [ - "id", - "name", - "postureQueryType", - "timeout", - "timeoutRemaining" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "postureQueryType": { - "type": "string" - }, - "timeout": { - "type": "integer" - }, - "timeoutRemaining": { - "type": "integer" - } - } - }, - "protocol": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "type": "string" - } - } - }, - "routerExtendEnrollmentRequest": { - "type": "object", - "required": [ - "serverCertCsr", - "certCsr" - ], - "properties": { - "certCsr": { - "type": "string" - }, - "serverCertCsr": { - "type": "string" - } - } - }, - "sdkInfo": { - "description": "SDK information an authenticating client may provide", - "type": "object", - "properties": { - "appId": { - "type": "string" - }, - "appVersion": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "serviceDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "terminatorStrategy", - "roleAttributes", - "permissions", - "configs", - "config", - "encryptionRequired", - "postureQueries" - ], - "properties": { - "config": { - "description": "map of config data for this service keyed by the config type name. Only configs of the types requested will be returned.", - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/dialBindArray" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueries" - } - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "terminatorStrategy": { - "type": "string" - } - } - } - ] - }, - "serviceList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceDetail" - } - }, - "servicePatch": { - "type": "object", - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "serviceUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "sessionCreate": { - "type": "object", - "properties": { - "serviceId": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "sessionCreateEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/sessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "sessionDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "type", - "apiSessionId", - "apiSession", - "serviceId", - "service", - "token", - "edgeRouters", - "identityId" - ], - "properties": { - "apiSession": { - "$ref": "#/definitions/entityRef" - }, - "apiSessionId": { - "type": "string" - }, - "edgeRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionEdgeRouter" - } - }, - "identityId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - } - ] - }, - "sessionEdgeRouter": { - "allOf": [ - { - "$ref": "#/definitions/commonEdgeRouterProperties" - }, - { - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - ] - }, - "sessionList": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionDetail" - } - }, - "specBodyDetail": { - "type": "string" - }, - "specDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "specList": { - "type": "array", - "items": { - "$ref": "#/definitions/specDetail" - } - }, - "subTags": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "tags": { - "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", - "allOf": [ - { - "$ref": "#/definitions/subTags" - } - ], - "x-nullable": true - }, - "terminatorClientDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "serviceId", - "service", - "routerId", - "identity" - ], - "properties": { - "identity": { - "type": "string" - }, - "routerId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - } - } - } - ] - }, - "terminatorClientList": { - "type": "array", - "items": { - "$ref": "#/definitions/terminatorClientDetail" - } - }, - "terminatorCost": { - "type": "integer", - "maximum": 65535, - "minimum": 0 - }, - "terminatorCostMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorCost" - } - }, - "terminatorPrecedence": { - "type": "string", - "enum": [ - "default", - "required", - "failed" - ] - }, - "terminatorPrecedenceMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorPrecedence" - } - }, - "username": { - "type": "string", - "maxLength": 100, - "minLength": 4 - }, - "usernameNullable": { - "type": "string", - "maxLength": 100, - "minLength": 4, - "x-nullable": true - }, - "version": { - "type": "object", - "properties": { - "apiVersions": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/apiVersion" - } - } - }, - "buildDate": { - "type": "string", - "example": "2020-02-11 16:09:08" - }, - "revision": { - "type": "string", - "example": "ea556fc18740" - }, - "runtimeVersion": { - "type": "string", - "example": "go1.13.5" - }, - "version": { - "type": "string", - "example": "v0.9.0" - } - } - } - }, - "securityDefinitions": { - "ztSession": { - "description": "An API Key that is provided post authentication", - "type": "apiKey", - "name": "zt-session", - "in": "header" - } - } -}`)) -} diff --git a/rest_client_api_server/operations/authentication/authenticate.go b/rest_client_api_server/operations/authentication/authenticate.go deleted file mode 100644 index b70656d3a..000000000 --- a/rest_client_api_server/operations/authentication/authenticate.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AuthenticateHandlerFunc turns a function with the right signature into a authenticate handler -type AuthenticateHandlerFunc func(AuthenticateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn AuthenticateHandlerFunc) Handle(params AuthenticateParams) middleware.Responder { - return fn(params) -} - -// AuthenticateHandler interface for that can handle valid authenticate params -type AuthenticateHandler interface { - Handle(AuthenticateParams) middleware.Responder -} - -// NewAuthenticate creates a new http.Handler for the authenticate operation -func NewAuthenticate(ctx *middleware.Context, handler AuthenticateHandler) *Authenticate { - return &Authenticate{Context: ctx, Handler: handler} -} - -/* Authenticate swagger:route POST /authenticate Authentication authenticate - -Authenticate via a method supplied via a query string parameter - -Allows authentication Methods include "password" and "cert" - - -*/ -type Authenticate struct { - Context *middleware.Context - Handler AuthenticateHandler -} - -func (o *Authenticate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAuthenticateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/authentication/authenticate_mfa.go b/rest_client_api_server/operations/authentication/authenticate_mfa.go deleted file mode 100644 index eb0b9df71..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_mfa.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AuthenticateMfaHandlerFunc turns a function with the right signature into a authenticate mfa handler -type AuthenticateMfaHandlerFunc func(AuthenticateMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn AuthenticateMfaHandlerFunc) Handle(params AuthenticateMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// AuthenticateMfaHandler interface for that can handle valid authenticate mfa params -type AuthenticateMfaHandler interface { - Handle(AuthenticateMfaParams, interface{}) middleware.Responder -} - -// NewAuthenticateMfa creates a new http.Handler for the authenticate mfa operation -func NewAuthenticateMfa(ctx *middleware.Context, handler AuthenticateMfaHandler) *AuthenticateMfa { - return &AuthenticateMfa{Context: ctx, Handler: handler} -} - -/* AuthenticateMfa swagger:route POST /authenticate/mfa Authentication MFA authenticateMfa - -Complete MFA authentication - -Completes MFA authentication by submitting a MFA time based one time token or backup code. - -*/ -type AuthenticateMfa struct { - Context *middleware.Context - Handler AuthenticateMfaHandler -} - -func (o *AuthenticateMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAuthenticateMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/authentication/authenticate_mfa_parameters.go b/rest_client_api_server/operations/authentication/authenticate_mfa_parameters.go deleted file mode 100644 index 42573b8a5..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_mfa_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateMfaParams creates a new AuthenticateMfaParams object -// -// There are no default values defined in the spec. -func NewAuthenticateMfaParams() AuthenticateMfaParams { - - return AuthenticateMfaParams{} -} - -// AuthenticateMfaParams contains all the bound params for the authenticate mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters authenticateMfa -type AuthenticateMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An MFA validation request - Required: true - In: body - */ - MfaAuth *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAuthenticateMfaParams() beforehand. -func (o *AuthenticateMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("mfaAuth", "body", "")) - } else { - res = append(res, errors.NewParseError("mfaAuth", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaAuth = &body - } - } - } else { - res = append(res, errors.Required("mfaAuth", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/authentication/authenticate_mfa_responses.go b/rest_client_api_server/operations/authentication/authenticate_mfa_responses.go deleted file mode 100644 index 4c793e357..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_mfa_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateMfaOKCode is the HTTP code returned for type AuthenticateMfaOK -const AuthenticateMfaOKCode int = 200 - -/*AuthenticateMfaOK Base empty response - -swagger:response authenticateMfaOK -*/ -type AuthenticateMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewAuthenticateMfaOK creates AuthenticateMfaOK with default headers values -func NewAuthenticateMfaOK() *AuthenticateMfaOK { - - return &AuthenticateMfaOK{} -} - -// WithPayload adds the payload to the authenticate mfa o k response -func (o *AuthenticateMfaOK) WithPayload(payload *rest_model.Empty) *AuthenticateMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate mfa o k response -func (o *AuthenticateMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AuthenticateMfaUnauthorizedCode is the HTTP code returned for type AuthenticateMfaUnauthorized -const AuthenticateMfaUnauthorizedCode int = 401 - -/*AuthenticateMfaUnauthorized Base empty response - -swagger:response authenticateMfaUnauthorized -*/ -type AuthenticateMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewAuthenticateMfaUnauthorized creates AuthenticateMfaUnauthorized with default headers values -func NewAuthenticateMfaUnauthorized() *AuthenticateMfaUnauthorized { - - return &AuthenticateMfaUnauthorized{} -} - -// WithPayload adds the payload to the authenticate mfa unauthorized response -func (o *AuthenticateMfaUnauthorized) WithPayload(payload *rest_model.Empty) *AuthenticateMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate mfa unauthorized response -func (o *AuthenticateMfaUnauthorized) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/authentication/authenticate_mfa_urlbuilder.go b/rest_client_api_server/operations/authentication/authenticate_mfa_urlbuilder.go deleted file mode 100644 index 0af32085c..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// AuthenticateMfaURL generates an URL for the authenticate mfa operation -type AuthenticateMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateMfaURL) WithBasePath(bp string) *AuthenticateMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AuthenticateMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticate/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AuthenticateMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AuthenticateMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AuthenticateMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AuthenticateMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AuthenticateMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AuthenticateMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/authentication/authenticate_parameters.go b/rest_client_api_server/operations/authentication/authenticate_parameters.go deleted file mode 100644 index 65d3ccecd..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateParams creates a new AuthenticateParams object -// -// There are no default values defined in the spec. -func NewAuthenticateParams() AuthenticateParams { - - return AuthenticateParams{} -} - -// AuthenticateParams contains all the bound params for the authenticate operation -// typically these are obtained from a http.Request -// -// swagger:parameters authenticate -type AuthenticateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Auth *rest_model.Authenticate - /* - Required: true - In: query - */ - Method string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAuthenticateParams() beforehand. -func (o *AuthenticateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.Authenticate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("auth", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Auth = &body - } - } - } - - qMethod, qhkMethod, _ := qs.GetOK("method") - if err := o.bindMethod(qMethod, qhkMethod, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMethod binds and validates parameter Method from query. -func (o *AuthenticateParams) bindMethod(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("method", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("method", "query", raw); err != nil { - return err - } - o.Method = raw - - if err := o.validateMethod(formats); err != nil { - return err - } - - return nil -} - -// validateMethod carries on validations for parameter Method -func (o *AuthenticateParams) validateMethod(formats strfmt.Registry) error { - - if err := validate.EnumCase("method", "query", o.Method, []interface{}{"password", "cert", "ext-jwt"}, true); err != nil { - return err - } - - return nil -} diff --git a/rest_client_api_server/operations/authentication/authenticate_responses.go b/rest_client_api_server/operations/authentication/authenticate_responses.go deleted file mode 100644 index b9b0c2478..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateOKCode is the HTTP code returned for type AuthenticateOK -const AuthenticateOKCode int = 200 - -/*AuthenticateOK The API session associated with the session used to issue the request - -swagger:response authenticateOK -*/ -type AuthenticateOK struct { - - /* - In: Body - */ - Payload *rest_model.CurrentAPISessionDetailEnvelope `json:"body,omitempty"` -} - -// NewAuthenticateOK creates AuthenticateOK with default headers values -func NewAuthenticateOK() *AuthenticateOK { - - return &AuthenticateOK{} -} - -// WithPayload adds the payload to the authenticate o k response -func (o *AuthenticateOK) WithPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) *AuthenticateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate o k response -func (o *AuthenticateOK) SetPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AuthenticateBadRequestCode is the HTTP code returned for type AuthenticateBadRequest -const AuthenticateBadRequestCode int = 400 - -/*AuthenticateBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response authenticateBadRequest -*/ -type AuthenticateBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAuthenticateBadRequest creates AuthenticateBadRequest with default headers values -func NewAuthenticateBadRequest() *AuthenticateBadRequest { - - return &AuthenticateBadRequest{} -} - -// WithPayload adds the payload to the authenticate bad request response -func (o *AuthenticateBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate bad request response -func (o *AuthenticateBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AuthenticateForbiddenCode is the HTTP code returned for type AuthenticateForbidden -const AuthenticateForbiddenCode int = 403 - -/*AuthenticateForbidden The authentication request could not be processed as the credentials are invalid - -swagger:response authenticateForbidden -*/ -type AuthenticateForbidden struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAuthenticateForbidden creates AuthenticateForbidden with default headers values -func NewAuthenticateForbidden() *AuthenticateForbidden { - - return &AuthenticateForbidden{} -} - -// WithPayload adds the payload to the authenticate forbidden response -func (o *AuthenticateForbidden) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate forbidden response -func (o *AuthenticateForbidden) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/authentication/authenticate_urlbuilder.go b/rest_client_api_server/operations/authentication/authenticate_urlbuilder.go deleted file mode 100644 index a0293edb9..000000000 --- a/rest_client_api_server/operations/authentication/authenticate_urlbuilder.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// AuthenticateURL generates an URL for the authenticate operation -type AuthenticateURL struct { - Method string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateURL) WithBasePath(bp string) *AuthenticateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AuthenticateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticate" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - methodQ := o.Method - if methodQ != "" { - qs.Set("method", methodQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AuthenticateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AuthenticateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AuthenticateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AuthenticateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AuthenticateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AuthenticateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate.go b/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate.go deleted file mode 100644 index 68473c3f4..000000000 --- a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateCurrentAPISessionCertificateHandlerFunc turns a function with the right signature into a create current Api session certificate handler -type CreateCurrentAPISessionCertificateHandlerFunc func(CreateCurrentAPISessionCertificateParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateCurrentAPISessionCertificateHandlerFunc) Handle(params CreateCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateCurrentAPISessionCertificateHandler interface for that can handle valid create current Api session certificate params -type CreateCurrentAPISessionCertificateHandler interface { - Handle(CreateCurrentAPISessionCertificateParams, interface{}) middleware.Responder -} - -// NewCreateCurrentAPISessionCertificate creates a new http.Handler for the create current Api session certificate operation -func NewCreateCurrentAPISessionCertificate(ctx *middleware.Context, handler CreateCurrentAPISessionCertificateHandler) *CreateCurrentAPISessionCertificate { - return &CreateCurrentAPISessionCertificate{Context: ctx, Handler: handler} -} - -/* CreateCurrentAPISessionCertificate swagger:route POST /current-api-session/certificates Current API Session createCurrentApiSessionCertificate - -Creates an ephemeral certificate for the current API Session - -Creates an ephemeral certificate for the current API Session. This endpoint expects a PEM encoded CSRs to be provided for fulfillment as a property of a JSON payload. It is up to the client to manage the private key backing the CSR request. - -*/ -type CreateCurrentAPISessionCertificate struct { - Context *middleware.Context - Handler CreateCurrentAPISessionCertificateHandler -} - -func (o *CreateCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateCurrentAPISessionCertificateParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_parameters.go b/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_parameters.go deleted file mode 100644 index 78e429f54..000000000 --- a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateCurrentAPISessionCertificateParams creates a new CreateCurrentAPISessionCertificateParams object -// -// There are no default values defined in the spec. -func NewCreateCurrentAPISessionCertificateParams() CreateCurrentAPISessionCertificateParams { - - return CreateCurrentAPISessionCertificateParams{} -} - -// CreateCurrentAPISessionCertificateParams contains all the bound params for the create current Api session certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters createCurrentApiSessionCertificate -type CreateCurrentAPISessionCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The payload describing the CSR used to create a session certificate - Required: true - In: body - */ - SessionCertificate *rest_model.CurrentAPISessionCertificateCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateCurrentAPISessionCertificateParams() beforehand. -func (o *CreateCurrentAPISessionCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.CurrentAPISessionCertificateCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("sessionCertificate", "body", "")) - } else { - res = append(res, errors.NewParseError("sessionCertificate", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.SessionCertificate = &body - } - } - } else { - res = append(res, errors.Required("sessionCertificate", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_responses.go b/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_responses.go deleted file mode 100644 index d7ab1965c..000000000 --- a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateCurrentAPISessionCertificateCreatedCode is the HTTP code returned for type CreateCurrentAPISessionCertificateCreated -const CreateCurrentAPISessionCertificateCreatedCode int = 201 - -/*CreateCurrentAPISessionCertificateCreated A response of a create API Session certificate - -swagger:response createCurrentApiSessionCertificateCreated -*/ -type CreateCurrentAPISessionCertificateCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateCurrentAPISessionCertificateEnvelope `json:"body,omitempty"` -} - -// NewCreateCurrentAPISessionCertificateCreated creates CreateCurrentAPISessionCertificateCreated with default headers values -func NewCreateCurrentAPISessionCertificateCreated() *CreateCurrentAPISessionCertificateCreated { - - return &CreateCurrentAPISessionCertificateCreated{} -} - -// WithPayload adds the payload to the create current Api session certificate created response -func (o *CreateCurrentAPISessionCertificateCreated) WithPayload(payload *rest_model.CreateCurrentAPISessionCertificateEnvelope) *CreateCurrentAPISessionCertificateCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create current Api session certificate created response -func (o *CreateCurrentAPISessionCertificateCreated) SetPayload(payload *rest_model.CreateCurrentAPISessionCertificateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCurrentAPISessionCertificateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCurrentAPISessionCertificateBadRequestCode is the HTTP code returned for type CreateCurrentAPISessionCertificateBadRequest -const CreateCurrentAPISessionCertificateBadRequestCode int = 400 - -/*CreateCurrentAPISessionCertificateBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createCurrentApiSessionCertificateBadRequest -*/ -type CreateCurrentAPISessionCertificateBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateCurrentAPISessionCertificateBadRequest creates CreateCurrentAPISessionCertificateBadRequest with default headers values -func NewCreateCurrentAPISessionCertificateBadRequest() *CreateCurrentAPISessionCertificateBadRequest { - - return &CreateCurrentAPISessionCertificateBadRequest{} -} - -// WithPayload adds the payload to the create current Api session certificate bad request response -func (o *CreateCurrentAPISessionCertificateBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateCurrentAPISessionCertificateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create current Api session certificate bad request response -func (o *CreateCurrentAPISessionCertificateBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCurrentAPISessionCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCurrentAPISessionCertificateUnauthorizedCode is the HTTP code returned for type CreateCurrentAPISessionCertificateUnauthorized -const CreateCurrentAPISessionCertificateUnauthorizedCode int = 401 - -/*CreateCurrentAPISessionCertificateUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createCurrentApiSessionCertificateUnauthorized -*/ -type CreateCurrentAPISessionCertificateUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateCurrentAPISessionCertificateUnauthorized creates CreateCurrentAPISessionCertificateUnauthorized with default headers values -func NewCreateCurrentAPISessionCertificateUnauthorized() *CreateCurrentAPISessionCertificateUnauthorized { - - return &CreateCurrentAPISessionCertificateUnauthorized{} -} - -// WithPayload adds the payload to the create current Api session certificate unauthorized response -func (o *CreateCurrentAPISessionCertificateUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateCurrentAPISessionCertificateUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create current Api session certificate unauthorized response -func (o *CreateCurrentAPISessionCertificateUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCurrentAPISessionCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_urlbuilder.go b/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_urlbuilder.go deleted file mode 100644 index a3ad5608e..000000000 --- a/rest_client_api_server/operations/current_api_session/create_current_api_session_certificate_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateCurrentAPISessionCertificateURL generates an URL for the create current Api session certificate operation -type CreateCurrentAPISessionCertificateURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCurrentAPISessionCertificateURL) WithBasePath(bp string) *CreateCurrentAPISessionCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCurrentAPISessionCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateCurrentAPISessionCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session/certificates" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateCurrentAPISessionCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateCurrentAPISessionCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateCurrentAPISessionCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateCurrentAPISessionCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateCurrentAPISessionCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateCurrentAPISessionCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session.go deleted file mode 100644 index 82483fb71..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteCurrentAPISessionHandlerFunc turns a function with the right signature into a delete current API session handler -type DeleteCurrentAPISessionHandlerFunc func(DeleteCurrentAPISessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteCurrentAPISessionHandlerFunc) Handle(params DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteCurrentAPISessionHandler interface for that can handle valid delete current API session params -type DeleteCurrentAPISessionHandler interface { - Handle(DeleteCurrentAPISessionParams, interface{}) middleware.Responder -} - -// NewDeleteCurrentAPISession creates a new http.Handler for the delete current API session operation -func NewDeleteCurrentAPISession(ctx *middleware.Context, handler DeleteCurrentAPISessionHandler) *DeleteCurrentAPISession { - return &DeleteCurrentAPISession{Context: ctx, Handler: handler} -} - -/* DeleteCurrentAPISession swagger:route DELETE /current-api-session Current API Session deleteCurrentApiSession - -Logout - -Terminates the current API session - -*/ -type DeleteCurrentAPISession struct { - Context *middleware.Context - Handler DeleteCurrentAPISessionHandler -} - -func (o *DeleteCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteCurrentAPISessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate.go deleted file mode 100644 index 22acf16f2..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteCurrentAPISessionCertificateHandlerFunc turns a function with the right signature into a delete current Api session certificate handler -type DeleteCurrentAPISessionCertificateHandlerFunc func(DeleteCurrentAPISessionCertificateParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteCurrentAPISessionCertificateHandlerFunc) Handle(params DeleteCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteCurrentAPISessionCertificateHandler interface for that can handle valid delete current Api session certificate params -type DeleteCurrentAPISessionCertificateHandler interface { - Handle(DeleteCurrentAPISessionCertificateParams, interface{}) middleware.Responder -} - -// NewDeleteCurrentAPISessionCertificate creates a new http.Handler for the delete current Api session certificate operation -func NewDeleteCurrentAPISessionCertificate(ctx *middleware.Context, handler DeleteCurrentAPISessionCertificateHandler) *DeleteCurrentAPISessionCertificate { - return &DeleteCurrentAPISessionCertificate{Context: ctx, Handler: handler} -} - -/* DeleteCurrentAPISessionCertificate swagger:route DELETE /current-api-session/certificates/{id} Current API Session deleteCurrentApiSessionCertificate - -Delete an ephemeral certificate - -Delete an ephemeral certificateby id - - -*/ -type DeleteCurrentAPISessionCertificate struct { - Context *middleware.Context - Handler DeleteCurrentAPISessionCertificateHandler -} - -func (o *DeleteCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteCurrentAPISessionCertificateParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_parameters.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_parameters.go deleted file mode 100644 index b521cefa8..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCurrentAPISessionCertificateParams creates a new DeleteCurrentAPISessionCertificateParams object -// -// There are no default values defined in the spec. -func NewDeleteCurrentAPISessionCertificateParams() DeleteCurrentAPISessionCertificateParams { - - return DeleteCurrentAPISessionCertificateParams{} -} - -// DeleteCurrentAPISessionCertificateParams contains all the bound params for the delete current Api session certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteCurrentApiSessionCertificate -type DeleteCurrentAPISessionCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteCurrentAPISessionCertificateParams() beforehand. -func (o *DeleteCurrentAPISessionCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteCurrentAPISessionCertificateParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_responses.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_responses.go deleted file mode 100644 index 0dec62311..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCurrentAPISessionCertificateOKCode is the HTTP code returned for type DeleteCurrentAPISessionCertificateOK -const DeleteCurrentAPISessionCertificateOKCode int = 200 - -/*DeleteCurrentAPISessionCertificateOK The delete request was successful and the resource has been removed - -swagger:response deleteCurrentApiSessionCertificateOK -*/ -type DeleteCurrentAPISessionCertificateOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionCertificateOK creates DeleteCurrentAPISessionCertificateOK with default headers values -func NewDeleteCurrentAPISessionCertificateOK() *DeleteCurrentAPISessionCertificateOK { - - return &DeleteCurrentAPISessionCertificateOK{} -} - -// WithPayload adds the payload to the delete current Api session certificate o k response -func (o *DeleteCurrentAPISessionCertificateOK) WithPayload(payload *rest_model.Empty) *DeleteCurrentAPISessionCertificateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session certificate o k response -func (o *DeleteCurrentAPISessionCertificateOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCurrentAPISessionCertificateBadRequestCode is the HTTP code returned for type DeleteCurrentAPISessionCertificateBadRequest -const DeleteCurrentAPISessionCertificateBadRequestCode int = 400 - -/*DeleteCurrentAPISessionCertificateBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteCurrentApiSessionCertificateBadRequest -*/ -type DeleteCurrentAPISessionCertificateBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionCertificateBadRequest creates DeleteCurrentAPISessionCertificateBadRequest with default headers values -func NewDeleteCurrentAPISessionCertificateBadRequest() *DeleteCurrentAPISessionCertificateBadRequest { - - return &DeleteCurrentAPISessionCertificateBadRequest{} -} - -// WithPayload adds the payload to the delete current Api session certificate bad request response -func (o *DeleteCurrentAPISessionCertificateBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteCurrentAPISessionCertificateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session certificate bad request response -func (o *DeleteCurrentAPISessionCertificateBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCurrentAPISessionCertificateUnauthorizedCode is the HTTP code returned for type DeleteCurrentAPISessionCertificateUnauthorized -const DeleteCurrentAPISessionCertificateUnauthorizedCode int = 401 - -/*DeleteCurrentAPISessionCertificateUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteCurrentApiSessionCertificateUnauthorized -*/ -type DeleteCurrentAPISessionCertificateUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionCertificateUnauthorized creates DeleteCurrentAPISessionCertificateUnauthorized with default headers values -func NewDeleteCurrentAPISessionCertificateUnauthorized() *DeleteCurrentAPISessionCertificateUnauthorized { - - return &DeleteCurrentAPISessionCertificateUnauthorized{} -} - -// WithPayload adds the payload to the delete current Api session certificate unauthorized response -func (o *DeleteCurrentAPISessionCertificateUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteCurrentAPISessionCertificateUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session certificate unauthorized response -func (o *DeleteCurrentAPISessionCertificateUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_urlbuilder.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_urlbuilder.go deleted file mode 100644 index bfb1bc24d..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_certificate_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteCurrentAPISessionCertificateURL generates an URL for the delete current Api session certificate operation -type DeleteCurrentAPISessionCertificateURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCurrentAPISessionCertificateURL) WithBasePath(bp string) *DeleteCurrentAPISessionCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCurrentAPISessionCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteCurrentAPISessionCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session/certificates/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteCurrentAPISessionCertificateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteCurrentAPISessionCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteCurrentAPISessionCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteCurrentAPISessionCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteCurrentAPISessionCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteCurrentAPISessionCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteCurrentAPISessionCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_parameters.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_parameters.go deleted file mode 100644 index b6d0efc60..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDeleteCurrentAPISessionParams creates a new DeleteCurrentAPISessionParams object -// -// There are no default values defined in the spec. -func NewDeleteCurrentAPISessionParams() DeleteCurrentAPISessionParams { - - return DeleteCurrentAPISessionParams{} -} - -// DeleteCurrentAPISessionParams contains all the bound params for the delete current API session operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteCurrentAPISession -type DeleteCurrentAPISessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteCurrentAPISessionParams() beforehand. -func (o *DeleteCurrentAPISessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_responses.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_responses.go deleted file mode 100644 index dde823955..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCurrentAPISessionOKCode is the HTTP code returned for type DeleteCurrentAPISessionOK -const DeleteCurrentAPISessionOKCode int = 200 - -/*DeleteCurrentAPISessionOK Base empty response - -swagger:response deleteCurrentApiSessionOK -*/ -type DeleteCurrentAPISessionOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionOK creates DeleteCurrentAPISessionOK with default headers values -func NewDeleteCurrentAPISessionOK() *DeleteCurrentAPISessionOK { - - return &DeleteCurrentAPISessionOK{} -} - -// WithPayload adds the payload to the delete current Api session o k response -func (o *DeleteCurrentAPISessionOK) WithPayload(payload *rest_model.Empty) *DeleteCurrentAPISessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session o k response -func (o *DeleteCurrentAPISessionOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCurrentAPISessionUnauthorizedCode is the HTTP code returned for type DeleteCurrentAPISessionUnauthorized -const DeleteCurrentAPISessionUnauthorizedCode int = 401 - -/*DeleteCurrentAPISessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteCurrentApiSessionUnauthorized -*/ -type DeleteCurrentAPISessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionUnauthorized creates DeleteCurrentAPISessionUnauthorized with default headers values -func NewDeleteCurrentAPISessionUnauthorized() *DeleteCurrentAPISessionUnauthorized { - - return &DeleteCurrentAPISessionUnauthorized{} -} - -// WithPayload adds the payload to the delete current Api session unauthorized response -func (o *DeleteCurrentAPISessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteCurrentAPISessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session unauthorized response -func (o *DeleteCurrentAPISessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go b/rest_client_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go deleted file mode 100644 index 542fcb034..000000000 --- a/rest_client_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DeleteCurrentAPISessionURL generates an URL for the delete current API session operation -type DeleteCurrentAPISessionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCurrentAPISessionURL) WithBasePath(bp string) *DeleteCurrentAPISessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCurrentAPISessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteCurrentAPISessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteCurrentAPISessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteCurrentAPISessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteCurrentAPISessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteCurrentAPISessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteCurrentAPISessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteCurrentAPISessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate.go b/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate.go deleted file mode 100644 index b13bf9cf0..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailCurrentAPISessionCertificateHandlerFunc turns a function with the right signature into a detail current Api session certificate handler -type DetailCurrentAPISessionCertificateHandlerFunc func(DetailCurrentAPISessionCertificateParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailCurrentAPISessionCertificateHandlerFunc) Handle(params DetailCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailCurrentAPISessionCertificateHandler interface for that can handle valid detail current Api session certificate params -type DetailCurrentAPISessionCertificateHandler interface { - Handle(DetailCurrentAPISessionCertificateParams, interface{}) middleware.Responder -} - -// NewDetailCurrentAPISessionCertificate creates a new http.Handler for the detail current Api session certificate operation -func NewDetailCurrentAPISessionCertificate(ctx *middleware.Context, handler DetailCurrentAPISessionCertificateHandler) *DetailCurrentAPISessionCertificate { - return &DetailCurrentAPISessionCertificate{Context: ctx, Handler: handler} -} - -/* DetailCurrentAPISessionCertificate swagger:route GET /current-api-session/certificates/{id} Current API Session detailCurrentApiSessionCertificate - -Retrieves an ephemeral certificate - -Retrieves a single ephemeral certificate by id - -*/ -type DetailCurrentAPISessionCertificate struct { - Context *middleware.Context - Handler DetailCurrentAPISessionCertificateHandler -} - -func (o *DetailCurrentAPISessionCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailCurrentAPISessionCertificateParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_parameters.go b/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_parameters.go deleted file mode 100644 index a41b14892..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailCurrentAPISessionCertificateParams creates a new DetailCurrentAPISessionCertificateParams object -// -// There are no default values defined in the spec. -func NewDetailCurrentAPISessionCertificateParams() DetailCurrentAPISessionCertificateParams { - - return DetailCurrentAPISessionCertificateParams{} -} - -// DetailCurrentAPISessionCertificateParams contains all the bound params for the detail current Api session certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailCurrentApiSessionCertificate -type DetailCurrentAPISessionCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailCurrentAPISessionCertificateParams() beforehand. -func (o *DetailCurrentAPISessionCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailCurrentAPISessionCertificateParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_responses.go b/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_responses.go deleted file mode 100644 index 3ca9f2f47..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailCurrentAPISessionCertificateOKCode is the HTTP code returned for type DetailCurrentAPISessionCertificateOK -const DetailCurrentAPISessionCertificateOKCode int = 200 - -/*DetailCurrentAPISessionCertificateOK A response containing a single API Session certificate - -swagger:response detailCurrentApiSessionCertificateOK -*/ -type DetailCurrentAPISessionCertificateOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailCurrentAPISessionCertificateEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentAPISessionCertificateOK creates DetailCurrentAPISessionCertificateOK with default headers values -func NewDetailCurrentAPISessionCertificateOK() *DetailCurrentAPISessionCertificateOK { - - return &DetailCurrentAPISessionCertificateOK{} -} - -// WithPayload adds the payload to the detail current Api session certificate o k response -func (o *DetailCurrentAPISessionCertificateOK) WithPayload(payload *rest_model.DetailCurrentAPISessionCertificateEnvelope) *DetailCurrentAPISessionCertificateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current Api session certificate o k response -func (o *DetailCurrentAPISessionCertificateOK) SetPayload(payload *rest_model.DetailCurrentAPISessionCertificateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentAPISessionCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCurrentAPISessionCertificateUnauthorizedCode is the HTTP code returned for type DetailCurrentAPISessionCertificateUnauthorized -const DetailCurrentAPISessionCertificateUnauthorizedCode int = 401 - -/*DetailCurrentAPISessionCertificateUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailCurrentApiSessionCertificateUnauthorized -*/ -type DetailCurrentAPISessionCertificateUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentAPISessionCertificateUnauthorized creates DetailCurrentAPISessionCertificateUnauthorized with default headers values -func NewDetailCurrentAPISessionCertificateUnauthorized() *DetailCurrentAPISessionCertificateUnauthorized { - - return &DetailCurrentAPISessionCertificateUnauthorized{} -} - -// WithPayload adds the payload to the detail current Api session certificate unauthorized response -func (o *DetailCurrentAPISessionCertificateUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCurrentAPISessionCertificateUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current Api session certificate unauthorized response -func (o *DetailCurrentAPISessionCertificateUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentAPISessionCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCurrentAPISessionCertificateNotFoundCode is the HTTP code returned for type DetailCurrentAPISessionCertificateNotFound -const DetailCurrentAPISessionCertificateNotFoundCode int = 404 - -/*DetailCurrentAPISessionCertificateNotFound The requested resource does not exist - -swagger:response detailCurrentApiSessionCertificateNotFound -*/ -type DetailCurrentAPISessionCertificateNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentAPISessionCertificateNotFound creates DetailCurrentAPISessionCertificateNotFound with default headers values -func NewDetailCurrentAPISessionCertificateNotFound() *DetailCurrentAPISessionCertificateNotFound { - - return &DetailCurrentAPISessionCertificateNotFound{} -} - -// WithPayload adds the payload to the detail current Api session certificate not found response -func (o *DetailCurrentAPISessionCertificateNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCurrentAPISessionCertificateNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current Api session certificate not found response -func (o *DetailCurrentAPISessionCertificateNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentAPISessionCertificateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_urlbuilder.go b/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_urlbuilder.go deleted file mode 100644 index ae23cb3b7..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_api_session_certificate_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailCurrentAPISessionCertificateURL generates an URL for the detail current Api session certificate operation -type DetailCurrentAPISessionCertificateURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCurrentAPISessionCertificateURL) WithBasePath(bp string) *DetailCurrentAPISessionCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCurrentAPISessionCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailCurrentAPISessionCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session/certificates/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailCurrentAPISessionCertificateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailCurrentAPISessionCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailCurrentAPISessionCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailCurrentAPISessionCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailCurrentAPISessionCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailCurrentAPISessionCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailCurrentAPISessionCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator.go deleted file mode 100644 index 75bdaca49..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a detail current identity authenticator handler -type DetailCurrentIdentityAuthenticatorHandlerFunc func(DetailCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailCurrentIdentityAuthenticatorHandlerFunc) Handle(params DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailCurrentIdentityAuthenticatorHandler interface for that can handle valid detail current identity authenticator params -type DetailCurrentIdentityAuthenticatorHandler interface { - Handle(DetailCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewDetailCurrentIdentityAuthenticator creates a new http.Handler for the detail current identity authenticator operation -func NewDetailCurrentIdentityAuthenticator(ctx *middleware.Context, handler DetailCurrentIdentityAuthenticatorHandler) *DetailCurrentIdentityAuthenticator { - return &DetailCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* DetailCurrentIdentityAuthenticator swagger:route GET /current-identity/authenticators/{id} Current API Session detailCurrentIdentityAuthenticator - -Retrieve an authenticator for the current identity - -Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity. - -*/ -type DetailCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler DetailCurrentIdentityAuthenticatorHandler -} - -func (o *DetailCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go b/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go deleted file mode 100644 index 130f64a5e..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailCurrentIdentityAuthenticatorParams creates a new DetailCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewDetailCurrentIdentityAuthenticatorParams() DetailCurrentIdentityAuthenticatorParams { - - return DetailCurrentIdentityAuthenticatorParams{} -} - -// DetailCurrentIdentityAuthenticatorParams contains all the bound params for the detail current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailCurrentIdentityAuthenticator -type DetailCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailCurrentIdentityAuthenticatorParams() beforehand. -func (o *DetailCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go b/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go deleted file mode 100644 index 42a0fe506..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type DetailCurrentIdentityAuthenticatorOK -const DetailCurrentIdentityAuthenticatorOKCode int = 200 - -/*DetailCurrentIdentityAuthenticatorOK A singular authenticator resource - -swagger:response detailCurrentIdentityAuthenticatorOK -*/ -type DetailCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailAuthenticatorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentIdentityAuthenticatorOK creates DetailCurrentIdentityAuthenticatorOK with default headers values -func NewDetailCurrentIdentityAuthenticatorOK() *DetailCurrentIdentityAuthenticatorOK { - - return &DetailCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the detail current identity authenticator o k response -func (o *DetailCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.DetailAuthenticatorEnvelope) *DetailCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current identity authenticator o k response -func (o *DetailCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.DetailAuthenticatorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type DetailCurrentIdentityAuthenticatorUnauthorized -const DetailCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*DetailCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailCurrentIdentityAuthenticatorUnauthorized -*/ -type DetailCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentIdentityAuthenticatorUnauthorized creates DetailCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewDetailCurrentIdentityAuthenticatorUnauthorized() *DetailCurrentIdentityAuthenticatorUnauthorized { - - return &DetailCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the detail current identity authenticator unauthorized response -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current identity authenticator unauthorized response -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCurrentIdentityAuthenticatorNotFoundCode is the HTTP code returned for type DetailCurrentIdentityAuthenticatorNotFound -const DetailCurrentIdentityAuthenticatorNotFoundCode int = 404 - -/*DetailCurrentIdentityAuthenticatorNotFound The requested resource does not exist - -swagger:response detailCurrentIdentityAuthenticatorNotFound -*/ -type DetailCurrentIdentityAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentIdentityAuthenticatorNotFound creates DetailCurrentIdentityAuthenticatorNotFound with default headers values -func NewDetailCurrentIdentityAuthenticatorNotFound() *DetailCurrentIdentityAuthenticatorNotFound { - - return &DetailCurrentIdentityAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the detail current identity authenticator not found response -func (o *DetailCurrentIdentityAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCurrentIdentityAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current identity authenticator not found response -func (o *DetailCurrentIdentityAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentIdentityAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go b/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index b68b71203..000000000 --- a/rest_client_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailCurrentIdentityAuthenticatorURL generates an URL for the detail current identity authenticator operation -type DetailCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *DetailCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator.go deleted file mode 100644 index d65c2283a..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ExtendCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a extend current identity authenticator handler -type ExtendCurrentIdentityAuthenticatorHandlerFunc func(ExtendCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ExtendCurrentIdentityAuthenticatorHandlerFunc) Handle(params ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ExtendCurrentIdentityAuthenticatorHandler interface for that can handle valid extend current identity authenticator params -type ExtendCurrentIdentityAuthenticatorHandler interface { - Handle(ExtendCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewExtendCurrentIdentityAuthenticator creates a new http.Handler for the extend current identity authenticator operation -func NewExtendCurrentIdentityAuthenticator(ctx *middleware.Context, handler ExtendCurrentIdentityAuthenticatorHandler) *ExtendCurrentIdentityAuthenticator { - return &ExtendCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* ExtendCurrentIdentityAuthenticator swagger:route POST /current-identity/authenticators/{id}/extend Current API Session Enroll Extend Enrollment extendCurrentIdentityAuthenticator - -Allows the current identity to recieve a new certificate associated with a certificate based authenticator - -This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled. -Allows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation. -The response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint. -After verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active. - -*/ -type ExtendCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler ExtendCurrentIdentityAuthenticatorHandler -} - -func (o *ExtendCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewExtendCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_parameters.go b/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_parameters.go deleted file mode 100644 index 909b29717..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendCurrentIdentityAuthenticatorParams creates a new ExtendCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewExtendCurrentIdentityAuthenticatorParams() ExtendCurrentIdentityAuthenticatorParams { - - return ExtendCurrentIdentityAuthenticatorParams{} -} - -// ExtendCurrentIdentityAuthenticatorParams contains all the bound params for the extend current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters extendCurrentIdentityAuthenticator -type ExtendCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Extend *rest_model.IdentityExtendEnrollmentRequest - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewExtendCurrentIdentityAuthenticatorParams() beforehand. -func (o *ExtendCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityExtendEnrollmentRequest - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("extend", "body", "")) - } else { - res = append(res, errors.NewParseError("extend", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Extend = &body - } - } - } else { - res = append(res, errors.Required("extend", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ExtendCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_responses.go b/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_responses.go deleted file mode 100644 index 5e9d93ab6..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ExtendCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type ExtendCurrentIdentityAuthenticatorOK -const ExtendCurrentIdentityAuthenticatorOKCode int = 200 - -/*ExtendCurrentIdentityAuthenticatorOK A response containg the identity's new certificate - -swagger:response extendCurrentIdentityAuthenticatorOK -*/ -type ExtendCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.IdentityExtendEnrollmentEnvelope `json:"body,omitempty"` -} - -// NewExtendCurrentIdentityAuthenticatorOK creates ExtendCurrentIdentityAuthenticatorOK with default headers values -func NewExtendCurrentIdentityAuthenticatorOK() *ExtendCurrentIdentityAuthenticatorOK { - - return &ExtendCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the extend current identity authenticator o k response -func (o *ExtendCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.IdentityExtendEnrollmentEnvelope) *ExtendCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend current identity authenticator o k response -func (o *ExtendCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.IdentityExtendEnrollmentEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ExtendCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type ExtendCurrentIdentityAuthenticatorUnauthorized -const ExtendCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*ExtendCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response extendCurrentIdentityAuthenticatorUnauthorized -*/ -type ExtendCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewExtendCurrentIdentityAuthenticatorUnauthorized creates ExtendCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendCurrentIdentityAuthenticatorUnauthorized() *ExtendCurrentIdentityAuthenticatorUnauthorized { - - return &ExtendCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the extend current identity authenticator unauthorized response -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ExtendCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend current identity authenticator unauthorized response -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_urlbuilder.go b/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index 1cc8d1824..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ExtendCurrentIdentityAuthenticatorURL generates an URL for the extend current identity authenticator operation -type ExtendCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *ExtendCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ExtendCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}/extend" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ExtendCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ExtendCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ExtendCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ExtendCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ExtendCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ExtendCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ExtendCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator.go deleted file mode 100644 index 7f41148ba..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a extend verify current identity authenticator handler -type ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc func(ExtendVerifyCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc) Handle(params ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ExtendVerifyCurrentIdentityAuthenticatorHandler interface for that can handle valid extend verify current identity authenticator params -type ExtendVerifyCurrentIdentityAuthenticatorHandler interface { - Handle(ExtendVerifyCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewExtendVerifyCurrentIdentityAuthenticator creates a new http.Handler for the extend verify current identity authenticator operation -func NewExtendVerifyCurrentIdentityAuthenticator(ctx *middleware.Context, handler ExtendVerifyCurrentIdentityAuthenticatorHandler) *ExtendVerifyCurrentIdentityAuthenticator { - return &ExtendVerifyCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* ExtendVerifyCurrentIdentityAuthenticator swagger:route POST /current-identity/authenticators/{id}/extend-verify Current API Session Enroll Extend Enrollment extendVerifyCurrentIdentityAuthenticator - -Allows the current identity to validate reciept of a new client certificate - -After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt. -After receipt, the new client certificate must be used for new authentication requests. - -*/ -type ExtendVerifyCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler ExtendVerifyCurrentIdentityAuthenticatorHandler -} - -func (o *ExtendVerifyCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewExtendVerifyCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_parameters.go b/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_parameters.go deleted file mode 100644 index 508eb09a3..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendVerifyCurrentIdentityAuthenticatorParams creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewExtendVerifyCurrentIdentityAuthenticatorParams() ExtendVerifyCurrentIdentityAuthenticatorParams { - - return ExtendVerifyCurrentIdentityAuthenticatorParams{} -} - -// ExtendVerifyCurrentIdentityAuthenticatorParams contains all the bound params for the extend verify current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters extendVerifyCurrentIdentityAuthenticator -type ExtendVerifyCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Extend *rest_model.IdentityExtendValidateEnrollmentRequest - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewExtendVerifyCurrentIdentityAuthenticatorParams() beforehand. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityExtendValidateEnrollmentRequest - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("extend", "body", "")) - } else { - res = append(res, errors.NewParseError("extend", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Extend = &body - } - } - } else { - res = append(res, errors.Required("extend", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_responses.go b/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_responses.go deleted file mode 100644 index d12cee7a8..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ExtendVerifyCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type ExtendVerifyCurrentIdentityAuthenticatorOK -const ExtendVerifyCurrentIdentityAuthenticatorOKCode int = 200 - -/*ExtendVerifyCurrentIdentityAuthenticatorOK Base empty response - -swagger:response extendVerifyCurrentIdentityAuthenticatorOK -*/ -type ExtendVerifyCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewExtendVerifyCurrentIdentityAuthenticatorOK creates ExtendVerifyCurrentIdentityAuthenticatorOK with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorOK() *ExtendVerifyCurrentIdentityAuthenticatorOK { - - return &ExtendVerifyCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the extend verify current identity authenticator o k response -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.Empty) *ExtendVerifyCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend verify current identity authenticator o k response -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ExtendVerifyCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type ExtendVerifyCurrentIdentityAuthenticatorUnauthorized -const ExtendVerifyCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*ExtendVerifyCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response extendVerifyCurrentIdentityAuthenticatorUnauthorized -*/ -type ExtendVerifyCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized creates ExtendVerifyCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized() *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized { - - return &ExtendVerifyCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the extend verify current identity authenticator unauthorized response -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend verify current identity authenticator unauthorized response -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_urlbuilder.go b/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index 6d0b94ce3..000000000 --- a/rest_client_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ExtendVerifyCurrentIdentityAuthenticatorURL generates an URL for the extend verify current identity authenticator operation -type ExtendVerifyCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *ExtendVerifyCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}/extend-verify" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ExtendVerifyCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ExtendVerifyCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ExtendVerifyCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/get_current_api_session.go b/rest_client_api_server/operations/current_api_session/get_current_api_session.go deleted file mode 100644 index 24caec5b0..000000000 --- a/rest_client_api_server/operations/current_api_session/get_current_api_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCurrentAPISessionHandlerFunc turns a function with the right signature into a get current API session handler -type GetCurrentAPISessionHandlerFunc func(GetCurrentAPISessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCurrentAPISessionHandlerFunc) Handle(params GetCurrentAPISessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetCurrentAPISessionHandler interface for that can handle valid get current API session params -type GetCurrentAPISessionHandler interface { - Handle(GetCurrentAPISessionParams, interface{}) middleware.Responder -} - -// NewGetCurrentAPISession creates a new http.Handler for the get current API session operation -func NewGetCurrentAPISession(ctx *middleware.Context, handler GetCurrentAPISessionHandler) *GetCurrentAPISession { - return &GetCurrentAPISession{Context: ctx, Handler: handler} -} - -/* GetCurrentAPISession swagger:route GET /current-api-session Current API Session getCurrentApiSession - -Return the current API session - -Retrieves the API session that was used to issue the current request - -*/ -type GetCurrentAPISession struct { - Context *middleware.Context - Handler GetCurrentAPISessionHandler -} - -func (o *GetCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCurrentAPISessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/get_current_api_session_parameters.go b/rest_client_api_server/operations/current_api_session/get_current_api_session_parameters.go deleted file mode 100644 index 651296d9f..000000000 --- a/rest_client_api_server/operations/current_api_session/get_current_api_session_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetCurrentAPISessionParams creates a new GetCurrentAPISessionParams object -// -// There are no default values defined in the spec. -func NewGetCurrentAPISessionParams() GetCurrentAPISessionParams { - - return GetCurrentAPISessionParams{} -} - -// GetCurrentAPISessionParams contains all the bound params for the get current API session operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCurrentAPISession -type GetCurrentAPISessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCurrentAPISessionParams() beforehand. -func (o *GetCurrentAPISessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/get_current_api_session_responses.go b/rest_client_api_server/operations/current_api_session/get_current_api_session_responses.go deleted file mode 100644 index b5b461a57..000000000 --- a/rest_client_api_server/operations/current_api_session/get_current_api_session_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentAPISessionOKCode is the HTTP code returned for type GetCurrentAPISessionOK -const GetCurrentAPISessionOKCode int = 200 - -/*GetCurrentAPISessionOK The API session associated with the session used to issue the request - -swagger:response getCurrentApiSessionOK -*/ -type GetCurrentAPISessionOK struct { - - /* - In: Body - */ - Payload *rest_model.CurrentAPISessionDetailEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentAPISessionOK creates GetCurrentAPISessionOK with default headers values -func NewGetCurrentAPISessionOK() *GetCurrentAPISessionOK { - - return &GetCurrentAPISessionOK{} -} - -// WithPayload adds the payload to the get current Api session o k response -func (o *GetCurrentAPISessionOK) WithPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) *GetCurrentAPISessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current Api session o k response -func (o *GetCurrentAPISessionOK) SetPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentAPISessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCurrentAPISessionUnauthorizedCode is the HTTP code returned for type GetCurrentAPISessionUnauthorized -const GetCurrentAPISessionUnauthorizedCode int = 401 - -/*GetCurrentAPISessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getCurrentApiSessionUnauthorized -*/ -type GetCurrentAPISessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentAPISessionUnauthorized creates GetCurrentAPISessionUnauthorized with default headers values -func NewGetCurrentAPISessionUnauthorized() *GetCurrentAPISessionUnauthorized { - - return &GetCurrentAPISessionUnauthorized{} -} - -// WithPayload adds the payload to the get current Api session unauthorized response -func (o *GetCurrentAPISessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCurrentAPISessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current Api session unauthorized response -func (o *GetCurrentAPISessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentAPISessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go b/rest_client_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go deleted file mode 100644 index 2e235d570..000000000 --- a/rest_client_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetCurrentAPISessionURL generates an URL for the get current API session operation -type GetCurrentAPISessionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentAPISessionURL) WithBasePath(bp string) *GetCurrentAPISessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentAPISessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCurrentAPISessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCurrentAPISessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCurrentAPISessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCurrentAPISessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCurrentAPISessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCurrentAPISessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCurrentAPISessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates.go b/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates.go deleted file mode 100644 index 5c9c35eba..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListCurrentAPISessionCertificatesHandlerFunc turns a function with the right signature into a list current Api session certificates handler -type ListCurrentAPISessionCertificatesHandlerFunc func(ListCurrentAPISessionCertificatesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListCurrentAPISessionCertificatesHandlerFunc) Handle(params ListCurrentAPISessionCertificatesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListCurrentAPISessionCertificatesHandler interface for that can handle valid list current Api session certificates params -type ListCurrentAPISessionCertificatesHandler interface { - Handle(ListCurrentAPISessionCertificatesParams, interface{}) middleware.Responder -} - -// NewListCurrentAPISessionCertificates creates a new http.Handler for the list current Api session certificates operation -func NewListCurrentAPISessionCertificates(ctx *middleware.Context, handler ListCurrentAPISessionCertificatesHandler) *ListCurrentAPISessionCertificates { - return &ListCurrentAPISessionCertificates{Context: ctx, Handler: handler} -} - -/* ListCurrentAPISessionCertificates swagger:route GET /current-api-session/certificates Current API Session listCurrentApiSessionCertificates - -List the ephemeral certificates available for the current API Session - -Retrieves a list of certificate resources for the current API session; supports filtering, sorting, and pagination - -*/ -type ListCurrentAPISessionCertificates struct { - Context *middleware.Context - Handler ListCurrentAPISessionCertificatesHandler -} - -func (o *ListCurrentAPISessionCertificates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListCurrentAPISessionCertificatesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_parameters.go b/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_parameters.go deleted file mode 100644 index 92d1ebcb3..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCurrentAPISessionCertificatesParams creates a new ListCurrentAPISessionCertificatesParams object -// -// There are no default values defined in the spec. -func NewListCurrentAPISessionCertificatesParams() ListCurrentAPISessionCertificatesParams { - - return ListCurrentAPISessionCertificatesParams{} -} - -// ListCurrentAPISessionCertificatesParams contains all the bound params for the list current Api session certificates operation -// typically these are obtained from a http.Request -// -// swagger:parameters listCurrentApiSessionCertificates -type ListCurrentAPISessionCertificatesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListCurrentAPISessionCertificatesParams() beforehand. -func (o *ListCurrentAPISessionCertificatesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListCurrentAPISessionCertificatesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListCurrentAPISessionCertificatesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListCurrentAPISessionCertificatesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_responses.go b/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_responses.go deleted file mode 100644 index 923093890..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListCurrentAPISessionCertificatesOKCode is the HTTP code returned for type ListCurrentAPISessionCertificatesOK -const ListCurrentAPISessionCertificatesOKCode int = 200 - -/*ListCurrentAPISessionCertificatesOK A list of the current API Session's certificate - -swagger:response listCurrentApiSessionCertificatesOK -*/ -type ListCurrentAPISessionCertificatesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListCurrentAPISessionCertificatesEnvelope `json:"body,omitempty"` -} - -// NewListCurrentAPISessionCertificatesOK creates ListCurrentAPISessionCertificatesOK with default headers values -func NewListCurrentAPISessionCertificatesOK() *ListCurrentAPISessionCertificatesOK { - - return &ListCurrentAPISessionCertificatesOK{} -} - -// WithPayload adds the payload to the list current Api session certificates o k response -func (o *ListCurrentAPISessionCertificatesOK) WithPayload(payload *rest_model.ListCurrentAPISessionCertificatesEnvelope) *ListCurrentAPISessionCertificatesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current Api session certificates o k response -func (o *ListCurrentAPISessionCertificatesOK) SetPayload(payload *rest_model.ListCurrentAPISessionCertificatesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentAPISessionCertificatesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCurrentAPISessionCertificatesBadRequestCode is the HTTP code returned for type ListCurrentAPISessionCertificatesBadRequest -const ListCurrentAPISessionCertificatesBadRequestCode int = 400 - -/*ListCurrentAPISessionCertificatesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listCurrentApiSessionCertificatesBadRequest -*/ -type ListCurrentAPISessionCertificatesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCurrentAPISessionCertificatesBadRequest creates ListCurrentAPISessionCertificatesBadRequest with default headers values -func NewListCurrentAPISessionCertificatesBadRequest() *ListCurrentAPISessionCertificatesBadRequest { - - return &ListCurrentAPISessionCertificatesBadRequest{} -} - -// WithPayload adds the payload to the list current Api session certificates bad request response -func (o *ListCurrentAPISessionCertificatesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentAPISessionCertificatesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current Api session certificates bad request response -func (o *ListCurrentAPISessionCertificatesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentAPISessionCertificatesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCurrentAPISessionCertificatesUnauthorizedCode is the HTTP code returned for type ListCurrentAPISessionCertificatesUnauthorized -const ListCurrentAPISessionCertificatesUnauthorizedCode int = 401 - -/*ListCurrentAPISessionCertificatesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listCurrentApiSessionCertificatesUnauthorized -*/ -type ListCurrentAPISessionCertificatesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCurrentAPISessionCertificatesUnauthorized creates ListCurrentAPISessionCertificatesUnauthorized with default headers values -func NewListCurrentAPISessionCertificatesUnauthorized() *ListCurrentAPISessionCertificatesUnauthorized { - - return &ListCurrentAPISessionCertificatesUnauthorized{} -} - -// WithPayload adds the payload to the list current Api session certificates unauthorized response -func (o *ListCurrentAPISessionCertificatesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentAPISessionCertificatesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current Api session certificates unauthorized response -func (o *ListCurrentAPISessionCertificatesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentAPISessionCertificatesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_urlbuilder.go b/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_urlbuilder.go deleted file mode 100644 index cd91f5330..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_api_session_certificates_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListCurrentAPISessionCertificatesURL generates an URL for the list current Api session certificates operation -type ListCurrentAPISessionCertificatesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCurrentAPISessionCertificatesURL) WithBasePath(bp string) *ListCurrentAPISessionCertificatesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCurrentAPISessionCertificatesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListCurrentAPISessionCertificatesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session/certificates" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListCurrentAPISessionCertificatesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListCurrentAPISessionCertificatesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListCurrentAPISessionCertificatesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListCurrentAPISessionCertificatesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListCurrentAPISessionCertificatesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListCurrentAPISessionCertificatesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators.go b/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators.go deleted file mode 100644 index c41037d12..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListCurrentIdentityAuthenticatorsHandlerFunc turns a function with the right signature into a list current identity authenticators handler -type ListCurrentIdentityAuthenticatorsHandlerFunc func(ListCurrentIdentityAuthenticatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListCurrentIdentityAuthenticatorsHandlerFunc) Handle(params ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListCurrentIdentityAuthenticatorsHandler interface for that can handle valid list current identity authenticators params -type ListCurrentIdentityAuthenticatorsHandler interface { - Handle(ListCurrentIdentityAuthenticatorsParams, interface{}) middleware.Responder -} - -// NewListCurrentIdentityAuthenticators creates a new http.Handler for the list current identity authenticators operation -func NewListCurrentIdentityAuthenticators(ctx *middleware.Context, handler ListCurrentIdentityAuthenticatorsHandler) *ListCurrentIdentityAuthenticators { - return &ListCurrentIdentityAuthenticators{Context: ctx, Handler: handler} -} - -/* ListCurrentIdentityAuthenticators swagger:route GET /current-identity/authenticators Current API Session listCurrentIdentityAuthenticators - -List authenticators for the current identity - -Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination. - -*/ -type ListCurrentIdentityAuthenticators struct { - Context *middleware.Context - Handler ListCurrentIdentityAuthenticatorsHandler -} - -func (o *ListCurrentIdentityAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListCurrentIdentityAuthenticatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go b/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go deleted file mode 100644 index 0625dd6de..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCurrentIdentityAuthenticatorsParams creates a new ListCurrentIdentityAuthenticatorsParams object -// -// There are no default values defined in the spec. -func NewListCurrentIdentityAuthenticatorsParams() ListCurrentIdentityAuthenticatorsParams { - - return ListCurrentIdentityAuthenticatorsParams{} -} - -// ListCurrentIdentityAuthenticatorsParams contains all the bound params for the list current identity authenticators operation -// typically these are obtained from a http.Request -// -// swagger:parameters listCurrentIdentityAuthenticators -type ListCurrentIdentityAuthenticatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListCurrentIdentityAuthenticatorsParams() beforehand. -func (o *ListCurrentIdentityAuthenticatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListCurrentIdentityAuthenticatorsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListCurrentIdentityAuthenticatorsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListCurrentIdentityAuthenticatorsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go b/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go deleted file mode 100644 index 0f6172743..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListCurrentIdentityAuthenticatorsOKCode is the HTTP code returned for type ListCurrentIdentityAuthenticatorsOK -const ListCurrentIdentityAuthenticatorsOKCode int = 200 - -/*ListCurrentIdentityAuthenticatorsOK A list of authenticators - -swagger:response listCurrentIdentityAuthenticatorsOK -*/ -type ListCurrentIdentityAuthenticatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListAuthenticatorsEnvelope `json:"body,omitempty"` -} - -// NewListCurrentIdentityAuthenticatorsOK creates ListCurrentIdentityAuthenticatorsOK with default headers values -func NewListCurrentIdentityAuthenticatorsOK() *ListCurrentIdentityAuthenticatorsOK { - - return &ListCurrentIdentityAuthenticatorsOK{} -} - -// WithPayload adds the payload to the list current identity authenticators o k response -func (o *ListCurrentIdentityAuthenticatorsOK) WithPayload(payload *rest_model.ListAuthenticatorsEnvelope) *ListCurrentIdentityAuthenticatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current identity authenticators o k response -func (o *ListCurrentIdentityAuthenticatorsOK) SetPayload(payload *rest_model.ListAuthenticatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentIdentityAuthenticatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCurrentIdentityAuthenticatorsBadRequestCode is the HTTP code returned for type ListCurrentIdentityAuthenticatorsBadRequest -const ListCurrentIdentityAuthenticatorsBadRequestCode int = 400 - -/*ListCurrentIdentityAuthenticatorsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listCurrentIdentityAuthenticatorsBadRequest -*/ -type ListCurrentIdentityAuthenticatorsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCurrentIdentityAuthenticatorsBadRequest creates ListCurrentIdentityAuthenticatorsBadRequest with default headers values -func NewListCurrentIdentityAuthenticatorsBadRequest() *ListCurrentIdentityAuthenticatorsBadRequest { - - return &ListCurrentIdentityAuthenticatorsBadRequest{} -} - -// WithPayload adds the payload to the list current identity authenticators bad request response -func (o *ListCurrentIdentityAuthenticatorsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentIdentityAuthenticatorsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current identity authenticators bad request response -func (o *ListCurrentIdentityAuthenticatorsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentIdentityAuthenticatorsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCurrentIdentityAuthenticatorsUnauthorizedCode is the HTTP code returned for type ListCurrentIdentityAuthenticatorsUnauthorized -const ListCurrentIdentityAuthenticatorsUnauthorizedCode int = 401 - -/*ListCurrentIdentityAuthenticatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listCurrentIdentityAuthenticatorsUnauthorized -*/ -type ListCurrentIdentityAuthenticatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCurrentIdentityAuthenticatorsUnauthorized creates ListCurrentIdentityAuthenticatorsUnauthorized with default headers values -func NewListCurrentIdentityAuthenticatorsUnauthorized() *ListCurrentIdentityAuthenticatorsUnauthorized { - - return &ListCurrentIdentityAuthenticatorsUnauthorized{} -} - -// WithPayload adds the payload to the list current identity authenticators unauthorized response -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentIdentityAuthenticatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current identity authenticators unauthorized response -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go b/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go deleted file mode 100644 index ef287ca16..000000000 --- a/rest_client_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListCurrentIdentityAuthenticatorsURL generates an URL for the list current identity authenticators operation -type ListCurrentIdentityAuthenticatorsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCurrentIdentityAuthenticatorsURL) WithBasePath(bp string) *ListCurrentIdentityAuthenticatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCurrentIdentityAuthenticatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListCurrentIdentityAuthenticatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListCurrentIdentityAuthenticatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListCurrentIdentityAuthenticatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListCurrentIdentityAuthenticatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListCurrentIdentityAuthenticatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListCurrentIdentityAuthenticatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListCurrentIdentityAuthenticatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/list_service_updates.go b/rest_client_api_server/operations/current_api_session/list_service_updates.go deleted file mode 100644 index ef01ef4dc..000000000 --- a/rest_client_api_server/operations/current_api_session/list_service_updates.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceUpdatesHandlerFunc turns a function with the right signature into a list service updates handler -type ListServiceUpdatesHandlerFunc func(ListServiceUpdatesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceUpdatesHandlerFunc) Handle(params ListServiceUpdatesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceUpdatesHandler interface for that can handle valid list service updates params -type ListServiceUpdatesHandler interface { - Handle(ListServiceUpdatesParams, interface{}) middleware.Responder -} - -// NewListServiceUpdates creates a new http.Handler for the list service updates operation -func NewListServiceUpdates(ctx *middleware.Context, handler ListServiceUpdatesHandler) *ListServiceUpdates { - return &ListServiceUpdates{Context: ctx, Handler: handler} -} - -/* ListServiceUpdates swagger:route GET /current-api-session/service-updates Current API Session Services listServiceUpdates - -Returns data indicating whether a client should updates it service list - -Retrieves data indicating the last time data relevant to this API Session was altered that would necessitate -service refreshes. - - -*/ -type ListServiceUpdates struct { - Context *middleware.Context - Handler ListServiceUpdatesHandler -} - -func (o *ListServiceUpdates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceUpdatesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/list_service_updates_parameters.go b/rest_client_api_server/operations/current_api_session/list_service_updates_parameters.go deleted file mode 100644 index 660f8399a..000000000 --- a/rest_client_api_server/operations/current_api_session/list_service_updates_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListServiceUpdatesParams creates a new ListServiceUpdatesParams object -// -// There are no default values defined in the spec. -func NewListServiceUpdatesParams() ListServiceUpdatesParams { - - return ListServiceUpdatesParams{} -} - -// ListServiceUpdatesParams contains all the bound params for the list service updates operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceUpdates -type ListServiceUpdatesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceUpdatesParams() beforehand. -func (o *ListServiceUpdatesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/list_service_updates_responses.go b/rest_client_api_server/operations/current_api_session/list_service_updates_responses.go deleted file mode 100644 index 9fabd9905..000000000 --- a/rest_client_api_server/operations/current_api_session/list_service_updates_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceUpdatesOKCode is the HTTP code returned for type ListServiceUpdatesOK -const ListServiceUpdatesOKCode int = 200 - -/*ListServiceUpdatesOK Data indicating necessary service updates - -swagger:response listServiceUpdatesOK -*/ -type ListServiceUpdatesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListCurrentAPISessionServiceUpdatesEnvelope `json:"body,omitempty"` -} - -// NewListServiceUpdatesOK creates ListServiceUpdatesOK with default headers values -func NewListServiceUpdatesOK() *ListServiceUpdatesOK { - - return &ListServiceUpdatesOK{} -} - -// WithPayload adds the payload to the list service updates o k response -func (o *ListServiceUpdatesOK) WithPayload(payload *rest_model.ListCurrentAPISessionServiceUpdatesEnvelope) *ListServiceUpdatesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service updates o k response -func (o *ListServiceUpdatesOK) SetPayload(payload *rest_model.ListCurrentAPISessionServiceUpdatesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceUpdatesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceUpdatesUnauthorizedCode is the HTTP code returned for type ListServiceUpdatesUnauthorized -const ListServiceUpdatesUnauthorizedCode int = 401 - -/*ListServiceUpdatesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceUpdatesUnauthorized -*/ -type ListServiceUpdatesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceUpdatesUnauthorized creates ListServiceUpdatesUnauthorized with default headers values -func NewListServiceUpdatesUnauthorized() *ListServiceUpdatesUnauthorized { - - return &ListServiceUpdatesUnauthorized{} -} - -// WithPayload adds the payload to the list service updates unauthorized response -func (o *ListServiceUpdatesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceUpdatesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service updates unauthorized response -func (o *ListServiceUpdatesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceUpdatesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/list_service_updates_urlbuilder.go b/rest_client_api_server/operations/current_api_session/list_service_updates_urlbuilder.go deleted file mode 100644 index 5408bb7a2..000000000 --- a/rest_client_api_server/operations/current_api_session/list_service_updates_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListServiceUpdatesURL generates an URL for the list service updates operation -type ListServiceUpdatesURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceUpdatesURL) WithBasePath(bp string) *ListServiceUpdatesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceUpdatesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceUpdatesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session/service-updates" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceUpdatesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceUpdatesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceUpdatesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceUpdatesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceUpdatesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceUpdatesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator.go deleted file mode 100644 index 9cd5ddf44..000000000 --- a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a patch current identity authenticator handler -type PatchCurrentIdentityAuthenticatorHandlerFunc func(PatchCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchCurrentIdentityAuthenticatorHandlerFunc) Handle(params PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchCurrentIdentityAuthenticatorHandler interface for that can handle valid patch current identity authenticator params -type PatchCurrentIdentityAuthenticatorHandler interface { - Handle(PatchCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewPatchCurrentIdentityAuthenticator creates a new http.Handler for the patch current identity authenticator operation -func NewPatchCurrentIdentityAuthenticator(ctx *middleware.Context, handler PatchCurrentIdentityAuthenticatorHandler) *PatchCurrentIdentityAuthenticator { - return &PatchCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* PatchCurrentIdentityAuthenticator swagger:route PATCH /current-identity/authenticators/{id} Current API Session patchCurrentIdentityAuthenticator - -Update the supplied fields on an authenticator of this identity - -Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API -session's identity. - - -*/ -type PatchCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler PatchCurrentIdentityAuthenticatorHandler -} - -func (o *PatchCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go b/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go deleted file mode 100644 index 9e6a0ff99..000000000 --- a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchCurrentIdentityAuthenticatorParams creates a new PatchCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewPatchCurrentIdentityAuthenticatorParams() PatchCurrentIdentityAuthenticatorParams { - - return PatchCurrentIdentityAuthenticatorParams{} -} - -// PatchCurrentIdentityAuthenticatorParams contains all the bound params for the patch current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchCurrentIdentityAuthenticator -type PatchCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An authenticator patch object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorPatchWithCurrent - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchCurrentIdentityAuthenticatorParams() beforehand. -func (o *PatchCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorPatchWithCurrent - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go b/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go deleted file mode 100644 index 34e0d6462..000000000 --- a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorOK -const PatchCurrentIdentityAuthenticatorOKCode int = 200 - -/*PatchCurrentIdentityAuthenticatorOK The patch request was successful and the resource has been altered - -swagger:response patchCurrentIdentityAuthenticatorOK -*/ -type PatchCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorOK creates PatchCurrentIdentityAuthenticatorOK with default headers values -func NewPatchCurrentIdentityAuthenticatorOK() *PatchCurrentIdentityAuthenticatorOK { - - return &PatchCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the patch current identity authenticator o k response -func (o *PatchCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.Empty) *PatchCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator o k response -func (o *PatchCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCurrentIdentityAuthenticatorBadRequestCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorBadRequest -const PatchCurrentIdentityAuthenticatorBadRequestCode int = 400 - -/*PatchCurrentIdentityAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchCurrentIdentityAuthenticatorBadRequest -*/ -type PatchCurrentIdentityAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorBadRequest creates PatchCurrentIdentityAuthenticatorBadRequest with default headers values -func NewPatchCurrentIdentityAuthenticatorBadRequest() *PatchCurrentIdentityAuthenticatorBadRequest { - - return &PatchCurrentIdentityAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the patch current identity authenticator bad request response -func (o *PatchCurrentIdentityAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCurrentIdentityAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator bad request response -func (o *PatchCurrentIdentityAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorUnauthorized -const PatchCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*PatchCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchCurrentIdentityAuthenticatorUnauthorized -*/ -type PatchCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorUnauthorized creates PatchCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewPatchCurrentIdentityAuthenticatorUnauthorized() *PatchCurrentIdentityAuthenticatorUnauthorized { - - return &PatchCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the patch current identity authenticator unauthorized response -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator unauthorized response -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCurrentIdentityAuthenticatorNotFoundCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorNotFound -const PatchCurrentIdentityAuthenticatorNotFoundCode int = 404 - -/*PatchCurrentIdentityAuthenticatorNotFound The requested resource does not exist - -swagger:response patchCurrentIdentityAuthenticatorNotFound -*/ -type PatchCurrentIdentityAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorNotFound creates PatchCurrentIdentityAuthenticatorNotFound with default headers values -func NewPatchCurrentIdentityAuthenticatorNotFound() *PatchCurrentIdentityAuthenticatorNotFound { - - return &PatchCurrentIdentityAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the patch current identity authenticator not found response -func (o *PatchCurrentIdentityAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCurrentIdentityAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator not found response -func (o *PatchCurrentIdentityAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go b/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index cd67c536c..000000000 --- a/rest_client_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchCurrentIdentityAuthenticatorURL generates an URL for the patch current identity authenticator operation -type PatchCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *PatchCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator.go b/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator.go deleted file mode 100644 index 495ab4c79..000000000 --- a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a update current identity authenticator handler -type UpdateCurrentIdentityAuthenticatorHandlerFunc func(UpdateCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateCurrentIdentityAuthenticatorHandlerFunc) Handle(params UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateCurrentIdentityAuthenticatorHandler interface for that can handle valid update current identity authenticator params -type UpdateCurrentIdentityAuthenticatorHandler interface { - Handle(UpdateCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewUpdateCurrentIdentityAuthenticator creates a new http.Handler for the update current identity authenticator operation -func NewUpdateCurrentIdentityAuthenticator(ctx *middleware.Context, handler UpdateCurrentIdentityAuthenticatorHandler) *UpdateCurrentIdentityAuthenticator { - return &UpdateCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* UpdateCurrentIdentityAuthenticator swagger:route PUT /current-identity/authenticators/{id} Current API Session updateCurrentIdentityAuthenticator - -Update all fields on an authenticator of this identity - -Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's -identity. - - -*/ -type UpdateCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler UpdateCurrentIdentityAuthenticatorHandler -} - -func (o *UpdateCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go b/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go deleted file mode 100644 index 3d68b9dfa..000000000 --- a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateCurrentIdentityAuthenticatorParams creates a new UpdateCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewUpdateCurrentIdentityAuthenticatorParams() UpdateCurrentIdentityAuthenticatorParams { - - return UpdateCurrentIdentityAuthenticatorParams{} -} - -// UpdateCurrentIdentityAuthenticatorParams contains all the bound params for the update current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateCurrentIdentityAuthenticator -type UpdateCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An authenticator put object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorUpdateWithCurrent - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateCurrentIdentityAuthenticatorParams() beforehand. -func (o *UpdateCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorUpdateWithCurrent - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go b/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go deleted file mode 100644 index 350d6c974..000000000 --- a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorOK -const UpdateCurrentIdentityAuthenticatorOKCode int = 200 - -/*UpdateCurrentIdentityAuthenticatorOK The update request was successful and the resource has been altered - -swagger:response updateCurrentIdentityAuthenticatorOK -*/ -type UpdateCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorOK creates UpdateCurrentIdentityAuthenticatorOK with default headers values -func NewUpdateCurrentIdentityAuthenticatorOK() *UpdateCurrentIdentityAuthenticatorOK { - - return &UpdateCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the update current identity authenticator o k response -func (o *UpdateCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.Empty) *UpdateCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator o k response -func (o *UpdateCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCurrentIdentityAuthenticatorBadRequestCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorBadRequest -const UpdateCurrentIdentityAuthenticatorBadRequestCode int = 400 - -/*UpdateCurrentIdentityAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateCurrentIdentityAuthenticatorBadRequest -*/ -type UpdateCurrentIdentityAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorBadRequest creates UpdateCurrentIdentityAuthenticatorBadRequest with default headers values -func NewUpdateCurrentIdentityAuthenticatorBadRequest() *UpdateCurrentIdentityAuthenticatorBadRequest { - - return &UpdateCurrentIdentityAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the update current identity authenticator bad request response -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCurrentIdentityAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator bad request response -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorUnauthorized -const UpdateCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*UpdateCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateCurrentIdentityAuthenticatorUnauthorized -*/ -type UpdateCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorUnauthorized creates UpdateCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewUpdateCurrentIdentityAuthenticatorUnauthorized() *UpdateCurrentIdentityAuthenticatorUnauthorized { - - return &UpdateCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the update current identity authenticator unauthorized response -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator unauthorized response -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCurrentIdentityAuthenticatorNotFoundCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorNotFound -const UpdateCurrentIdentityAuthenticatorNotFoundCode int = 404 - -/*UpdateCurrentIdentityAuthenticatorNotFound The requested resource does not exist - -swagger:response updateCurrentIdentityAuthenticatorNotFound -*/ -type UpdateCurrentIdentityAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorNotFound creates UpdateCurrentIdentityAuthenticatorNotFound with default headers values -func NewUpdateCurrentIdentityAuthenticatorNotFound() *UpdateCurrentIdentityAuthenticatorNotFound { - - return &UpdateCurrentIdentityAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the update current identity authenticator not found response -func (o *UpdateCurrentIdentityAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCurrentIdentityAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator not found response -func (o *UpdateCurrentIdentityAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go b/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index ae52936b1..000000000 --- a/rest_client_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateCurrentIdentityAuthenticatorURL generates an URL for the update current identity authenticator operation -type UpdateCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *UpdateCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes.go deleted file mode 100644 index 69b206220..000000000 --- a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMfaRecoveryCodesHandlerFunc turns a function with the right signature into a create mfa recovery codes handler -type CreateMfaRecoveryCodesHandlerFunc func(CreateMfaRecoveryCodesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMfaRecoveryCodesHandlerFunc) Handle(params CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateMfaRecoveryCodesHandler interface for that can handle valid create mfa recovery codes params -type CreateMfaRecoveryCodesHandler interface { - Handle(CreateMfaRecoveryCodesParams, interface{}) middleware.Responder -} - -// NewCreateMfaRecoveryCodes creates a new http.Handler for the create mfa recovery codes operation -func NewCreateMfaRecoveryCodes(ctx *middleware.Context, handler CreateMfaRecoveryCodesHandler) *CreateMfaRecoveryCodes { - return &CreateMfaRecoveryCodes{Context: ctx, Handler: handler} -} - -/* CreateMfaRecoveryCodes swagger:route POST /current-identity/mfa/recovery-codes Current Identity MFA createMfaRecoveryCodes - -For a completed MFA enrollment regenerate the recovery codes - -Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes. - - -*/ -type CreateMfaRecoveryCodes struct { - Context *middleware.Context - Handler CreateMfaRecoveryCodesHandler -} - -func (o *CreateMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMfaRecoveryCodesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go deleted file mode 100644 index 05cb80b01..000000000 --- a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateMfaRecoveryCodesParams creates a new CreateMfaRecoveryCodesParams object -// -// There are no default values defined in the spec. -func NewCreateMfaRecoveryCodesParams() CreateMfaRecoveryCodesParams { - - return CreateMfaRecoveryCodesParams{} -} - -// CreateMfaRecoveryCodesParams contains all the bound params for the create mfa recovery codes operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMfaRecoveryCodes -type CreateMfaRecoveryCodesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An MFA validation request - Required: true - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMfaRecoveryCodesParams() beforehand. -func (o *CreateMfaRecoveryCodesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("mfaValidation", "body", "")) - } else { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } else { - res = append(res, errors.Required("mfaValidation", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go deleted file mode 100644 index d6e35450e..000000000 --- a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateMfaRecoveryCodesOKCode is the HTTP code returned for type CreateMfaRecoveryCodesOK -const CreateMfaRecoveryCodesOKCode int = 200 - -/*CreateMfaRecoveryCodesOK The recovery codes of an MFA enrollment - -swagger:response createMfaRecoveryCodesOK -*/ -type CreateMfaRecoveryCodesOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailMfaRecoveryCodesEnvelope `json:"body,omitempty"` -} - -// NewCreateMfaRecoveryCodesOK creates CreateMfaRecoveryCodesOK with default headers values -func NewCreateMfaRecoveryCodesOK() *CreateMfaRecoveryCodesOK { - - return &CreateMfaRecoveryCodesOK{} -} - -// WithPayload adds the payload to the create mfa recovery codes o k response -func (o *CreateMfaRecoveryCodesOK) WithPayload(payload *rest_model.DetailMfaRecoveryCodesEnvelope) *CreateMfaRecoveryCodesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create mfa recovery codes o k response -func (o *CreateMfaRecoveryCodesOK) SetPayload(payload *rest_model.DetailMfaRecoveryCodesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMfaRecoveryCodesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMfaRecoveryCodesUnauthorizedCode is the HTTP code returned for type CreateMfaRecoveryCodesUnauthorized -const CreateMfaRecoveryCodesUnauthorizedCode int = 401 - -/*CreateMfaRecoveryCodesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createMfaRecoveryCodesUnauthorized -*/ -type CreateMfaRecoveryCodesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateMfaRecoveryCodesUnauthorized creates CreateMfaRecoveryCodesUnauthorized with default headers values -func NewCreateMfaRecoveryCodesUnauthorized() *CreateMfaRecoveryCodesUnauthorized { - - return &CreateMfaRecoveryCodesUnauthorized{} -} - -// WithPayload adds the payload to the create mfa recovery codes unauthorized response -func (o *CreateMfaRecoveryCodesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateMfaRecoveryCodesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create mfa recovery codes unauthorized response -func (o *CreateMfaRecoveryCodesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMfaRecoveryCodesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMfaRecoveryCodesNotFoundCode is the HTTP code returned for type CreateMfaRecoveryCodesNotFound -const CreateMfaRecoveryCodesNotFoundCode int = 404 - -/*CreateMfaRecoveryCodesNotFound The requested resource does not exist - -swagger:response createMfaRecoveryCodesNotFound -*/ -type CreateMfaRecoveryCodesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateMfaRecoveryCodesNotFound creates CreateMfaRecoveryCodesNotFound with default headers values -func NewCreateMfaRecoveryCodesNotFound() *CreateMfaRecoveryCodesNotFound { - - return &CreateMfaRecoveryCodesNotFound{} -} - -// WithPayload adds the payload to the create mfa recovery codes not found response -func (o *CreateMfaRecoveryCodesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateMfaRecoveryCodesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create mfa recovery codes not found response -func (o *CreateMfaRecoveryCodesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMfaRecoveryCodesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go b/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go deleted file mode 100644 index e1c1d8918..000000000 --- a/rest_client_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMfaRecoveryCodesURL generates an URL for the create mfa recovery codes operation -type CreateMfaRecoveryCodesURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMfaRecoveryCodesURL) WithBasePath(bp string) *CreateMfaRecoveryCodesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMfaRecoveryCodesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMfaRecoveryCodesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/recovery-codes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMfaRecoveryCodesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMfaRecoveryCodesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMfaRecoveryCodesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMfaRecoveryCodesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMfaRecoveryCodesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMfaRecoveryCodesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/delete_mfa.go b/rest_client_api_server/operations/current_identity/delete_mfa.go deleted file mode 100644 index f1d223a8a..000000000 --- a/rest_client_api_server/operations/current_identity/delete_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteMfaHandlerFunc turns a function with the right signature into a delete mfa handler -type DeleteMfaHandlerFunc func(DeleteMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteMfaHandlerFunc) Handle(params DeleteMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteMfaHandler interface for that can handle valid delete mfa params -type DeleteMfaHandler interface { - Handle(DeleteMfaParams, interface{}) middleware.Responder -} - -// NewDeleteMfa creates a new http.Handler for the delete mfa operation -func NewDeleteMfa(ctx *middleware.Context, handler DeleteMfaHandler) *DeleteMfa { - return &DeleteMfa{Context: ctx, Handler: handler} -} - -/* DeleteMfa swagger:route DELETE /current-identity/mfa Current Identity MFA deleteMfa - -Disable MFA for the current identity - -Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via `DELETE /identities//mfa`. - - -*/ -type DeleteMfa struct { - Context *middleware.Context - Handler DeleteMfaHandler -} - -func (o *DeleteMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/delete_mfa_parameters.go b/rest_client_api_server/operations/current_identity/delete_mfa_parameters.go deleted file mode 100644 index 8b8d084ed..000000000 --- a/rest_client_api_server/operations/current_identity/delete_mfa_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewDeleteMfaParams creates a new DeleteMfaParams object -// -// There are no default values defined in the spec. -func NewDeleteMfaParams() DeleteMfaParams { - - return DeleteMfaParams{} -} - -// DeleteMfaParams contains all the bound params for the delete mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteMfa -type DeleteMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: header - */ - MfaValidationCode *string - /*An MFA validation request - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteMfaParams() beforehand. -func (o *DeleteMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindMfaValidationCode(r.Header[http.CanonicalHeaderKey("mfa-validation-code")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMfaValidationCode binds and validates parameter MfaValidationCode from header. -func (o *DeleteMfaParams) bindMfaValidationCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.MfaValidationCode = &raw - - return nil -} diff --git a/rest_client_api_server/operations/current_identity/delete_mfa_responses.go b/rest_client_api_server/operations/current_identity/delete_mfa_responses.go deleted file mode 100644 index 20a9c3e42..000000000 --- a/rest_client_api_server/operations/current_identity/delete_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteMfaOKCode is the HTTP code returned for type DeleteMfaOK -const DeleteMfaOKCode int = 200 - -/*DeleteMfaOK Base empty response - -swagger:response deleteMfaOK -*/ -type DeleteMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteMfaOK creates DeleteMfaOK with default headers values -func NewDeleteMfaOK() *DeleteMfaOK { - - return &DeleteMfaOK{} -} - -// WithPayload adds the payload to the delete mfa o k response -func (o *DeleteMfaOK) WithPayload(payload *rest_model.Empty) *DeleteMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete mfa o k response -func (o *DeleteMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMfaUnauthorizedCode is the HTTP code returned for type DeleteMfaUnauthorized -const DeleteMfaUnauthorizedCode int = 401 - -/*DeleteMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteMfaUnauthorized -*/ -type DeleteMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteMfaUnauthorized creates DeleteMfaUnauthorized with default headers values -func NewDeleteMfaUnauthorized() *DeleteMfaUnauthorized { - - return &DeleteMfaUnauthorized{} -} - -// WithPayload adds the payload to the delete mfa unauthorized response -func (o *DeleteMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete mfa unauthorized response -func (o *DeleteMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMfaNotFoundCode is the HTTP code returned for type DeleteMfaNotFound -const DeleteMfaNotFoundCode int = 404 - -/*DeleteMfaNotFound The requested resource does not exist - -swagger:response deleteMfaNotFound -*/ -type DeleteMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteMfaNotFound creates DeleteMfaNotFound with default headers values -func NewDeleteMfaNotFound() *DeleteMfaNotFound { - - return &DeleteMfaNotFound{} -} - -// WithPayload adds the payload to the delete mfa not found response -func (o *DeleteMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete mfa not found response -func (o *DeleteMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/delete_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/delete_mfa_urlbuilder.go deleted file mode 100644 index eefb796ae..000000000 --- a/rest_client_api_server/operations/current_identity/delete_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DeleteMfaURL generates an URL for the delete mfa operation -type DeleteMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMfaURL) WithBasePath(bp string) *DeleteMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa.go b/rest_client_api_server/operations/current_identity/detail_mfa.go deleted file mode 100644 index bdcf3a6f1..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailMfaHandlerFunc turns a function with the right signature into a detail mfa handler -type DetailMfaHandlerFunc func(DetailMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailMfaHandlerFunc) Handle(params DetailMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailMfaHandler interface for that can handle valid detail mfa params -type DetailMfaHandler interface { - Handle(DetailMfaParams, interface{}) middleware.Responder -} - -// NewDetailMfa creates a new http.Handler for the detail mfa operation -func NewDetailMfa(ctx *middleware.Context, handler DetailMfaHandler) *DetailMfa { - return &DetailMfa{Context: ctx, Handler: handler} -} - -/* DetailMfa swagger:route GET /current-identity/mfa Current Identity MFA detailMfa - -Returns the current status of MFA enrollment - -Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a `POST /current-identity/mfa/verify`. - - -*/ -type DetailMfa struct { - Context *middleware.Context - Handler DetailMfaHandler -} - -func (o *DetailMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_parameters.go b/rest_client_api_server/operations/current_identity/detail_mfa_parameters.go deleted file mode 100644 index 193dfed87..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDetailMfaParams creates a new DetailMfaParams object -// -// There are no default values defined in the spec. -func NewDetailMfaParams() DetailMfaParams { - - return DetailMfaParams{} -} - -// DetailMfaParams contains all the bound params for the detail mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailMfa -type DetailMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailMfaParams() beforehand. -func (o *DetailMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code.go deleted file mode 100644 index d6c3c01ac..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailMfaQrCodeHandlerFunc turns a function with the right signature into a detail mfa qr code handler -type DetailMfaQrCodeHandlerFunc func(DetailMfaQrCodeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailMfaQrCodeHandlerFunc) Handle(params DetailMfaQrCodeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailMfaQrCodeHandler interface for that can handle valid detail mfa qr code params -type DetailMfaQrCodeHandler interface { - Handle(DetailMfaQrCodeParams, interface{}) middleware.Responder -} - -// NewDetailMfaQrCode creates a new http.Handler for the detail mfa qr code operation -func NewDetailMfaQrCode(ctx *middleware.Context, handler DetailMfaQrCodeHandler) *DetailMfaQrCode { - return &DetailMfaQrCode{Context: ctx, Handler: handler} -} - -/* DetailMfaQrCode swagger:route GET /current-identity/mfa/qr-code Current Identity MFA detailMfaQrCode - -Show a QR code for unverified MFA enrollments - -Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started. - - -*/ -type DetailMfaQrCode struct { - Context *middleware.Context - Handler DetailMfaQrCodeHandler -} - -func (o *DetailMfaQrCode) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailMfaQrCodeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go deleted file mode 100644 index 79cc9ea72..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDetailMfaQrCodeParams creates a new DetailMfaQrCodeParams object -// -// There are no default values defined in the spec. -func NewDetailMfaQrCodeParams() DetailMfaQrCodeParams { - - return DetailMfaQrCodeParams{} -} - -// DetailMfaQrCodeParams contains all the bound params for the detail mfa qr code operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailMfaQrCode -type DetailMfaQrCodeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailMfaQrCodeParams() beforehand. -func (o *DetailMfaQrCodeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_responses.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_responses.go deleted file mode 100644 index d82baeb0a..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// DetailMfaQrCodeOKCode is the HTTP code returned for type DetailMfaQrCodeOK -const DetailMfaQrCodeOKCode int = 200 - -/*DetailMfaQrCodeOK OK - -swagger:response detailMfaQrCodeOK -*/ -type DetailMfaQrCodeOK struct { -} - -// NewDetailMfaQrCodeOK creates DetailMfaQrCodeOK with default headers values -func NewDetailMfaQrCodeOK() *DetailMfaQrCodeOK { - - return &DetailMfaQrCodeOK{} -} - -// WriteResponse to the client -func (o *DetailMfaQrCodeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(200) -} - -// DetailMfaQrCodeNotFoundCode is the HTTP code returned for type DetailMfaQrCodeNotFound -const DetailMfaQrCodeNotFoundCode int = 404 - -/*DetailMfaQrCodeNotFound No MFA enrollment or MFA enrollment is completed - -swagger:response detailMfaQrCodeNotFound -*/ -type DetailMfaQrCodeNotFound struct { -} - -// NewDetailMfaQrCodeNotFound creates DetailMfaQrCodeNotFound with default headers values -func NewDetailMfaQrCodeNotFound() *DetailMfaQrCodeNotFound { - - return &DetailMfaQrCodeNotFound{} -} - -// WriteResponse to the client -func (o *DetailMfaQrCodeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go b/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go deleted file mode 100644 index 5a09a9066..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DetailMfaQrCodeURL generates an URL for the detail mfa qr code operation -type DetailMfaQrCodeURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaQrCodeURL) WithBasePath(bp string) *DetailMfaQrCodeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaQrCodeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailMfaQrCodeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/qr-code" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailMfaQrCodeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailMfaQrCodeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailMfaQrCodeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailMfaQrCodeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailMfaQrCodeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailMfaQrCodeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes.go deleted file mode 100644 index 39f25d570..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailMfaRecoveryCodesHandlerFunc turns a function with the right signature into a detail mfa recovery codes handler -type DetailMfaRecoveryCodesHandlerFunc func(DetailMfaRecoveryCodesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailMfaRecoveryCodesHandlerFunc) Handle(params DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailMfaRecoveryCodesHandler interface for that can handle valid detail mfa recovery codes params -type DetailMfaRecoveryCodesHandler interface { - Handle(DetailMfaRecoveryCodesParams, interface{}) middleware.Responder -} - -// NewDetailMfaRecoveryCodes creates a new http.Handler for the detail mfa recovery codes operation -func NewDetailMfaRecoveryCodes(ctx *middleware.Context, handler DetailMfaRecoveryCodesHandler) *DetailMfaRecoveryCodes { - return &DetailMfaRecoveryCodes{Context: ctx, Handler: handler} -} - -/* DetailMfaRecoveryCodes swagger:route GET /current-identity/mfa/recovery-codes Current Identity MFA detailMfaRecoveryCodes - -For a completed MFA enrollment view the current recovery codes - -Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. - - -*/ -type DetailMfaRecoveryCodes struct { - Context *middleware.Context - Handler DetailMfaRecoveryCodesHandler -} - -func (o *DetailMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailMfaRecoveryCodesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go deleted file mode 100644 index 2184f7921..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewDetailMfaRecoveryCodesParams creates a new DetailMfaRecoveryCodesParams object -// -// There are no default values defined in the spec. -func NewDetailMfaRecoveryCodesParams() DetailMfaRecoveryCodesParams { - - return DetailMfaRecoveryCodesParams{} -} - -// DetailMfaRecoveryCodesParams contains all the bound params for the detail mfa recovery codes operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailMfaRecoveryCodes -type DetailMfaRecoveryCodesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: header - */ - MfaValidationCode *string - /*An MFA validation request - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailMfaRecoveryCodesParams() beforehand. -func (o *DetailMfaRecoveryCodesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindMfaValidationCode(r.Header[http.CanonicalHeaderKey("mfa-validation-code")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMfaValidationCode binds and validates parameter MfaValidationCode from header. -func (o *DetailMfaRecoveryCodesParams) bindMfaValidationCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.MfaValidationCode = &raw - - return nil -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go deleted file mode 100644 index b701009b4..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaRecoveryCodesOKCode is the HTTP code returned for type DetailMfaRecoveryCodesOK -const DetailMfaRecoveryCodesOKCode int = 200 - -/*DetailMfaRecoveryCodesOK Base empty response - -swagger:response detailMfaRecoveryCodesOK -*/ -type DetailMfaRecoveryCodesOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDetailMfaRecoveryCodesOK creates DetailMfaRecoveryCodesOK with default headers values -func NewDetailMfaRecoveryCodesOK() *DetailMfaRecoveryCodesOK { - - return &DetailMfaRecoveryCodesOK{} -} - -// WithPayload adds the payload to the detail mfa recovery codes o k response -func (o *DetailMfaRecoveryCodesOK) WithPayload(payload *rest_model.Empty) *DetailMfaRecoveryCodesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa recovery codes o k response -func (o *DetailMfaRecoveryCodesOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaRecoveryCodesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaRecoveryCodesUnauthorizedCode is the HTTP code returned for type DetailMfaRecoveryCodesUnauthorized -const DetailMfaRecoveryCodesUnauthorizedCode int = 401 - -/*DetailMfaRecoveryCodesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailMfaRecoveryCodesUnauthorized -*/ -type DetailMfaRecoveryCodesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaRecoveryCodesUnauthorized creates DetailMfaRecoveryCodesUnauthorized with default headers values -func NewDetailMfaRecoveryCodesUnauthorized() *DetailMfaRecoveryCodesUnauthorized { - - return &DetailMfaRecoveryCodesUnauthorized{} -} - -// WithPayload adds the payload to the detail mfa recovery codes unauthorized response -func (o *DetailMfaRecoveryCodesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaRecoveryCodesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa recovery codes unauthorized response -func (o *DetailMfaRecoveryCodesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaRecoveryCodesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaRecoveryCodesNotFoundCode is the HTTP code returned for type DetailMfaRecoveryCodesNotFound -const DetailMfaRecoveryCodesNotFoundCode int = 404 - -/*DetailMfaRecoveryCodesNotFound The requested resource does not exist - -swagger:response detailMfaRecoveryCodesNotFound -*/ -type DetailMfaRecoveryCodesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaRecoveryCodesNotFound creates DetailMfaRecoveryCodesNotFound with default headers values -func NewDetailMfaRecoveryCodesNotFound() *DetailMfaRecoveryCodesNotFound { - - return &DetailMfaRecoveryCodesNotFound{} -} - -// WithPayload adds the payload to the detail mfa recovery codes not found response -func (o *DetailMfaRecoveryCodesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaRecoveryCodesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa recovery codes not found response -func (o *DetailMfaRecoveryCodesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaRecoveryCodesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go b/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go deleted file mode 100644 index 0ccc083bd..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DetailMfaRecoveryCodesURL generates an URL for the detail mfa recovery codes operation -type DetailMfaRecoveryCodesURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaRecoveryCodesURL) WithBasePath(bp string) *DetailMfaRecoveryCodesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaRecoveryCodesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailMfaRecoveryCodesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/recovery-codes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailMfaRecoveryCodesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailMfaRecoveryCodesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailMfaRecoveryCodesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailMfaRecoveryCodesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailMfaRecoveryCodesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailMfaRecoveryCodesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_responses.go b/rest_client_api_server/operations/current_identity/detail_mfa_responses.go deleted file mode 100644 index 95431cbec..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaOKCode is the HTTP code returned for type DetailMfaOK -const DetailMfaOKCode int = 200 - -/*DetailMfaOK The details of an MFA enrollment - -swagger:response detailMfaOK -*/ -type DetailMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailMfaEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaOK creates DetailMfaOK with default headers values -func NewDetailMfaOK() *DetailMfaOK { - - return &DetailMfaOK{} -} - -// WithPayload adds the payload to the detail mfa o k response -func (o *DetailMfaOK) WithPayload(payload *rest_model.DetailMfaEnvelope) *DetailMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa o k response -func (o *DetailMfaOK) SetPayload(payload *rest_model.DetailMfaEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaUnauthorizedCode is the HTTP code returned for type DetailMfaUnauthorized -const DetailMfaUnauthorizedCode int = 401 - -/*DetailMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailMfaUnauthorized -*/ -type DetailMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaUnauthorized creates DetailMfaUnauthorized with default headers values -func NewDetailMfaUnauthorized() *DetailMfaUnauthorized { - - return &DetailMfaUnauthorized{} -} - -// WithPayload adds the payload to the detail mfa unauthorized response -func (o *DetailMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa unauthorized response -func (o *DetailMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaNotFoundCode is the HTTP code returned for type DetailMfaNotFound -const DetailMfaNotFoundCode int = 404 - -/*DetailMfaNotFound The requested resource does not exist - -swagger:response detailMfaNotFound -*/ -type DetailMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaNotFound creates DetailMfaNotFound with default headers values -func NewDetailMfaNotFound() *DetailMfaNotFound { - - return &DetailMfaNotFound{} -} - -// WithPayload adds the payload to the detail mfa not found response -func (o *DetailMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa not found response -func (o *DetailMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/detail_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/detail_mfa_urlbuilder.go deleted file mode 100644 index 8949a39fb..000000000 --- a/rest_client_api_server/operations/current_identity/detail_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DetailMfaURL generates an URL for the detail mfa operation -type DetailMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaURL) WithBasePath(bp string) *DetailMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/enroll_mfa.go b/rest_client_api_server/operations/current_identity/enroll_mfa.go deleted file mode 100644 index a3198da0c..000000000 --- a/rest_client_api_server/operations/current_identity/enroll_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollMfaHandlerFunc turns a function with the right signature into a enroll mfa handler -type EnrollMfaHandlerFunc func(EnrollMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollMfaHandlerFunc) Handle(params EnrollMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// EnrollMfaHandler interface for that can handle valid enroll mfa params -type EnrollMfaHandler interface { - Handle(EnrollMfaParams, interface{}) middleware.Responder -} - -// NewEnrollMfa creates a new http.Handler for the enroll mfa operation -func NewEnrollMfa(ctx *middleware.Context, handler EnrollMfaHandler) *EnrollMfa { - return &EnrollMfa{Context: ctx, Handler: handler} -} - -/* EnrollMfa swagger:route POST /current-identity/mfa Current Identity MFA enrollMfa - -Initiate MFA enrollment - -Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via `POST /current-identity/mfa/verify` - - -*/ -type EnrollMfa struct { - Context *middleware.Context - Handler EnrollMfaHandler -} - -func (o *EnrollMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/enroll_mfa_parameters.go b/rest_client_api_server/operations/current_identity/enroll_mfa_parameters.go deleted file mode 100644 index 7dd1be19b..000000000 --- a/rest_client_api_server/operations/current_identity/enroll_mfa_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewEnrollMfaParams creates a new EnrollMfaParams object -// -// There are no default values defined in the spec. -func NewEnrollMfaParams() EnrollMfaParams { - - return EnrollMfaParams{} -} - -// EnrollMfaParams contains all the bound params for the enroll mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters enrollMfa -type EnrollMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollMfaParams() beforehand. -func (o *EnrollMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/enroll_mfa_responses.go b/rest_client_api_server/operations/current_identity/enroll_mfa_responses.go deleted file mode 100644 index 129c7f35f..000000000 --- a/rest_client_api_server/operations/current_identity/enroll_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollMfaCreatedCode is the HTTP code returned for type EnrollMfaCreated -const EnrollMfaCreatedCode int = 201 - -/*EnrollMfaCreated The create request was successful and the resource has been added at the following location - -swagger:response enrollMfaCreated -*/ -type EnrollMfaCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewEnrollMfaCreated creates EnrollMfaCreated with default headers values -func NewEnrollMfaCreated() *EnrollMfaCreated { - - return &EnrollMfaCreated{} -} - -// WithPayload adds the payload to the enroll mfa created response -func (o *EnrollMfaCreated) WithPayload(payload *rest_model.CreateEnvelope) *EnrollMfaCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll mfa created response -func (o *EnrollMfaCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollMfaCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnrollMfaUnauthorizedCode is the HTTP code returned for type EnrollMfaUnauthorized -const EnrollMfaUnauthorizedCode int = 401 - -/*EnrollMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response enrollMfaUnauthorized -*/ -type EnrollMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollMfaUnauthorized creates EnrollMfaUnauthorized with default headers values -func NewEnrollMfaUnauthorized() *EnrollMfaUnauthorized { - - return &EnrollMfaUnauthorized{} -} - -// WithPayload adds the payload to the enroll mfa unauthorized response -func (o *EnrollMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll mfa unauthorized response -func (o *EnrollMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnrollMfaConflictCode is the HTTP code returned for type EnrollMfaConflict -const EnrollMfaConflictCode int = 409 - -/*EnrollMfaConflict The identity is already enrolled in MFA - -swagger:response enrollMfaConflict -*/ -type EnrollMfaConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollMfaConflict creates EnrollMfaConflict with default headers values -func NewEnrollMfaConflict() *EnrollMfaConflict { - - return &EnrollMfaConflict{} -} - -// WithPayload adds the payload to the enroll mfa conflict response -func (o *EnrollMfaConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollMfaConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll mfa conflict response -func (o *EnrollMfaConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollMfaConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/enroll_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/enroll_mfa_urlbuilder.go deleted file mode 100644 index 2b6cd7825..000000000 --- a/rest_client_api_server/operations/current_identity/enroll_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// EnrollMfaURL generates an URL for the enroll mfa operation -type EnrollMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollMfaURL) WithBasePath(bp string) *EnrollMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity.go b/rest_client_api_server/operations/current_identity/get_current_identity.go deleted file mode 100644 index 5977517ed..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCurrentIdentityHandlerFunc turns a function with the right signature into a get current identity handler -type GetCurrentIdentityHandlerFunc func(GetCurrentIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCurrentIdentityHandlerFunc) Handle(params GetCurrentIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetCurrentIdentityHandler interface for that can handle valid get current identity params -type GetCurrentIdentityHandler interface { - Handle(GetCurrentIdentityParams, interface{}) middleware.Responder -} - -// NewGetCurrentIdentity creates a new http.Handler for the get current identity operation -func NewGetCurrentIdentity(ctx *middleware.Context, handler GetCurrentIdentityHandler) *GetCurrentIdentity { - return &GetCurrentIdentity{Context: ctx, Handler: handler} -} - -/* GetCurrentIdentity swagger:route GET /current-identity Current Identity getCurrentIdentity - -Return the current identity - -Returns the identity associated with the API sessions used to issue the current request - -*/ -type GetCurrentIdentity struct { - Context *middleware.Context - Handler GetCurrentIdentityHandler -} - -func (o *GetCurrentIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCurrentIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers.go b/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers.go deleted file mode 100644 index fc634d5ad..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCurrentIdentityEdgeRoutersHandlerFunc turns a function with the right signature into a get current identity edge routers handler -type GetCurrentIdentityEdgeRoutersHandlerFunc func(GetCurrentIdentityEdgeRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCurrentIdentityEdgeRoutersHandlerFunc) Handle(params GetCurrentIdentityEdgeRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetCurrentIdentityEdgeRoutersHandler interface for that can handle valid get current identity edge routers params -type GetCurrentIdentityEdgeRoutersHandler interface { - Handle(GetCurrentIdentityEdgeRoutersParams, interface{}) middleware.Responder -} - -// NewGetCurrentIdentityEdgeRouters creates a new http.Handler for the get current identity edge routers operation -func NewGetCurrentIdentityEdgeRouters(ctx *middleware.Context, handler GetCurrentIdentityEdgeRoutersHandler) *GetCurrentIdentityEdgeRouters { - return &GetCurrentIdentityEdgeRouters{Context: ctx, Handler: handler} -} - -/* GetCurrentIdentityEdgeRouters swagger:route GET /current-identity/edge-routers Current Identity Edge Router getCurrentIdentityEdgeRouters - -Return this list of Edge Routers the identity has access to - -Lists the Edge Routers that the current identity has access to via policies. The data returned -includes their address and online status - - -*/ -type GetCurrentIdentityEdgeRouters struct { - Context *middleware.Context - Handler GetCurrentIdentityEdgeRoutersHandler -} - -func (o *GetCurrentIdentityEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCurrentIdentityEdgeRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_parameters.go b/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_parameters.go deleted file mode 100644 index e915a705b..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetCurrentIdentityEdgeRoutersParams creates a new GetCurrentIdentityEdgeRoutersParams object -// -// There are no default values defined in the spec. -func NewGetCurrentIdentityEdgeRoutersParams() GetCurrentIdentityEdgeRoutersParams { - - return GetCurrentIdentityEdgeRoutersParams{} -} - -// GetCurrentIdentityEdgeRoutersParams contains all the bound params for the get current identity edge routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCurrentIdentityEdgeRouters -type GetCurrentIdentityEdgeRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCurrentIdentityEdgeRoutersParams() beforehand. -func (o *GetCurrentIdentityEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_responses.go b/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_responses.go deleted file mode 100644 index 219bee5f2..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentIdentityEdgeRoutersOKCode is the HTTP code returned for type GetCurrentIdentityEdgeRoutersOK -const GetCurrentIdentityEdgeRoutersOKCode int = 200 - -/*GetCurrentIdentityEdgeRoutersOK A list of edge routers - -swagger:response getCurrentIdentityEdgeRoutersOK -*/ -type GetCurrentIdentityEdgeRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListCurrentIdentityEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentIdentityEdgeRoutersOK creates GetCurrentIdentityEdgeRoutersOK with default headers values -func NewGetCurrentIdentityEdgeRoutersOK() *GetCurrentIdentityEdgeRoutersOK { - - return &GetCurrentIdentityEdgeRoutersOK{} -} - -// WithPayload adds the payload to the get current identity edge routers o k response -func (o *GetCurrentIdentityEdgeRoutersOK) WithPayload(payload *rest_model.ListCurrentIdentityEdgeRoutersEnvelope) *GetCurrentIdentityEdgeRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current identity edge routers o k response -func (o *GetCurrentIdentityEdgeRoutersOK) SetPayload(payload *rest_model.ListCurrentIdentityEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentIdentityEdgeRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCurrentIdentityEdgeRoutersUnauthorizedCode is the HTTP code returned for type GetCurrentIdentityEdgeRoutersUnauthorized -const GetCurrentIdentityEdgeRoutersUnauthorizedCode int = 401 - -/*GetCurrentIdentityEdgeRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getCurrentIdentityEdgeRoutersUnauthorized -*/ -type GetCurrentIdentityEdgeRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentIdentityEdgeRoutersUnauthorized creates GetCurrentIdentityEdgeRoutersUnauthorized with default headers values -func NewGetCurrentIdentityEdgeRoutersUnauthorized() *GetCurrentIdentityEdgeRoutersUnauthorized { - - return &GetCurrentIdentityEdgeRoutersUnauthorized{} -} - -// WithPayload adds the payload to the get current identity edge routers unauthorized response -func (o *GetCurrentIdentityEdgeRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCurrentIdentityEdgeRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current identity edge routers unauthorized response -func (o *GetCurrentIdentityEdgeRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentIdentityEdgeRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_urlbuilder.go b/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_urlbuilder.go deleted file mode 100644 index 9726a82e4..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_edge_routers_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetCurrentIdentityEdgeRoutersURL generates an URL for the get current identity edge routers operation -type GetCurrentIdentityEdgeRoutersURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentIdentityEdgeRoutersURL) WithBasePath(bp string) *GetCurrentIdentityEdgeRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentIdentityEdgeRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCurrentIdentityEdgeRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/edge-routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCurrentIdentityEdgeRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCurrentIdentityEdgeRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCurrentIdentityEdgeRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCurrentIdentityEdgeRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCurrentIdentityEdgeRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCurrentIdentityEdgeRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_parameters.go b/rest_client_api_server/operations/current_identity/get_current_identity_parameters.go deleted file mode 100644 index 8dcd51073..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetCurrentIdentityParams creates a new GetCurrentIdentityParams object -// -// There are no default values defined in the spec. -func NewGetCurrentIdentityParams() GetCurrentIdentityParams { - - return GetCurrentIdentityParams{} -} - -// GetCurrentIdentityParams contains all the bound params for the get current identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCurrentIdentity -type GetCurrentIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCurrentIdentityParams() beforehand. -func (o *GetCurrentIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_responses.go b/rest_client_api_server/operations/current_identity/get_current_identity_responses.go deleted file mode 100644 index 88ab42cd7..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentIdentityOKCode is the HTTP code returned for type GetCurrentIdentityOK -const GetCurrentIdentityOKCode int = 200 - -/*GetCurrentIdentityOK The identity associated with the API Session used to issue the request - -swagger:response getCurrentIdentityOK -*/ -type GetCurrentIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.CurrentIdentityDetailEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentIdentityOK creates GetCurrentIdentityOK with default headers values -func NewGetCurrentIdentityOK() *GetCurrentIdentityOK { - - return &GetCurrentIdentityOK{} -} - -// WithPayload adds the payload to the get current identity o k response -func (o *GetCurrentIdentityOK) WithPayload(payload *rest_model.CurrentIdentityDetailEnvelope) *GetCurrentIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current identity o k response -func (o *GetCurrentIdentityOK) SetPayload(payload *rest_model.CurrentIdentityDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCurrentIdentityUnauthorizedCode is the HTTP code returned for type GetCurrentIdentityUnauthorized -const GetCurrentIdentityUnauthorizedCode int = 401 - -/*GetCurrentIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getCurrentIdentityUnauthorized -*/ -type GetCurrentIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentIdentityUnauthorized creates GetCurrentIdentityUnauthorized with default headers values -func NewGetCurrentIdentityUnauthorized() *GetCurrentIdentityUnauthorized { - - return &GetCurrentIdentityUnauthorized{} -} - -// WithPayload adds the payload to the get current identity unauthorized response -func (o *GetCurrentIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCurrentIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current identity unauthorized response -func (o *GetCurrentIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/get_current_identity_urlbuilder.go b/rest_client_api_server/operations/current_identity/get_current_identity_urlbuilder.go deleted file mode 100644 index 9ba84fac1..000000000 --- a/rest_client_api_server/operations/current_identity/get_current_identity_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetCurrentIdentityURL generates an URL for the get current identity operation -type GetCurrentIdentityURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentIdentityURL) WithBasePath(bp string) *GetCurrentIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCurrentIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCurrentIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCurrentIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCurrentIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCurrentIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCurrentIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCurrentIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/current_identity/verify_mfa.go b/rest_client_api_server/operations/current_identity/verify_mfa.go deleted file mode 100644 index c6971318b..000000000 --- a/rest_client_api_server/operations/current_identity/verify_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// VerifyMfaHandlerFunc turns a function with the right signature into a verify mfa handler -type VerifyMfaHandlerFunc func(VerifyMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn VerifyMfaHandlerFunc) Handle(params VerifyMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// VerifyMfaHandler interface for that can handle valid verify mfa params -type VerifyMfaHandler interface { - Handle(VerifyMfaParams, interface{}) middleware.Responder -} - -// NewVerifyMfa creates a new http.Handler for the verify mfa operation -func NewVerifyMfa(ctx *middleware.Context, handler VerifyMfaHandler) *VerifyMfa { - return &VerifyMfa{Context: ctx, Handler: handler} -} - -/* VerifyMfa swagger:route POST /current-identity/mfa/verify Current Identity MFA verifyMfa - -Complete MFA enrollment by verifying a time based one time token - -Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via `POST /current-identity/mfa`. - - -*/ -type VerifyMfa struct { - Context *middleware.Context - Handler VerifyMfaHandler -} - -func (o *VerifyMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewVerifyMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/current_identity/verify_mfa_parameters.go b/rest_client_api_server/operations/current_identity/verify_mfa_parameters.go deleted file mode 100644 index 18e642116..000000000 --- a/rest_client_api_server/operations/current_identity/verify_mfa_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewVerifyMfaParams creates a new VerifyMfaParams object -// -// There are no default values defined in the spec. -func NewVerifyMfaParams() VerifyMfaParams { - - return VerifyMfaParams{} -} - -// VerifyMfaParams contains all the bound params for the verify mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters verifyMfa -type VerifyMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An MFA validation request - Required: true - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewVerifyMfaParams() beforehand. -func (o *VerifyMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("mfaValidation", "body", "")) - } else { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } else { - res = append(res, errors.Required("mfaValidation", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/current_identity/verify_mfa_responses.go b/rest_client_api_server/operations/current_identity/verify_mfa_responses.go deleted file mode 100644 index 3c8bfc849..000000000 --- a/rest_client_api_server/operations/current_identity/verify_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// VerifyMfaOKCode is the HTTP code returned for type VerifyMfaOK -const VerifyMfaOKCode int = 200 - -/*VerifyMfaOK Base empty response - -swagger:response verifyMfaOK -*/ -type VerifyMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewVerifyMfaOK creates VerifyMfaOK with default headers values -func NewVerifyMfaOK() *VerifyMfaOK { - - return &VerifyMfaOK{} -} - -// WithPayload adds the payload to the verify mfa o k response -func (o *VerifyMfaOK) WithPayload(payload *rest_model.Empty) *VerifyMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify mfa o k response -func (o *VerifyMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyMfaUnauthorizedCode is the HTTP code returned for type VerifyMfaUnauthorized -const VerifyMfaUnauthorizedCode int = 401 - -/*VerifyMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response verifyMfaUnauthorized -*/ -type VerifyMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyMfaUnauthorized creates VerifyMfaUnauthorized with default headers values -func NewVerifyMfaUnauthorized() *VerifyMfaUnauthorized { - - return &VerifyMfaUnauthorized{} -} - -// WithPayload adds the payload to the verify mfa unauthorized response -func (o *VerifyMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify mfa unauthorized response -func (o *VerifyMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyMfaNotFoundCode is the HTTP code returned for type VerifyMfaNotFound -const VerifyMfaNotFoundCode int = 404 - -/*VerifyMfaNotFound The requested resource does not exist - -swagger:response verifyMfaNotFound -*/ -type VerifyMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyMfaNotFound creates VerifyMfaNotFound with default headers values -func NewVerifyMfaNotFound() *VerifyMfaNotFound { - - return &VerifyMfaNotFound{} -} - -// WithPayload adds the payload to the verify mfa not found response -func (o *VerifyMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify mfa not found response -func (o *VerifyMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/current_identity/verify_mfa_urlbuilder.go b/rest_client_api_server/operations/current_identity/verify_mfa_urlbuilder.go deleted file mode 100644 index b71e37dcf..000000000 --- a/rest_client_api_server/operations/current_identity/verify_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// VerifyMfaURL generates an URL for the verify mfa operation -type VerifyMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VerifyMfaURL) WithBasePath(bp string) *VerifyMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VerifyMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *VerifyMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/verify" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *VerifyMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *VerifyMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *VerifyMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on VerifyMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on VerifyMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *VerifyMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/enroll.go b/rest_client_api_server/operations/enroll/enroll.go deleted file mode 100644 index 2ec1f493c..000000000 --- a/rest_client_api_server/operations/enroll/enroll.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollHandlerFunc turns a function with the right signature into a enroll handler -type EnrollHandlerFunc func(EnrollParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollHandlerFunc) Handle(params EnrollParams) middleware.Responder { - return fn(params) -} - -// EnrollHandler interface for that can handle valid enroll params -type EnrollHandler interface { - Handle(EnrollParams) middleware.Responder -} - -// NewEnroll creates a new http.Handler for the enroll operation -func NewEnroll(ctx *middleware.Context, handler EnrollHandler) *Enroll { - return &Enroll{Context: ctx, Handler: handler} -} - -/* Enroll swagger:route POST /enroll Enroll enroll - -Legacy enrollment endpoint - -endpoint defers to the logic in the more specific `enroll/*` endpoints - -*/ -type Enroll struct { - Context *middleware.Context - Handler EnrollHandler -} - -func (o *Enroll) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/enroll_ca.go b/rest_client_api_server/operations/enroll/enroll_ca.go deleted file mode 100644 index 1c52e7781..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ca.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollCaHandlerFunc turns a function with the right signature into a enroll ca handler -type EnrollCaHandlerFunc func(EnrollCaParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollCaHandlerFunc) Handle(params EnrollCaParams) middleware.Responder { - return fn(params) -} - -// EnrollCaHandler interface for that can handle valid enroll ca params -type EnrollCaHandler interface { - Handle(EnrollCaParams) middleware.Responder -} - -// NewEnrollCa creates a new http.Handler for the enroll ca operation -func NewEnrollCa(ctx *middleware.Context, handler EnrollCaHandler) *EnrollCa { - return &EnrollCa{Context: ctx, Handler: handler} -} - -/* EnrollCa swagger:route POST /enroll/ca Enroll enrollCa - -Enroll an identity with a pre-exchanged certificate - -For CA auto enrollment, an identity is not created beforehand. -Instead one will be created during enrollment. The client will present a client certificate that is signed by a -Certificate Authority that has been added and verified (See POST /cas and POST /cas/{id}/verify). - -During this process no CSRs are requires as the client should already be in possession of a valid certificate. - - -*/ -type EnrollCa struct { - Context *middleware.Context - Handler EnrollCaHandler -} - -func (o *EnrollCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollCaParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/enroll_ca_parameters.go b/rest_client_api_server/operations/enroll/enroll_ca_parameters.go deleted file mode 100644 index 488ee28f5..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ca_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewEnrollCaParams creates a new EnrollCaParams object -// -// There are no default values defined in the spec. -func NewEnrollCaParams() EnrollCaParams { - - return EnrollCaParams{} -} - -// EnrollCaParams contains all the bound params for the enroll ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters enrollCa -type EnrollCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollCaParams() beforehand. -func (o *EnrollCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/enroll_ca_responses.go b/rest_client_api_server/operations/enroll/enroll_ca_responses.go deleted file mode 100644 index 909defb71..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ca_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollCaOKCode is the HTTP code returned for type EnrollCaOK -const EnrollCaOKCode int = 200 - -/*EnrollCaOK Base empty response - -swagger:response enrollCaOK -*/ -type EnrollCaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewEnrollCaOK creates EnrollCaOK with default headers values -func NewEnrollCaOK() *EnrollCaOK { - - return &EnrollCaOK{} -} - -// WithPayload adds the payload to the enroll ca o k response -func (o *EnrollCaOK) WithPayload(payload *rest_model.Empty) *EnrollCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll ca o k response -func (o *EnrollCaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnrollCaNotFoundCode is the HTTP code returned for type EnrollCaNotFound -const EnrollCaNotFoundCode int = 404 - -/*EnrollCaNotFound The requested resource does not exist - -swagger:response enrollCaNotFound -*/ -type EnrollCaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollCaNotFound creates EnrollCaNotFound with default headers values -func NewEnrollCaNotFound() *EnrollCaNotFound { - - return &EnrollCaNotFound{} -} - -// WithPayload adds the payload to the enroll ca not found response -func (o *EnrollCaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollCaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll ca not found response -func (o *EnrollCaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollCaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/enroll_ca_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_ca_urlbuilder.go deleted file mode 100644 index e44f6d4df..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ca_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// EnrollCaURL generates an URL for the enroll ca operation -type EnrollCaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollCaURL) WithBasePath(bp string) *EnrollCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll/ca" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/enroll_er_ott.go b/rest_client_api_server/operations/enroll/enroll_er_ott.go deleted file mode 100644 index e78f0443a..000000000 --- a/rest_client_api_server/operations/enroll/enroll_er_ott.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollErOttHandlerFunc turns a function with the right signature into a enroll er ott handler -type EnrollErOttHandlerFunc func(EnrollErOttParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollErOttHandlerFunc) Handle(params EnrollErOttParams) middleware.Responder { - return fn(params) -} - -// EnrollErOttHandler interface for that can handle valid enroll er ott params -type EnrollErOttHandler interface { - Handle(EnrollErOttParams) middleware.Responder -} - -// NewEnrollErOtt creates a new http.Handler for the enroll er ott operation -func NewEnrollErOtt(ctx *middleware.Context, handler EnrollErOttHandler) *EnrollErOtt { - return &EnrollErOtt{Context: ctx, Handler: handler} -} - -/* EnrollErOtt swagger:route POST /enroll/erott Enroll enrollErOtt - -Enroll an edge-router - -Enrolls an edge-router via a one-time-token to establish a certificate based identity. - - -*/ -type EnrollErOtt struct { - Context *middleware.Context - Handler EnrollErOttHandler -} - -func (o *EnrollErOtt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollErOttParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/enroll_er_ott_parameters.go b/rest_client_api_server/operations/enroll/enroll_er_ott_parameters.go deleted file mode 100644 index 420b44d88..000000000 --- a/rest_client_api_server/operations/enroll/enroll_er_ott_parameters.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewEnrollErOttParams creates a new EnrollErOttParams object -// -// There are no default values defined in the spec. -func NewEnrollErOttParams() EnrollErOttParams { - - return EnrollErOttParams{} -} - -// EnrollErOttParams contains all the bound params for the enroll er ott operation -// typically these are obtained from a http.Request -// -// swagger:parameters enrollErOtt -type EnrollErOttParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: query - */ - Token strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollErOttParams() beforehand. -func (o *EnrollErOttParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qToken, qhkToken, _ := qs.GetOK("token") - if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindToken binds and validates parameter Token from query. -func (o *EnrollErOttParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("token", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("token", "query", raw); err != nil { - return err - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("token", "query", "strfmt.UUID", raw) - } - o.Token = *(value.(*strfmt.UUID)) - - if err := o.validateToken(formats); err != nil { - return err - } - - return nil -} - -// validateToken carries on validations for parameter Token -func (o *EnrollErOttParams) validateToken(formats strfmt.Registry) error { - - if err := validate.FormatOf("token", "query", "uuid", o.Token.String(), formats); err != nil { - return err - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/enroll_er_ott_responses.go b/rest_client_api_server/operations/enroll/enroll_er_ott_responses.go deleted file mode 100644 index f1357337c..000000000 --- a/rest_client_api_server/operations/enroll/enroll_er_ott_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollErOttOKCode is the HTTP code returned for type EnrollErOttOK -const EnrollErOttOKCode int = 200 - -/*EnrollErOttOK A response containing the edge routers signed certificates (server chain, server cert, CAs). - -swagger:response enrollErOttOK -*/ -type EnrollErOttOK struct { - - /* - In: Body - */ - Payload *rest_model.EnrollmentCertsEnvelope `json:"body,omitempty"` -} - -// NewEnrollErOttOK creates EnrollErOttOK with default headers values -func NewEnrollErOttOK() *EnrollErOttOK { - - return &EnrollErOttOK{} -} - -// WithPayload adds the payload to the enroll er ott o k response -func (o *EnrollErOttOK) WithPayload(payload *rest_model.EnrollmentCertsEnvelope) *EnrollErOttOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll er ott o k response -func (o *EnrollErOttOK) SetPayload(payload *rest_model.EnrollmentCertsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollErOttOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/enroll_er_ott_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_er_ott_urlbuilder.go deleted file mode 100644 index 68af26e5c..000000000 --- a/rest_client_api_server/operations/enroll/enroll_er_ott_urlbuilder.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// EnrollErOttURL generates an URL for the enroll er ott operation -type EnrollErOttURL struct { - Token strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollErOttURL) WithBasePath(bp string) *EnrollErOttURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollErOttURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollErOttURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll/erott" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - tokenQ := o.Token.String() - if tokenQ != "" { - qs.Set("token", tokenQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollErOttURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollErOttURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollErOttURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollErOttURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollErOttURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollErOttURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott.go b/rest_client_api_server/operations/enroll/enroll_ott.go deleted file mode 100644 index 61b089e28..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollOttHandlerFunc turns a function with the right signature into a enroll ott handler -type EnrollOttHandlerFunc func(EnrollOttParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollOttHandlerFunc) Handle(params EnrollOttParams) middleware.Responder { - return fn(params) -} - -// EnrollOttHandler interface for that can handle valid enroll ott params -type EnrollOttHandler interface { - Handle(EnrollOttParams) middleware.Responder -} - -// NewEnrollOtt creates a new http.Handler for the enroll ott operation -func NewEnrollOtt(ctx *middleware.Context, handler EnrollOttHandler) *EnrollOtt { - return &EnrollOtt{Context: ctx, Handler: handler} -} - -/* EnrollOtt swagger:route POST /enroll/ott Enroll enrollOtt - -Enroll an identity via one-time-token - -Enroll an identity via a one-time-token which is supplied via a query string parameter. This enrollment method -expects a PEM encoded CSRs to be provided for fulfillment. It is up to the enrolling identity to manage the -private key backing the CSR request. - - -*/ -type EnrollOtt struct { - Context *middleware.Context - Handler EnrollOttHandler -} - -func (o *EnrollOtt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollOttParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_ca.go b/rest_client_api_server/operations/enroll/enroll_ott_ca.go deleted file mode 100644 index dc41aabcf..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_ca.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollOttCaHandlerFunc turns a function with the right signature into a enroll ott ca handler -type EnrollOttCaHandlerFunc func(EnrollOttCaParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollOttCaHandlerFunc) Handle(params EnrollOttCaParams) middleware.Responder { - return fn(params) -} - -// EnrollOttCaHandler interface for that can handle valid enroll ott ca params -type EnrollOttCaHandler interface { - Handle(EnrollOttCaParams) middleware.Responder -} - -// NewEnrollOttCa creates a new http.Handler for the enroll ott ca operation -func NewEnrollOttCa(ctx *middleware.Context, handler EnrollOttCaHandler) *EnrollOttCa { - return &EnrollOttCa{Context: ctx, Handler: handler} -} - -/* EnrollOttCa swagger:route POST /enroll/ottca Enroll enrollOttCa - -Enroll an identity via one-time-token with a pre-exchanged client certificate - -Enroll an identity via a one-time-token that also requires a pre-exchanged client certificate to match a -Certificate Authority that has been added and verified (See POST /cas and POST /cas{id}/verify). The client -must present a client certificate signed by CA associated with the enrollment. This enrollment is similar to -CA auto enrollment except that is required the identity to be pre-created. - -As the client certificate has been pre-exchanged there is no CSR input to this enrollment method. - - -*/ -type EnrollOttCa struct { - Context *middleware.Context - Handler EnrollOttCaHandler -} - -func (o *EnrollOttCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollOttCaParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_ca_parameters.go b/rest_client_api_server/operations/enroll/enroll_ott_ca_parameters.go deleted file mode 100644 index cf57a53ca..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_ca_parameters.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewEnrollOttCaParams creates a new EnrollOttCaParams object -// -// There are no default values defined in the spec. -func NewEnrollOttCaParams() EnrollOttCaParams { - - return EnrollOttCaParams{} -} - -// EnrollOttCaParams contains all the bound params for the enroll ott ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters enrollOttCa -type EnrollOttCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: query - */ - Token strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollOttCaParams() beforehand. -func (o *EnrollOttCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qToken, qhkToken, _ := qs.GetOK("token") - if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindToken binds and validates parameter Token from query. -func (o *EnrollOttCaParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("token", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("token", "query", raw); err != nil { - return err - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("token", "query", "strfmt.UUID", raw) - } - o.Token = *(value.(*strfmt.UUID)) - - if err := o.validateToken(formats); err != nil { - return err - } - - return nil -} - -// validateToken carries on validations for parameter Token -func (o *EnrollOttCaParams) validateToken(formats strfmt.Registry) error { - - if err := validate.FormatOf("token", "query", "uuid", o.Token.String(), formats); err != nil { - return err - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_ca_responses.go b/rest_client_api_server/operations/enroll/enroll_ott_ca_responses.go deleted file mode 100644 index a9d89c610..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_ca_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollOttCaOKCode is the HTTP code returned for type EnrollOttCaOK -const EnrollOttCaOKCode int = 200 - -/*EnrollOttCaOK Base empty response - -swagger:response enrollOttCaOK -*/ -type EnrollOttCaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewEnrollOttCaOK creates EnrollOttCaOK with default headers values -func NewEnrollOttCaOK() *EnrollOttCaOK { - - return &EnrollOttCaOK{} -} - -// WithPayload adds the payload to the enroll ott ca o k response -func (o *EnrollOttCaOK) WithPayload(payload *rest_model.Empty) *EnrollOttCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll ott ca o k response -func (o *EnrollOttCaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollOttCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_ca_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_ott_ca_urlbuilder.go deleted file mode 100644 index d753d9d93..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_ca_urlbuilder.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// EnrollOttCaURL generates an URL for the enroll ott ca operation -type EnrollOttCaURL struct { - Token strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollOttCaURL) WithBasePath(bp string) *EnrollOttCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollOttCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollOttCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll/ottca" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - tokenQ := o.Token.String() - if tokenQ != "" { - qs.Set("token", tokenQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollOttCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollOttCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollOttCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollOttCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollOttCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollOttCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_parameters.go b/rest_client_api_server/operations/enroll/enroll_ott_parameters.go deleted file mode 100644 index 7ff21bbaf..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_parameters.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewEnrollOttParams creates a new EnrollOttParams object -// -// There are no default values defined in the spec. -func NewEnrollOttParams() EnrollOttParams { - - return EnrollOttParams{} -} - -// EnrollOttParams contains all the bound params for the enroll ott operation -// typically these are obtained from a http.Request -// -// swagger:parameters enrollOtt -type EnrollOttParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: query - */ - Token strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollOttParams() beforehand. -func (o *EnrollOttParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qToken, qhkToken, _ := qs.GetOK("token") - if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindToken binds and validates parameter Token from query. -func (o *EnrollOttParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("token", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("token", "query", raw); err != nil { - return err - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("token", "query", "strfmt.UUID", raw) - } - o.Token = *(value.(*strfmt.UUID)) - - if err := o.validateToken(formats); err != nil { - return err - } - - return nil -} - -// validateToken carries on validations for parameter Token -func (o *EnrollOttParams) validateToken(formats strfmt.Registry) error { - - if err := validate.FormatOf("token", "query", "uuid", o.Token.String(), formats); err != nil { - return err - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_responses.go b/rest_client_api_server/operations/enroll/enroll_ott_responses.go deleted file mode 100644 index 6d13d952f..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_responses.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollOttOKCode is the HTTP code returned for type EnrollOttOK -const EnrollOttOKCode int = 200 - -/*EnrollOttOK A PEM encoded certificate signed by the internal Ziti CA - -swagger:response enrollOttOK -*/ -type EnrollOttOK struct { - - /* - In: Body - */ - Payload string `json:"body,omitempty"` -} - -// NewEnrollOttOK creates EnrollOttOK with default headers values -func NewEnrollOttOK() *EnrollOttOK { - - return &EnrollOttOK{} -} - -// WithPayload adds the payload to the enroll ott o k response -func (o *EnrollOttOK) WithPayload(payload string) *EnrollOttOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll ott o k response -func (o *EnrollOttOK) SetPayload(payload string) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollOttOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// EnrollOttNotFoundCode is the HTTP code returned for type EnrollOttNotFound -const EnrollOttNotFoundCode int = 404 - -/*EnrollOttNotFound The requested resource does not exist - -swagger:response enrollOttNotFound -*/ -type EnrollOttNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollOttNotFound creates EnrollOttNotFound with default headers values -func NewEnrollOttNotFound() *EnrollOttNotFound { - - return &EnrollOttNotFound{} -} - -// WithPayload adds the payload to the enroll ott not found response -func (o *EnrollOttNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollOttNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll ott not found response -func (o *EnrollOttNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollOttNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/enroll_ott_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_ott_urlbuilder.go deleted file mode 100644 index 9f682945a..000000000 --- a/rest_client_api_server/operations/enroll/enroll_ott_urlbuilder.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// EnrollOttURL generates an URL for the enroll ott operation -type EnrollOttURL struct { - Token strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollOttURL) WithBasePath(bp string) *EnrollOttURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollOttURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollOttURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll/ott" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - tokenQ := o.Token.String() - if tokenQ != "" { - qs.Set("token", tokenQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollOttURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollOttURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollOttURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollOttURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollOttURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollOttURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/enroll_parameters.go b/rest_client_api_server/operations/enroll/enroll_parameters.go deleted file mode 100644 index 6d09a9c41..000000000 --- a/rest_client_api_server/operations/enroll/enroll_parameters.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewEnrollParams creates a new EnrollParams object -// -// There are no default values defined in the spec. -func NewEnrollParams() EnrollParams { - - return EnrollParams{} -} - -// EnrollParams contains all the bound params for the enroll operation -// typically these are obtained from a http.Request -// -// swagger:parameters enroll -type EnrollParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Token *strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollParams() beforehand. -func (o *EnrollParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qToken, qhkToken, _ := qs.GetOK("token") - if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindToken binds and validates parameter Token from query. -func (o *EnrollParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("token", "query", "strfmt.UUID", raw) - } - o.Token = (value.(*strfmt.UUID)) - - if err := o.validateToken(formats); err != nil { - return err - } - - return nil -} - -// validateToken carries on validations for parameter Token -func (o *EnrollParams) validateToken(formats strfmt.Registry) error { - - if err := validate.FormatOf("token", "query", "uuid", o.Token.String(), formats); err != nil { - return err - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/enroll_responses.go b/rest_client_api_server/operations/enroll/enroll_responses.go deleted file mode 100644 index b45635b8b..000000000 --- a/rest_client_api_server/operations/enroll/enroll_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollOKCode is the HTTP code returned for type EnrollOK -const EnrollOKCode int = 200 - -/*EnrollOK Base empty response - -swagger:response enrollOK -*/ -type EnrollOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewEnrollOK creates EnrollOK with default headers values -func NewEnrollOK() *EnrollOK { - - return &EnrollOK{} -} - -// WithPayload adds the payload to the enroll o k response -func (o *EnrollOK) WithPayload(payload *rest_model.Empty) *EnrollOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll o k response -func (o *EnrollOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnrollNotFoundCode is the HTTP code returned for type EnrollNotFound -const EnrollNotFoundCode int = 404 - -/*EnrollNotFound The requested resource does not exist - -swagger:response enrollNotFound -*/ -type EnrollNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollNotFound creates EnrollNotFound with default headers values -func NewEnrollNotFound() *EnrollNotFound { - - return &EnrollNotFound{} -} - -// WithPayload adds the payload to the enroll not found response -func (o *EnrollNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll not found response -func (o *EnrollNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/enroll_urlbuilder.go b/rest_client_api_server/operations/enroll/enroll_urlbuilder.go deleted file mode 100644 index 76e4825ae..000000000 --- a/rest_client_api_server/operations/enroll/enroll_urlbuilder.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// EnrollURL generates an URL for the enroll operation -type EnrollURL struct { - Token *strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollURL) WithBasePath(bp string) *EnrollURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var tokenQ string - if o.Token != nil { - tokenQ = o.Token.String() - } - if tokenQ != "" { - qs.Set("token", tokenQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/ernoll_updb.go b/rest_client_api_server/operations/enroll/ernoll_updb.go deleted file mode 100644 index 08ff403ec..000000000 --- a/rest_client_api_server/operations/enroll/ernoll_updb.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ErnollUpdbHandlerFunc turns a function with the right signature into a ernoll updb handler -type ErnollUpdbHandlerFunc func(ErnollUpdbParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ErnollUpdbHandlerFunc) Handle(params ErnollUpdbParams) middleware.Responder { - return fn(params) -} - -// ErnollUpdbHandler interface for that can handle valid ernoll updb params -type ErnollUpdbHandler interface { - Handle(ErnollUpdbParams) middleware.Responder -} - -// NewErnollUpdb creates a new http.Handler for the ernoll updb operation -func NewErnollUpdb(ctx *middleware.Context, handler ErnollUpdbHandler) *ErnollUpdb { - return &ErnollUpdb{Context: ctx, Handler: handler} -} - -/* ErnollUpdb swagger:route POST /enroll/updb Enroll ernollUpdb - -Enroll an identity via one-time-token - -Enrolls an identity via a one-time-token to establish an initial username and password combination - - -*/ -type ErnollUpdb struct { - Context *middleware.Context - Handler ErnollUpdbHandler -} - -func (o *ErnollUpdb) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewErnollUpdbParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/ernoll_updb_parameters.go b/rest_client_api_server/operations/enroll/ernoll_updb_parameters.go deleted file mode 100644 index 6611c0747..000000000 --- a/rest_client_api_server/operations/enroll/ernoll_updb_parameters.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewErnollUpdbParams creates a new ErnollUpdbParams object -// -// There are no default values defined in the spec. -func NewErnollUpdbParams() ErnollUpdbParams { - - return ErnollUpdbParams{} -} - -// ErnollUpdbParams contains all the bound params for the ernoll updb operation -// typically these are obtained from a http.Request -// -// swagger:parameters ernollUpdb -type ErnollUpdbParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: query - */ - Token strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewErnollUpdbParams() beforehand. -func (o *ErnollUpdbParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qToken, qhkToken, _ := qs.GetOK("token") - if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindToken binds and validates parameter Token from query. -func (o *ErnollUpdbParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("token", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("token", "query", raw); err != nil { - return err - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("token", "query", "strfmt.UUID", raw) - } - o.Token = *(value.(*strfmt.UUID)) - - if err := o.validateToken(formats); err != nil { - return err - } - - return nil -} - -// validateToken carries on validations for parameter Token -func (o *ErnollUpdbParams) validateToken(formats strfmt.Registry) error { - - if err := validate.FormatOf("token", "query", "uuid", o.Token.String(), formats); err != nil { - return err - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/ernoll_updb_responses.go b/rest_client_api_server/operations/enroll/ernoll_updb_responses.go deleted file mode 100644 index a62429e69..000000000 --- a/rest_client_api_server/operations/enroll/ernoll_updb_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ErnollUpdbOKCode is the HTTP code returned for type ErnollUpdbOK -const ErnollUpdbOKCode int = 200 - -/*ErnollUpdbOK Base empty response - -swagger:response ernollUpdbOK -*/ -type ErnollUpdbOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewErnollUpdbOK creates ErnollUpdbOK with default headers values -func NewErnollUpdbOK() *ErnollUpdbOK { - - return &ErnollUpdbOK{} -} - -// WithPayload adds the payload to the ernoll updb o k response -func (o *ErnollUpdbOK) WithPayload(payload *rest_model.Empty) *ErnollUpdbOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the ernoll updb o k response -func (o *ErnollUpdbOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ErnollUpdbOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ErnollUpdbNotFoundCode is the HTTP code returned for type ErnollUpdbNotFound -const ErnollUpdbNotFoundCode int = 404 - -/*ErnollUpdbNotFound The requested resource does not exist - -swagger:response ernollUpdbNotFound -*/ -type ErnollUpdbNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewErnollUpdbNotFound creates ErnollUpdbNotFound with default headers values -func NewErnollUpdbNotFound() *ErnollUpdbNotFound { - - return &ErnollUpdbNotFound{} -} - -// WithPayload adds the payload to the ernoll updb not found response -func (o *ErnollUpdbNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ErnollUpdbNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the ernoll updb not found response -func (o *ErnollUpdbNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ErnollUpdbNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/ernoll_updb_urlbuilder.go b/rest_client_api_server/operations/enroll/ernoll_updb_urlbuilder.go deleted file mode 100644 index 1bd8e0fdb..000000000 --- a/rest_client_api_server/operations/enroll/ernoll_updb_urlbuilder.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// ErnollUpdbURL generates an URL for the ernoll updb operation -type ErnollUpdbURL struct { - Token strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ErnollUpdbURL) WithBasePath(bp string) *ErnollUpdbURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ErnollUpdbURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ErnollUpdbURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll/updb" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - tokenQ := o.Token.String() - if tokenQ != "" { - qs.Set("token", tokenQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ErnollUpdbURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ErnollUpdbURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ErnollUpdbURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ErnollUpdbURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ErnollUpdbURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ErnollUpdbURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/enroll/extend_router_enrollment.go b/rest_client_api_server/operations/enroll/extend_router_enrollment.go deleted file mode 100644 index 7d75dcd06..000000000 --- a/rest_client_api_server/operations/enroll/extend_router_enrollment.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ExtendRouterEnrollmentHandlerFunc turns a function with the right signature into a extend router enrollment handler -type ExtendRouterEnrollmentHandlerFunc func(ExtendRouterEnrollmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ExtendRouterEnrollmentHandlerFunc) Handle(params ExtendRouterEnrollmentParams) middleware.Responder { - return fn(params) -} - -// ExtendRouterEnrollmentHandler interface for that can handle valid extend router enrollment params -type ExtendRouterEnrollmentHandler interface { - Handle(ExtendRouterEnrollmentParams) middleware.Responder -} - -// NewExtendRouterEnrollment creates a new http.Handler for the extend router enrollment operation -func NewExtendRouterEnrollment(ctx *middleware.Context, handler ExtendRouterEnrollmentHandler) *ExtendRouterEnrollment { - return &ExtendRouterEnrollment{Context: ctx, Handler: handler} -} - -/* ExtendRouterEnrollment swagger:route POST /enroll/extend/router Enroll Extend Enrollment extendRouterEnrollment - -Extend the life of a currently enrolled router's certificates - -Allows a router to extend its certificates' expiration date by -using its current and valid client certificate to submit a CSR. This CSR may -be passed in using a new private key, thus allowing private key rotation or swapping. - -After completion any new connections must be made with certificates returned from a 200 OK -response. The previous client certificate is rendered invalid for use with the controller even if it -has not expired. - -This request must be made using the existing, valid, client certificate. - - -*/ -type ExtendRouterEnrollment struct { - Context *middleware.Context - Handler ExtendRouterEnrollmentHandler -} - -func (o *ExtendRouterEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewExtendRouterEnrollmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/enroll/extend_router_enrollment_parameters.go b/rest_client_api_server/operations/enroll/extend_router_enrollment_parameters.go deleted file mode 100644 index 7d56a246a..000000000 --- a/rest_client_api_server/operations/enroll/extend_router_enrollment_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendRouterEnrollmentParams creates a new ExtendRouterEnrollmentParams object -// -// There are no default values defined in the spec. -func NewExtendRouterEnrollmentParams() ExtendRouterEnrollmentParams { - - return ExtendRouterEnrollmentParams{} -} - -// ExtendRouterEnrollmentParams contains all the bound params for the extend router enrollment operation -// typically these are obtained from a http.Request -// -// swagger:parameters extendRouterEnrollment -type ExtendRouterEnrollmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - RouterExtendEnrollmentRequest *rest_model.RouterExtendEnrollmentRequest -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewExtendRouterEnrollmentParams() beforehand. -func (o *ExtendRouterEnrollmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterExtendEnrollmentRequest - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("routerExtendEnrollmentRequest", "body", "")) - } else { - res = append(res, errors.NewParseError("routerExtendEnrollmentRequest", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.RouterExtendEnrollmentRequest = &body - } - } - } else { - res = append(res, errors.Required("routerExtendEnrollmentRequest", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/enroll/extend_router_enrollment_responses.go b/rest_client_api_server/operations/enroll/extend_router_enrollment_responses.go deleted file mode 100644 index 9b449be5f..000000000 --- a/rest_client_api_server/operations/enroll/extend_router_enrollment_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ExtendRouterEnrollmentOKCode is the HTTP code returned for type ExtendRouterEnrollmentOK -const ExtendRouterEnrollmentOKCode int = 200 - -/*ExtendRouterEnrollmentOK A response containg the edge routers new signed certificates (server chain, server cert, CAs). - -swagger:response extendRouterEnrollmentOK -*/ -type ExtendRouterEnrollmentOK struct { - - /* - In: Body - */ - Payload *rest_model.EnrollmentCertsEnvelope `json:"body,omitempty"` -} - -// NewExtendRouterEnrollmentOK creates ExtendRouterEnrollmentOK with default headers values -func NewExtendRouterEnrollmentOK() *ExtendRouterEnrollmentOK { - - return &ExtendRouterEnrollmentOK{} -} - -// WithPayload adds the payload to the extend router enrollment o k response -func (o *ExtendRouterEnrollmentOK) WithPayload(payload *rest_model.EnrollmentCertsEnvelope) *ExtendRouterEnrollmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend router enrollment o k response -func (o *ExtendRouterEnrollmentOK) SetPayload(payload *rest_model.EnrollmentCertsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendRouterEnrollmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ExtendRouterEnrollmentUnauthorizedCode is the HTTP code returned for type ExtendRouterEnrollmentUnauthorized -const ExtendRouterEnrollmentUnauthorizedCode int = 401 - -/*ExtendRouterEnrollmentUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response extendRouterEnrollmentUnauthorized -*/ -type ExtendRouterEnrollmentUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewExtendRouterEnrollmentUnauthorized creates ExtendRouterEnrollmentUnauthorized with default headers values -func NewExtendRouterEnrollmentUnauthorized() *ExtendRouterEnrollmentUnauthorized { - - return &ExtendRouterEnrollmentUnauthorized{} -} - -// WithPayload adds the payload to the extend router enrollment unauthorized response -func (o *ExtendRouterEnrollmentUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ExtendRouterEnrollmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend router enrollment unauthorized response -func (o *ExtendRouterEnrollmentUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendRouterEnrollmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/enroll/extend_router_enrollment_urlbuilder.go b/rest_client_api_server/operations/enroll/extend_router_enrollment_urlbuilder.go deleted file mode 100644 index 7481cb77f..000000000 --- a/rest_client_api_server/operations/enroll/extend_router_enrollment_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enroll - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ExtendRouterEnrollmentURL generates an URL for the extend router enrollment operation -type ExtendRouterEnrollmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendRouterEnrollmentURL) WithBasePath(bp string) *ExtendRouterEnrollmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendRouterEnrollmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ExtendRouterEnrollmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enroll/extend/router" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ExtendRouterEnrollmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ExtendRouterEnrollmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ExtendRouterEnrollmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ExtendRouterEnrollmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ExtendRouterEnrollmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ExtendRouterEnrollmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers.go b/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers.go deleted file mode 100644 index 28f4ba067..000000000 --- a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListExternalJWTSignersHandlerFunc turns a function with the right signature into a list external Jwt signers handler -type ListExternalJWTSignersHandlerFunc func(ListExternalJWTSignersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListExternalJWTSignersHandlerFunc) Handle(params ListExternalJWTSignersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListExternalJWTSignersHandler interface for that can handle valid list external Jwt signers params -type ListExternalJWTSignersHandler interface { - Handle(ListExternalJWTSignersParams, interface{}) middleware.Responder -} - -// NewListExternalJWTSigners creates a new http.Handler for the list external Jwt signers operation -func NewListExternalJWTSigners(ctx *middleware.Context, handler ListExternalJWTSignersHandler) *ListExternalJWTSigners { - return &ListExternalJWTSigners{Context: ctx, Handler: handler} -} - -/* ListExternalJWTSigners swagger:route GET /external-jwt-signers External JWT Signer listExternalJwtSigners - -List Client Authentication External JWT - -Retrieves a list of external JWT signers for authentication - -*/ -type ListExternalJWTSigners struct { - Context *middleware.Context - Handler ListExternalJWTSignersHandler -} - -func (o *ListExternalJWTSigners) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListExternalJWTSignersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_parameters.go b/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_parameters.go deleted file mode 100644 index 3003c947f..000000000 --- a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListExternalJWTSignersParams creates a new ListExternalJWTSignersParams object -// -// There are no default values defined in the spec. -func NewListExternalJWTSignersParams() ListExternalJWTSignersParams { - - return ListExternalJWTSignersParams{} -} - -// ListExternalJWTSignersParams contains all the bound params for the list external Jwt signers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listExternalJwtSigners -type ListExternalJWTSignersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListExternalJWTSignersParams() beforehand. -func (o *ListExternalJWTSignersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListExternalJWTSignersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListExternalJWTSignersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListExternalJWTSignersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_responses.go b/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_responses.go deleted file mode 100644 index 04ab8c1ab..000000000 --- a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListExternalJWTSignersOKCode is the HTTP code returned for type ListExternalJWTSignersOK -const ListExternalJWTSignersOKCode int = 200 - -/*ListExternalJWTSignersOK A list of External JWT Signers - -swagger:response listExternalJwtSignersOK -*/ -type ListExternalJWTSignersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListClientExternalJWTSignersEnvelope `json:"body,omitempty"` -} - -// NewListExternalJWTSignersOK creates ListExternalJWTSignersOK with default headers values -func NewListExternalJWTSignersOK() *ListExternalJWTSignersOK { - - return &ListExternalJWTSignersOK{} -} - -// WithPayload adds the payload to the list external Jwt signers o k response -func (o *ListExternalJWTSignersOK) WithPayload(payload *rest_model.ListClientExternalJWTSignersEnvelope) *ListExternalJWTSignersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list external Jwt signers o k response -func (o *ListExternalJWTSignersOK) SetPayload(payload *rest_model.ListClientExternalJWTSignersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListExternalJWTSignersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListExternalJWTSignersBadRequestCode is the HTTP code returned for type ListExternalJWTSignersBadRequest -const ListExternalJWTSignersBadRequestCode int = 400 - -/*ListExternalJWTSignersBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listExternalJwtSignersBadRequest -*/ -type ListExternalJWTSignersBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListExternalJWTSignersBadRequest creates ListExternalJWTSignersBadRequest with default headers values -func NewListExternalJWTSignersBadRequest() *ListExternalJWTSignersBadRequest { - - return &ListExternalJWTSignersBadRequest{} -} - -// WithPayload adds the payload to the list external Jwt signers bad request response -func (o *ListExternalJWTSignersBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListExternalJWTSignersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list external Jwt signers bad request response -func (o *ListExternalJWTSignersBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListExternalJWTSignersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListExternalJWTSignersUnauthorizedCode is the HTTP code returned for type ListExternalJWTSignersUnauthorized -const ListExternalJWTSignersUnauthorizedCode int = 401 - -/*ListExternalJWTSignersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listExternalJwtSignersUnauthorized -*/ -type ListExternalJWTSignersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListExternalJWTSignersUnauthorized creates ListExternalJWTSignersUnauthorized with default headers values -func NewListExternalJWTSignersUnauthorized() *ListExternalJWTSignersUnauthorized { - - return &ListExternalJWTSignersUnauthorized{} -} - -// WithPayload adds the payload to the list external Jwt signers unauthorized response -func (o *ListExternalJWTSignersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListExternalJWTSignersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list external Jwt signers unauthorized response -func (o *ListExternalJWTSignersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListExternalJWTSignersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_urlbuilder.go b/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_urlbuilder.go deleted file mode 100644 index a3b903c55..000000000 --- a/rest_client_api_server/operations/external_jwt_signer/list_external_jwt_signers_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListExternalJWTSignersURL generates an URL for the list external Jwt signers operation -type ListExternalJWTSignersURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListExternalJWTSignersURL) WithBasePath(bp string) *ListExternalJWTSignersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListExternalJWTSignersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListExternalJWTSignersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListExternalJWTSignersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListExternalJWTSignersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListExternalJWTSignersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListExternalJWTSignersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListExternalJWTSignersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListExternalJWTSignersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/informational/detail_spec.go b/rest_client_api_server/operations/informational/detail_spec.go deleted file mode 100644 index 36e8ec49d..000000000 --- a/rest_client_api_server/operations/informational/detail_spec.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSpecHandlerFunc turns a function with the right signature into a detail spec handler -type DetailSpecHandlerFunc func(DetailSpecParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSpecHandlerFunc) Handle(params DetailSpecParams) middleware.Responder { - return fn(params) -} - -// DetailSpecHandler interface for that can handle valid detail spec params -type DetailSpecHandler interface { - Handle(DetailSpecParams) middleware.Responder -} - -// NewDetailSpec creates a new http.Handler for the detail spec operation -func NewDetailSpec(ctx *middleware.Context, handler DetailSpecHandler) *DetailSpec { - return &DetailSpec{Context: ctx, Handler: handler} -} - -/* DetailSpec swagger:route GET /specs/{id} Informational detailSpec - -Return a single spec resource - -Returns single spec resource embedded within the controller for consumption/documentation/code geneartion - -*/ -type DetailSpec struct { - Context *middleware.Context - Handler DetailSpecHandler -} - -func (o *DetailSpec) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSpecParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/informational/detail_spec_body.go b/rest_client_api_server/operations/informational/detail_spec_body.go deleted file mode 100644 index 79072efc5..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_body.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSpecBodyHandlerFunc turns a function with the right signature into a detail spec body handler -type DetailSpecBodyHandlerFunc func(DetailSpecBodyParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSpecBodyHandlerFunc) Handle(params DetailSpecBodyParams) middleware.Responder { - return fn(params) -} - -// DetailSpecBodyHandler interface for that can handle valid detail spec body params -type DetailSpecBodyHandler interface { - Handle(DetailSpecBodyParams) middleware.Responder -} - -// NewDetailSpecBody creates a new http.Handler for the detail spec body operation -func NewDetailSpecBody(ctx *middleware.Context, handler DetailSpecBodyHandler) *DetailSpecBody { - return &DetailSpecBody{Context: ctx, Handler: handler} -} - -/* DetailSpecBody swagger:route GET /specs/{id}/spec Informational detailSpecBody - -Returns the spec's file - -Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). - -*/ -type DetailSpecBody struct { - Context *middleware.Context - Handler DetailSpecBodyHandler -} - -func (o *DetailSpecBody) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSpecBodyParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/informational/detail_spec_body_parameters.go b/rest_client_api_server/operations/informational/detail_spec_body_parameters.go deleted file mode 100644 index 464799d9e..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_body_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecBodyParams creates a new DetailSpecBodyParams object -// -// There are no default values defined in the spec. -func NewDetailSpecBodyParams() DetailSpecBodyParams { - - return DetailSpecBodyParams{} -} - -// DetailSpecBodyParams contains all the bound params for the detail spec body operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSpecBody -type DetailSpecBodyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSpecBodyParams() beforehand. -func (o *DetailSpecBodyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSpecBodyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/informational/detail_spec_body_responses.go b/rest_client_api_server/operations/informational/detail_spec_body_responses.go deleted file mode 100644 index 6e542a8b8..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_body_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecBodyOKCode is the HTTP code returned for type DetailSpecBodyOK -const DetailSpecBodyOKCode int = 200 - -/*DetailSpecBodyOK Returns the document that represents the specification - -swagger:response detailSpecBodyOK -*/ -type DetailSpecBodyOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSpecBodyEnvelope `json:"body,omitempty"` -} - -// NewDetailSpecBodyOK creates DetailSpecBodyOK with default headers values -func NewDetailSpecBodyOK() *DetailSpecBodyOK { - - return &DetailSpecBodyOK{} -} - -// WithPayload adds the payload to the detail spec body o k response -func (o *DetailSpecBodyOK) WithPayload(payload *rest_model.DetailSpecBodyEnvelope) *DetailSpecBodyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail spec body o k response -func (o *DetailSpecBodyOK) SetPayload(payload *rest_model.DetailSpecBodyEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSpecBodyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/informational/detail_spec_body_urlbuilder.go b/rest_client_api_server/operations/informational/detail_spec_body_urlbuilder.go deleted file mode 100644 index 2efd81160..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_body_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSpecBodyURL generates an URL for the detail spec body operation -type DetailSpecBodyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecBodyURL) WithBasePath(bp string) *DetailSpecBodyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecBodyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSpecBodyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/specs/{id}/spec" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSpecBodyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSpecBodyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSpecBodyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSpecBodyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSpecBodyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSpecBodyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSpecBodyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/informational/detail_spec_parameters.go b/rest_client_api_server/operations/informational/detail_spec_parameters.go deleted file mode 100644 index 3f1b7214d..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecParams creates a new DetailSpecParams object -// -// There are no default values defined in the spec. -func NewDetailSpecParams() DetailSpecParams { - - return DetailSpecParams{} -} - -// DetailSpecParams contains all the bound params for the detail spec operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSpec -type DetailSpecParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSpecParams() beforehand. -func (o *DetailSpecParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSpecParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/informational/detail_spec_responses.go b/rest_client_api_server/operations/informational/detail_spec_responses.go deleted file mode 100644 index 4a481fa3f..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecOKCode is the HTTP code returned for type DetailSpecOK -const DetailSpecOKCode int = 200 - -/*DetailSpecOK A single specification - -swagger:response detailSpecOK -*/ -type DetailSpecOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSpecEnvelope `json:"body,omitempty"` -} - -// NewDetailSpecOK creates DetailSpecOK with default headers values -func NewDetailSpecOK() *DetailSpecOK { - - return &DetailSpecOK{} -} - -// WithPayload adds the payload to the detail spec o k response -func (o *DetailSpecOK) WithPayload(payload *rest_model.DetailSpecEnvelope) *DetailSpecOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail spec o k response -func (o *DetailSpecOK) SetPayload(payload *rest_model.DetailSpecEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSpecOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/informational/detail_spec_urlbuilder.go b/rest_client_api_server/operations/informational/detail_spec_urlbuilder.go deleted file mode 100644 index 25bceda39..000000000 --- a/rest_client_api_server/operations/informational/detail_spec_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSpecURL generates an URL for the detail spec operation -type DetailSpecURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecURL) WithBasePath(bp string) *DetailSpecURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSpecURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/specs/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSpecURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSpecURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSpecURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSpecURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSpecURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSpecURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSpecURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/informational/list_protocols.go b/rest_client_api_server/operations/informational/list_protocols.go deleted file mode 100644 index 040effb38..000000000 --- a/rest_client_api_server/operations/informational/list_protocols.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListProtocolsHandlerFunc turns a function with the right signature into a list protocols handler -type ListProtocolsHandlerFunc func(ListProtocolsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListProtocolsHandlerFunc) Handle(params ListProtocolsParams) middleware.Responder { - return fn(params) -} - -// ListProtocolsHandler interface for that can handle valid list protocols params -type ListProtocolsHandler interface { - Handle(ListProtocolsParams) middleware.Responder -} - -// NewListProtocols creates a new http.Handler for the list protocols operation -func NewListProtocols(ctx *middleware.Context, handler ListProtocolsHandler) *ListProtocols { - return &ListProtocols{Context: ctx, Handler: handler} -} - -/* ListProtocols swagger:route GET /protocols Informational listProtocols - -Return a list of the listening Edge protocols - -*/ -type ListProtocols struct { - Context *middleware.Context - Handler ListProtocolsHandler -} - -func (o *ListProtocols) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListProtocolsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/informational/list_protocols_parameters.go b/rest_client_api_server/operations/informational/list_protocols_parameters.go deleted file mode 100644 index b557d2572..000000000 --- a/rest_client_api_server/operations/informational/list_protocols_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListProtocolsParams creates a new ListProtocolsParams object -// -// There are no default values defined in the spec. -func NewListProtocolsParams() ListProtocolsParams { - - return ListProtocolsParams{} -} - -// ListProtocolsParams contains all the bound params for the list protocols operation -// typically these are obtained from a http.Request -// -// swagger:parameters listProtocols -type ListProtocolsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListProtocolsParams() beforehand. -func (o *ListProtocolsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/informational/list_protocols_responses.go b/rest_client_api_server/operations/informational/list_protocols_responses.go deleted file mode 100644 index 7effd3ba8..000000000 --- a/rest_client_api_server/operations/informational/list_protocols_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListProtocolsOKCode is the HTTP code returned for type ListProtocolsOK -const ListProtocolsOKCode int = 200 - -/*ListProtocolsOK A list of supported Edge protocols - -swagger:response listProtocolsOK -*/ -type ListProtocolsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListProtocolsEnvelope `json:"body,omitempty"` -} - -// NewListProtocolsOK creates ListProtocolsOK with default headers values -func NewListProtocolsOK() *ListProtocolsOK { - - return &ListProtocolsOK{} -} - -// WithPayload adds the payload to the list protocols o k response -func (o *ListProtocolsOK) WithPayload(payload *rest_model.ListProtocolsEnvelope) *ListProtocolsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list protocols o k response -func (o *ListProtocolsOK) SetPayload(payload *rest_model.ListProtocolsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListProtocolsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/informational/list_protocols_urlbuilder.go b/rest_client_api_server/operations/informational/list_protocols_urlbuilder.go deleted file mode 100644 index 374bcdbe6..000000000 --- a/rest_client_api_server/operations/informational/list_protocols_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListProtocolsURL generates an URL for the list protocols operation -type ListProtocolsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListProtocolsURL) WithBasePath(bp string) *ListProtocolsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListProtocolsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListProtocolsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/protocols" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListProtocolsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListProtocolsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListProtocolsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListProtocolsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListProtocolsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListProtocolsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/informational/list_root.go b/rest_client_api_server/operations/informational/list_root.go deleted file mode 100644 index 69984e661..000000000 --- a/rest_client_api_server/operations/informational/list_root.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListRootHandlerFunc turns a function with the right signature into a list root handler -type ListRootHandlerFunc func(ListRootParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListRootHandlerFunc) Handle(params ListRootParams) middleware.Responder { - return fn(params) -} - -// ListRootHandler interface for that can handle valid list root params -type ListRootHandler interface { - Handle(ListRootParams) middleware.Responder -} - -// NewListRoot creates a new http.Handler for the list root operation -func NewListRoot(ctx *middleware.Context, handler ListRootHandler) *ListRoot { - return &ListRoot{Context: ctx, Handler: handler} -} - -/* ListRoot swagger:route GET / Informational listRoot - -Returns version information - -*/ -type ListRoot struct { - Context *middleware.Context - Handler ListRootHandler -} - -func (o *ListRoot) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListRootParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/informational/list_root_parameters.go b/rest_client_api_server/operations/informational/list_root_parameters.go deleted file mode 100644 index 48f3ac32e..000000000 --- a/rest_client_api_server/operations/informational/list_root_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListRootParams creates a new ListRootParams object -// -// There are no default values defined in the spec. -func NewListRootParams() ListRootParams { - - return ListRootParams{} -} - -// ListRootParams contains all the bound params for the list root operation -// typically these are obtained from a http.Request -// -// swagger:parameters listRoot -type ListRootParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListRootParams() beforehand. -func (o *ListRootParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/informational/list_root_responses.go b/rest_client_api_server/operations/informational/list_root_responses.go deleted file mode 100644 index 2612e218d..000000000 --- a/rest_client_api_server/operations/informational/list_root_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListRootOKCode is the HTTP code returned for type ListRootOK -const ListRootOKCode int = 200 - -/*ListRootOK Version information for the controller - -swagger:response listRootOK -*/ -type ListRootOK struct { - - /* - In: Body - */ - Payload *rest_model.ListVersionEnvelope `json:"body,omitempty"` -} - -// NewListRootOK creates ListRootOK with default headers values -func NewListRootOK() *ListRootOK { - - return &ListRootOK{} -} - -// WithPayload adds the payload to the list root o k response -func (o *ListRootOK) WithPayload(payload *rest_model.ListVersionEnvelope) *ListRootOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list root o k response -func (o *ListRootOK) SetPayload(payload *rest_model.ListVersionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListRootOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/informational/list_root_urlbuilder.go b/rest_client_api_server/operations/informational/list_root_urlbuilder.go deleted file mode 100644 index 0f5faaea4..000000000 --- a/rest_client_api_server/operations/informational/list_root_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListRootURL generates an URL for the list root operation -type ListRootURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListRootURL) WithBasePath(bp string) *ListRootURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListRootURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListRootURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListRootURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListRootURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListRootURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListRootURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListRootURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListRootURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/informational/list_specs.go b/rest_client_api_server/operations/informational/list_specs.go deleted file mode 100644 index 4d0b1eaac..000000000 --- a/rest_client_api_server/operations/informational/list_specs.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListSpecsHandlerFunc turns a function with the right signature into a list specs handler -type ListSpecsHandlerFunc func(ListSpecsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListSpecsHandlerFunc) Handle(params ListSpecsParams) middleware.Responder { - return fn(params) -} - -// ListSpecsHandler interface for that can handle valid list specs params -type ListSpecsHandler interface { - Handle(ListSpecsParams) middleware.Responder -} - -// NewListSpecs creates a new http.Handler for the list specs operation -func NewListSpecs(ctx *middleware.Context, handler ListSpecsHandler) *ListSpecs { - return &ListSpecs{Context: ctx, Handler: handler} -} - -/* ListSpecs swagger:route GET /specs Informational listSpecs - -Returns a list of API specs - -Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion - -*/ -type ListSpecs struct { - Context *middleware.Context - Handler ListSpecsHandler -} - -func (o *ListSpecs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListSpecsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/informational/list_specs_parameters.go b/rest_client_api_server/operations/informational/list_specs_parameters.go deleted file mode 100644 index 4774b46eb..000000000 --- a/rest_client_api_server/operations/informational/list_specs_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListSpecsParams creates a new ListSpecsParams object -// -// There are no default values defined in the spec. -func NewListSpecsParams() ListSpecsParams { - - return ListSpecsParams{} -} - -// ListSpecsParams contains all the bound params for the list specs operation -// typically these are obtained from a http.Request -// -// swagger:parameters listSpecs -type ListSpecsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListSpecsParams() beforehand. -func (o *ListSpecsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/informational/list_specs_responses.go b/rest_client_api_server/operations/informational/list_specs_responses.go deleted file mode 100644 index b46b08e3a..000000000 --- a/rest_client_api_server/operations/informational/list_specs_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListSpecsOKCode is the HTTP code returned for type ListSpecsOK -const ListSpecsOKCode int = 200 - -/*ListSpecsOK A list of specifications - -swagger:response listSpecsOK -*/ -type ListSpecsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListSpecsEnvelope `json:"body,omitempty"` -} - -// NewListSpecsOK creates ListSpecsOK with default headers values -func NewListSpecsOK() *ListSpecsOK { - - return &ListSpecsOK{} -} - -// WithPayload adds the payload to the list specs o k response -func (o *ListSpecsOK) WithPayload(payload *rest_model.ListSpecsEnvelope) *ListSpecsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list specs o k response -func (o *ListSpecsOK) SetPayload(payload *rest_model.ListSpecsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSpecsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/informational/list_specs_urlbuilder.go b/rest_client_api_server/operations/informational/list_specs_urlbuilder.go deleted file mode 100644 index ca00d59c1..000000000 --- a/rest_client_api_server/operations/informational/list_specs_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListSpecsURL generates an URL for the list specs operation -type ListSpecsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSpecsURL) WithBasePath(bp string) *ListSpecsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSpecsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListSpecsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/specs" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListSpecsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListSpecsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListSpecsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListSpecsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListSpecsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListSpecsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/informational/list_version.go b/rest_client_api_server/operations/informational/list_version.go deleted file mode 100644 index 62369beda..000000000 --- a/rest_client_api_server/operations/informational/list_version.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListVersionHandlerFunc turns a function with the right signature into a list version handler -type ListVersionHandlerFunc func(ListVersionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListVersionHandlerFunc) Handle(params ListVersionParams) middleware.Responder { - return fn(params) -} - -// ListVersionHandler interface for that can handle valid list version params -type ListVersionHandler interface { - Handle(ListVersionParams) middleware.Responder -} - -// NewListVersion creates a new http.Handler for the list version operation -func NewListVersion(ctx *middleware.Context, handler ListVersionHandler) *ListVersion { - return &ListVersion{Context: ctx, Handler: handler} -} - -/* ListVersion swagger:route GET /version Informational listVersion - -Returns version information - -*/ -type ListVersion struct { - Context *middleware.Context - Handler ListVersionHandler -} - -func (o *ListVersion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListVersionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/informational/list_version_parameters.go b/rest_client_api_server/operations/informational/list_version_parameters.go deleted file mode 100644 index 995c50b01..000000000 --- a/rest_client_api_server/operations/informational/list_version_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListVersionParams creates a new ListVersionParams object -// -// There are no default values defined in the spec. -func NewListVersionParams() ListVersionParams { - - return ListVersionParams{} -} - -// ListVersionParams contains all the bound params for the list version operation -// typically these are obtained from a http.Request -// -// swagger:parameters listVersion -type ListVersionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListVersionParams() beforehand. -func (o *ListVersionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/informational/list_version_responses.go b/rest_client_api_server/operations/informational/list_version_responses.go deleted file mode 100644 index 0d1f6f752..000000000 --- a/rest_client_api_server/operations/informational/list_version_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListVersionOKCode is the HTTP code returned for type ListVersionOK -const ListVersionOKCode int = 200 - -/*ListVersionOK Version information for the controller - -swagger:response listVersionOK -*/ -type ListVersionOK struct { - - /* - In: Body - */ - Payload *rest_model.ListVersionEnvelope `json:"body,omitempty"` -} - -// NewListVersionOK creates ListVersionOK with default headers values -func NewListVersionOK() *ListVersionOK { - - return &ListVersionOK{} -} - -// WithPayload adds the payload to the list version o k response -func (o *ListVersionOK) WithPayload(payload *rest_model.ListVersionEnvelope) *ListVersionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list version o k response -func (o *ListVersionOK) SetPayload(payload *rest_model.ListVersionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListVersionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/informational/list_version_urlbuilder.go b/rest_client_api_server/operations/informational/list_version_urlbuilder.go deleted file mode 100644 index 3324852a6..000000000 --- a/rest_client_api_server/operations/informational/list_version_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListVersionURL generates an URL for the list version operation -type ListVersionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListVersionURL) WithBasePath(bp string) *ListVersionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListVersionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListVersionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/version" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListVersionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListVersionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListVersionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListVersionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListVersionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListVersionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response.go b/rest_client_api_server/operations/posture_checks/create_posture_response.go deleted file mode 100644 index 744c549dd..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreatePostureResponseHandlerFunc turns a function with the right signature into a create posture response handler -type CreatePostureResponseHandlerFunc func(CreatePostureResponseParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreatePostureResponseHandlerFunc) Handle(params CreatePostureResponseParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreatePostureResponseHandler interface for that can handle valid create posture response params -type CreatePostureResponseHandler interface { - Handle(CreatePostureResponseParams, interface{}) middleware.Responder -} - -// NewCreatePostureResponse creates a new http.Handler for the create posture response operation -func NewCreatePostureResponse(ctx *middleware.Context, handler CreatePostureResponseHandler) *CreatePostureResponse { - return &CreatePostureResponse{Context: ctx, Handler: handler} -} - -/* CreatePostureResponse swagger:route POST /posture-response Posture Checks createPostureResponse - -Submit a posture response to a posture query - -Submits posture responses - -*/ -type CreatePostureResponse struct { - Context *middleware.Context - Handler CreatePostureResponseHandler -} - -func (o *CreatePostureResponse) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreatePostureResponseParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk.go deleted file mode 100644 index 916ae7f31..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreatePostureResponseBulkHandlerFunc turns a function with the right signature into a create posture response bulk handler -type CreatePostureResponseBulkHandlerFunc func(CreatePostureResponseBulkParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreatePostureResponseBulkHandlerFunc) Handle(params CreatePostureResponseBulkParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreatePostureResponseBulkHandler interface for that can handle valid create posture response bulk params -type CreatePostureResponseBulkHandler interface { - Handle(CreatePostureResponseBulkParams, interface{}) middleware.Responder -} - -// NewCreatePostureResponseBulk creates a new http.Handler for the create posture response bulk operation -func NewCreatePostureResponseBulk(ctx *middleware.Context, handler CreatePostureResponseBulkHandler) *CreatePostureResponseBulk { - return &CreatePostureResponseBulk{Context: ctx, Handler: handler} -} - -/* CreatePostureResponseBulk swagger:route POST /posture-response-bulk Posture Checks createPostureResponseBulk - -Submit multiple posture responses - -Submits posture responses - -*/ -type CreatePostureResponseBulk struct { - Context *middleware.Context - Handler CreatePostureResponseBulkHandler -} - -func (o *CreatePostureResponseBulk) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreatePostureResponseBulkParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_parameters.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_parameters.go deleted file mode 100644 index c8ff8cc7d..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_parameters.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/openziti/edge/rest_model" -) - -// NewCreatePostureResponseBulkParams creates a new CreatePostureResponseBulkParams object -// -// There are no default values defined in the spec. -func NewCreatePostureResponseBulkParams() CreatePostureResponseBulkParams { - - return CreatePostureResponseBulkParams{} -} - -// CreatePostureResponseBulkParams contains all the bound params for the create posture response bulk operation -// typically these are obtained from a http.Request -// -// swagger:parameters createPostureResponseBulk -type CreatePostureResponseBulkParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A Posture Response - Required: true - In: body - */ - PostureResponse []rest_model.PostureResponseCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreatePostureResponseBulkParams() beforehand. -func (o *CreatePostureResponseBulkParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := rest_model.UnmarshalPostureResponseCreateSlice(r.Body, route.Consumer) - if err != nil { - if err == io.EOF { - err = errors.Required("postureResponse", "body", "") - } - res = append(res, err) - } else { - - // validate array of body objects - for i := range body { - if err := body[i].Validate(route.Formats); err != nil { - res = append(res, err) - break - } - } - - if len(res) == 0 { - o.PostureResponse = body - } - } - } else { - res = append(res, errors.Required("postureResponse", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_responses.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_responses.go deleted file mode 100644 index 51b766811..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreatePostureResponseBulkOKCode is the HTTP code returned for type CreatePostureResponseBulkOK -const CreatePostureResponseBulkOKCode int = 200 - -/*CreatePostureResponseBulkOK Contains a list of services that have had their timers altered - -swagger:response createPostureResponseBulkOK -*/ -type CreatePostureResponseBulkOK struct { - - /* - In: Body - */ - Payload *rest_model.PostureResponseEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureResponseBulkOK creates CreatePostureResponseBulkOK with default headers values -func NewCreatePostureResponseBulkOK() *CreatePostureResponseBulkOK { - - return &CreatePostureResponseBulkOK{} -} - -// WithPayload adds the payload to the create posture response bulk o k response -func (o *CreatePostureResponseBulkOK) WithPayload(payload *rest_model.PostureResponseEnvelope) *CreatePostureResponseBulkOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture response bulk o k response -func (o *CreatePostureResponseBulkOK) SetPayload(payload *rest_model.PostureResponseEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureResponseBulkOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePostureResponseBulkBadRequestCode is the HTTP code returned for type CreatePostureResponseBulkBadRequest -const CreatePostureResponseBulkBadRequestCode int = 400 - -/*CreatePostureResponseBulkBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createPostureResponseBulkBadRequest -*/ -type CreatePostureResponseBulkBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureResponseBulkBadRequest creates CreatePostureResponseBulkBadRequest with default headers values -func NewCreatePostureResponseBulkBadRequest() *CreatePostureResponseBulkBadRequest { - - return &CreatePostureResponseBulkBadRequest{} -} - -// WithPayload adds the payload to the create posture response bulk bad request response -func (o *CreatePostureResponseBulkBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreatePostureResponseBulkBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture response bulk bad request response -func (o *CreatePostureResponseBulkBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureResponseBulkBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePostureResponseBulkUnauthorizedCode is the HTTP code returned for type CreatePostureResponseBulkUnauthorized -const CreatePostureResponseBulkUnauthorizedCode int = 401 - -/*CreatePostureResponseBulkUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createPostureResponseBulkUnauthorized -*/ -type CreatePostureResponseBulkUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureResponseBulkUnauthorized creates CreatePostureResponseBulkUnauthorized with default headers values -func NewCreatePostureResponseBulkUnauthorized() *CreatePostureResponseBulkUnauthorized { - - return &CreatePostureResponseBulkUnauthorized{} -} - -// WithPayload adds the payload to the create posture response bulk unauthorized response -func (o *CreatePostureResponseBulkUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreatePostureResponseBulkUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture response bulk unauthorized response -func (o *CreatePostureResponseBulkUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureResponseBulkUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go b/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go deleted file mode 100644 index 1016dfc87..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_bulk_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreatePostureResponseBulkURL generates an URL for the create posture response bulk operation -type CreatePostureResponseBulkURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePostureResponseBulkURL) WithBasePath(bp string) *CreatePostureResponseBulkURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePostureResponseBulkURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreatePostureResponseBulkURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-response-bulk" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreatePostureResponseBulkURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreatePostureResponseBulkURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreatePostureResponseBulkURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreatePostureResponseBulkURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreatePostureResponseBulkURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreatePostureResponseBulkURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_parameters.go b/rest_client_api_server/operations/posture_checks/create_posture_response_parameters.go deleted file mode 100644 index 1650be0ca..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_parameters.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreatePostureResponseParams creates a new CreatePostureResponseParams object -// -// There are no default values defined in the spec. -func NewCreatePostureResponseParams() CreatePostureResponseParams { - - return CreatePostureResponseParams{} -} - -// CreatePostureResponseParams contains all the bound params for the create posture response operation -// typically these are obtained from a http.Request -// -// swagger:parameters createPostureResponse -type CreatePostureResponseParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A Posture Response - Required: true - In: body - */ - PostureResponse rest_model.PostureResponseCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreatePostureResponseParams() beforehand. -func (o *CreatePostureResponseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := rest_model.UnmarshalPostureResponseCreate(r.Body, route.Consumer) - if err != nil { - if err == io.EOF { - err = errors.Required("postureResponse", "body", "") - } - res = append(res, err) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PostureResponse = body - } - } - } else { - res = append(res, errors.Required("postureResponse", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_responses.go b/rest_client_api_server/operations/posture_checks/create_posture_response_responses.go deleted file mode 100644 index e0036364a..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreatePostureResponseCreatedCode is the HTTP code returned for type CreatePostureResponseCreated -const CreatePostureResponseCreatedCode int = 201 - -/*CreatePostureResponseCreated Contains a list of services that have had their timers altered - -swagger:response createPostureResponseCreated -*/ -type CreatePostureResponseCreated struct { - - /* - In: Body - */ - Payload *rest_model.PostureResponseEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureResponseCreated creates CreatePostureResponseCreated with default headers values -func NewCreatePostureResponseCreated() *CreatePostureResponseCreated { - - return &CreatePostureResponseCreated{} -} - -// WithPayload adds the payload to the create posture response created response -func (o *CreatePostureResponseCreated) WithPayload(payload *rest_model.PostureResponseEnvelope) *CreatePostureResponseCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture response created response -func (o *CreatePostureResponseCreated) SetPayload(payload *rest_model.PostureResponseEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureResponseCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePostureResponseBadRequestCode is the HTTP code returned for type CreatePostureResponseBadRequest -const CreatePostureResponseBadRequestCode int = 400 - -/*CreatePostureResponseBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createPostureResponseBadRequest -*/ -type CreatePostureResponseBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureResponseBadRequest creates CreatePostureResponseBadRequest with default headers values -func NewCreatePostureResponseBadRequest() *CreatePostureResponseBadRequest { - - return &CreatePostureResponseBadRequest{} -} - -// WithPayload adds the payload to the create posture response bad request response -func (o *CreatePostureResponseBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreatePostureResponseBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture response bad request response -func (o *CreatePostureResponseBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureResponseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePostureResponseUnauthorizedCode is the HTTP code returned for type CreatePostureResponseUnauthorized -const CreatePostureResponseUnauthorizedCode int = 401 - -/*CreatePostureResponseUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createPostureResponseUnauthorized -*/ -type CreatePostureResponseUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureResponseUnauthorized creates CreatePostureResponseUnauthorized with default headers values -func NewCreatePostureResponseUnauthorized() *CreatePostureResponseUnauthorized { - - return &CreatePostureResponseUnauthorized{} -} - -// WithPayload adds the payload to the create posture response unauthorized response -func (o *CreatePostureResponseUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreatePostureResponseUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture response unauthorized response -func (o *CreatePostureResponseUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureResponseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/posture_checks/create_posture_response_urlbuilder.go b/rest_client_api_server/operations/posture_checks/create_posture_response_urlbuilder.go deleted file mode 100644 index bf120dc2e..000000000 --- a/rest_client_api_server/operations/posture_checks/create_posture_response_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreatePostureResponseURL generates an URL for the create posture response operation -type CreatePostureResponseURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePostureResponseURL) WithBasePath(bp string) *CreatePostureResponseURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePostureResponseURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreatePostureResponseURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-response" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreatePostureResponseURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreatePostureResponseURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreatePostureResponseURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreatePostureResponseURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreatePostureResponseURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreatePostureResponseURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/service/delete_service.go b/rest_client_api_server/operations/service/delete_service.go deleted file mode 100644 index f0c9736e9..000000000 --- a/rest_client_api_server/operations/service/delete_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteServiceHandlerFunc turns a function with the right signature into a delete service handler -type DeleteServiceHandlerFunc func(DeleteServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteServiceHandlerFunc) Handle(params DeleteServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteServiceHandler interface for that can handle valid delete service params -type DeleteServiceHandler interface { - Handle(DeleteServiceParams, interface{}) middleware.Responder -} - -// NewDeleteService creates a new http.Handler for the delete service operation -func NewDeleteService(ctx *middleware.Context, handler DeleteServiceHandler) *DeleteService { - return &DeleteService{Context: ctx, Handler: handler} -} - -/* DeleteService swagger:route DELETE /services/{id} Service deleteService - -Delete a service - -Delete a service by id. Requires admin access. - -*/ -type DeleteService struct { - Context *middleware.Context - Handler DeleteServiceHandler -} - -func (o *DeleteService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/service/delete_service_parameters.go b/rest_client_api_server/operations/service/delete_service_parameters.go deleted file mode 100644 index 57bc96fc3..000000000 --- a/rest_client_api_server/operations/service/delete_service_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceParams creates a new DeleteServiceParams object -// -// There are no default values defined in the spec. -func NewDeleteServiceParams() DeleteServiceParams { - - return DeleteServiceParams{} -} - -// DeleteServiceParams contains all the bound params for the delete service operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteService -type DeleteServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteServiceParams() beforehand. -func (o *DeleteServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/service/delete_service_responses.go b/rest_client_api_server/operations/service/delete_service_responses.go deleted file mode 100644 index d0ab1373f..000000000 --- a/rest_client_api_server/operations/service/delete_service_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServiceOKCode is the HTTP code returned for type DeleteServiceOK -const DeleteServiceOKCode int = 200 - -/*DeleteServiceOK The delete request was successful and the resource has been removed - -swagger:response deleteServiceOK -*/ -type DeleteServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteServiceOK creates DeleteServiceOK with default headers values -func NewDeleteServiceOK() *DeleteServiceOK { - - return &DeleteServiceOK{} -} - -// WithPayload adds the payload to the delete service o k response -func (o *DeleteServiceOK) WithPayload(payload *rest_model.Empty) *DeleteServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service o k response -func (o *DeleteServiceOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceBadRequestCode is the HTTP code returned for type DeleteServiceBadRequest -const DeleteServiceBadRequestCode int = 400 - -/*DeleteServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteServiceBadRequest -*/ -type DeleteServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceBadRequest creates DeleteServiceBadRequest with default headers values -func NewDeleteServiceBadRequest() *DeleteServiceBadRequest { - - return &DeleteServiceBadRequest{} -} - -// WithPayload adds the payload to the delete service bad request response -func (o *DeleteServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service bad request response -func (o *DeleteServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceUnauthorizedCode is the HTTP code returned for type DeleteServiceUnauthorized -const DeleteServiceUnauthorizedCode int = 401 - -/*DeleteServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteServiceUnauthorized -*/ -type DeleteServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceUnauthorized creates DeleteServiceUnauthorized with default headers values -func NewDeleteServiceUnauthorized() *DeleteServiceUnauthorized { - - return &DeleteServiceUnauthorized{} -} - -// WithPayload adds the payload to the delete service unauthorized response -func (o *DeleteServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service unauthorized response -func (o *DeleteServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceConflictCode is the HTTP code returned for type DeleteServiceConflict -const DeleteServiceConflictCode int = 409 - -/*DeleteServiceConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteServiceConflict -*/ -type DeleteServiceConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceConflict creates DeleteServiceConflict with default headers values -func NewDeleteServiceConflict() *DeleteServiceConflict { - - return &DeleteServiceConflict{} -} - -// WithPayload adds the payload to the delete service conflict response -func (o *DeleteServiceConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service conflict response -func (o *DeleteServiceConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/service/delete_service_urlbuilder.go b/rest_client_api_server/operations/service/delete_service_urlbuilder.go deleted file mode 100644 index d6053efd1..000000000 --- a/rest_client_api_server/operations/service/delete_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteServiceURL generates an URL for the delete service operation -type DeleteServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServiceURL) WithBasePath(bp string) *DeleteServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/service/detail_service.go b/rest_client_api_server/operations/service/detail_service.go deleted file mode 100644 index a2ac0f6b6..000000000 --- a/rest_client_api_server/operations/service/detail_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailServiceHandlerFunc turns a function with the right signature into a detail service handler -type DetailServiceHandlerFunc func(DetailServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailServiceHandlerFunc) Handle(params DetailServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailServiceHandler interface for that can handle valid detail service params -type DetailServiceHandler interface { - Handle(DetailServiceParams, interface{}) middleware.Responder -} - -// NewDetailService creates a new http.Handler for the detail service operation -func NewDetailService(ctx *middleware.Context, handler DetailServiceHandler) *DetailService { - return &DetailService{Context: ctx, Handler: handler} -} - -/* DetailService swagger:route GET /services/{id} Service detailService - -Retrieves a single service - -Retrieves a single service by id. Requires admin access. - -*/ -type DetailService struct { - Context *middleware.Context - Handler DetailServiceHandler -} - -func (o *DetailService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/service/detail_service_parameters.go b/rest_client_api_server/operations/service/detail_service_parameters.go deleted file mode 100644 index 8ea426c12..000000000 --- a/rest_client_api_server/operations/service/detail_service_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailServiceParams creates a new DetailServiceParams object -// -// There are no default values defined in the spec. -func NewDetailServiceParams() DetailServiceParams { - - return DetailServiceParams{} -} - -// DetailServiceParams contains all the bound params for the detail service operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailService -type DetailServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailServiceParams() beforehand. -func (o *DetailServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/service/detail_service_responses.go b/rest_client_api_server/operations/service/detail_service_responses.go deleted file mode 100644 index 9cb28dddd..000000000 --- a/rest_client_api_server/operations/service/detail_service_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailServiceOKCode is the HTTP code returned for type DetailServiceOK -const DetailServiceOKCode int = 200 - -/*DetailServiceOK A single service - -swagger:response detailServiceOK -*/ -type DetailServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailServiceEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceOK creates DetailServiceOK with default headers values -func NewDetailServiceOK() *DetailServiceOK { - - return &DetailServiceOK{} -} - -// WithPayload adds the payload to the detail service o k response -func (o *DetailServiceOK) WithPayload(payload *rest_model.DetailServiceEnvelope) *DetailServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service o k response -func (o *DetailServiceOK) SetPayload(payload *rest_model.DetailServiceEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServiceUnauthorizedCode is the HTTP code returned for type DetailServiceUnauthorized -const DetailServiceUnauthorizedCode int = 401 - -/*DetailServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailServiceUnauthorized -*/ -type DetailServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceUnauthorized creates DetailServiceUnauthorized with default headers values -func NewDetailServiceUnauthorized() *DetailServiceUnauthorized { - - return &DetailServiceUnauthorized{} -} - -// WithPayload adds the payload to the detail service unauthorized response -func (o *DetailServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service unauthorized response -func (o *DetailServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServiceNotFoundCode is the HTTP code returned for type DetailServiceNotFound -const DetailServiceNotFoundCode int = 404 - -/*DetailServiceNotFound The requested resource does not exist - -swagger:response detailServiceNotFound -*/ -type DetailServiceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceNotFound creates DetailServiceNotFound with default headers values -func NewDetailServiceNotFound() *DetailServiceNotFound { - - return &DetailServiceNotFound{} -} - -// WithPayload adds the payload to the detail service not found response -func (o *DetailServiceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServiceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service not found response -func (o *DetailServiceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/service/detail_service_urlbuilder.go b/rest_client_api_server/operations/service/detail_service_urlbuilder.go deleted file mode 100644 index 198b9eec9..000000000 --- a/rest_client_api_server/operations/service/detail_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailServiceURL generates an URL for the detail service operation -type DetailServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServiceURL) WithBasePath(bp string) *DetailServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/service/list_service_terminators.go b/rest_client_api_server/operations/service/list_service_terminators.go deleted file mode 100644 index 8e2915d2b..000000000 --- a/rest_client_api_server/operations/service/list_service_terminators.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceTerminatorsHandlerFunc turns a function with the right signature into a list service terminators handler -type ListServiceTerminatorsHandlerFunc func(ListServiceTerminatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceTerminatorsHandlerFunc) Handle(params ListServiceTerminatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceTerminatorsHandler interface for that can handle valid list service terminators params -type ListServiceTerminatorsHandler interface { - Handle(ListServiceTerminatorsParams, interface{}) middleware.Responder -} - -// NewListServiceTerminators creates a new http.Handler for the list service terminators operation -func NewListServiceTerminators(ctx *middleware.Context, handler ListServiceTerminatorsHandler) *ListServiceTerminators { - return &ListServiceTerminators{Context: ctx, Handler: handler} -} - -/* ListServiceTerminators swagger:route GET /services/{id}/terminators Service listServiceTerminators - -List of terminators assigned to a service - -Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. - - -*/ -type ListServiceTerminators struct { - Context *middleware.Context - Handler ListServiceTerminatorsHandler -} - -func (o *ListServiceTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceTerminatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/service/list_service_terminators_parameters.go b/rest_client_api_server/operations/service/list_service_terminators_parameters.go deleted file mode 100644 index fc0a459fc..000000000 --- a/rest_client_api_server/operations/service/list_service_terminators_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceTerminatorsParams creates a new ListServiceTerminatorsParams object -// -// There are no default values defined in the spec. -func NewListServiceTerminatorsParams() ListServiceTerminatorsParams { - - return ListServiceTerminatorsParams{} -} - -// ListServiceTerminatorsParams contains all the bound params for the list service terminators operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceTerminators -type ListServiceTerminatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceTerminatorsParams() beforehand. -func (o *ListServiceTerminatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceTerminatorsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceTerminatorsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceTerminatorsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceTerminatorsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_client_api_server/operations/service/list_service_terminators_responses.go b/rest_client_api_server/operations/service/list_service_terminators_responses.go deleted file mode 100644 index ed988f67c..000000000 --- a/rest_client_api_server/operations/service/list_service_terminators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceTerminatorsOKCode is the HTTP code returned for type ListServiceTerminatorsOK -const ListServiceTerminatorsOKCode int = 200 - -/*ListServiceTerminatorsOK A list of terminators - -swagger:response listServiceTerminatorsOK -*/ -type ListServiceTerminatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListClientTerminatorsEnvelope `json:"body,omitempty"` -} - -// NewListServiceTerminatorsOK creates ListServiceTerminatorsOK with default headers values -func NewListServiceTerminatorsOK() *ListServiceTerminatorsOK { - - return &ListServiceTerminatorsOK{} -} - -// WithPayload adds the payload to the list service terminators o k response -func (o *ListServiceTerminatorsOK) WithPayload(payload *rest_model.ListClientTerminatorsEnvelope) *ListServiceTerminatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service terminators o k response -func (o *ListServiceTerminatorsOK) SetPayload(payload *rest_model.ListClientTerminatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceTerminatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceTerminatorsBadRequestCode is the HTTP code returned for type ListServiceTerminatorsBadRequest -const ListServiceTerminatorsBadRequestCode int = 400 - -/*ListServiceTerminatorsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceTerminatorsBadRequest -*/ -type ListServiceTerminatorsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceTerminatorsBadRequest creates ListServiceTerminatorsBadRequest with default headers values -func NewListServiceTerminatorsBadRequest() *ListServiceTerminatorsBadRequest { - - return &ListServiceTerminatorsBadRequest{} -} - -// WithPayload adds the payload to the list service terminators bad request response -func (o *ListServiceTerminatorsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceTerminatorsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service terminators bad request response -func (o *ListServiceTerminatorsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceTerminatorsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceTerminatorsUnauthorizedCode is the HTTP code returned for type ListServiceTerminatorsUnauthorized -const ListServiceTerminatorsUnauthorizedCode int = 401 - -/*ListServiceTerminatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceTerminatorsUnauthorized -*/ -type ListServiceTerminatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceTerminatorsUnauthorized creates ListServiceTerminatorsUnauthorized with default headers values -func NewListServiceTerminatorsUnauthorized() *ListServiceTerminatorsUnauthorized { - - return &ListServiceTerminatorsUnauthorized{} -} - -// WithPayload adds the payload to the list service terminators unauthorized response -func (o *ListServiceTerminatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceTerminatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service terminators unauthorized response -func (o *ListServiceTerminatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceTerminatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/service/list_service_terminators_urlbuilder.go b/rest_client_api_server/operations/service/list_service_terminators_urlbuilder.go deleted file mode 100644 index 9ec053598..000000000 --- a/rest_client_api_server/operations/service/list_service_terminators_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceTerminatorsURL generates an URL for the list service terminators operation -type ListServiceTerminatorsURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceTerminatorsURL) WithBasePath(bp string) *ListServiceTerminatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceTerminatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceTerminatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/terminators" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceTerminatorsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceTerminatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceTerminatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceTerminatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceTerminatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceTerminatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceTerminatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/service/list_services.go b/rest_client_api_server/operations/service/list_services.go deleted file mode 100644 index bda7c15c0..000000000 --- a/rest_client_api_server/operations/service/list_services.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServicesHandlerFunc turns a function with the right signature into a list services handler -type ListServicesHandlerFunc func(ListServicesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServicesHandlerFunc) Handle(params ListServicesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServicesHandler interface for that can handle valid list services params -type ListServicesHandler interface { - Handle(ListServicesParams, interface{}) middleware.Responder -} - -// NewListServices creates a new http.Handler for the list services operation -func NewListServices(ctx *middleware.Context, handler ListServicesHandler) *ListServices { - return &ListServices{Context: ctx, Handler: handler} -} - -/* ListServices swagger:route GET /services Service listServices - -List services - -Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServices struct { - Context *middleware.Context - Handler ListServicesHandler -} - -func (o *ListServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServicesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/service/list_services_parameters.go b/rest_client_api_server/operations/service/list_services_parameters.go deleted file mode 100644 index 764ba0615..000000000 --- a/rest_client_api_server/operations/service/list_services_parameters.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicesParams creates a new ListServicesParams object -// -// There are no default values defined in the spec. -func NewListServicesParams() ListServicesParams { - - return ListServicesParams{} -} - -// ListServicesParams contains all the bound params for the list services operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServices -type ListServicesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /* - In: query - Collection Format: multi - */ - RoleFilter []string - /* - In: query - */ - RoleSemantic *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServicesParams() beforehand. -func (o *ListServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qRoleFilter, qhkRoleFilter, _ := qs.GetOK("roleFilter") - if err := o.bindRoleFilter(qRoleFilter, qhkRoleFilter, route.Formats); err != nil { - res = append(res, err) - } - - qRoleSemantic, qhkRoleSemantic, _ := qs.GetOK("roleSemantic") - if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServicesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServicesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServicesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindRoleFilter binds and validates array parameter RoleFilter from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *ListServicesParams) bindRoleFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - roleFilterIC := rawData - if len(roleFilterIC) == 0 { - return nil - } - - var roleFilterIR []string - for _, roleFilterIV := range roleFilterIC { - roleFilterI := roleFilterIV - - roleFilterIR = append(roleFilterIR, roleFilterI) - } - - o.RoleFilter = roleFilterIR - - return nil -} - -// bindRoleSemantic binds and validates parameter RoleSemantic from query. -func (o *ListServicesParams) bindRoleSemantic(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RoleSemantic = &raw - - return nil -} diff --git a/rest_client_api_server/operations/service/list_services_responses.go b/rest_client_api_server/operations/service/list_services_responses.go deleted file mode 100644 index 60198800e..000000000 --- a/rest_client_api_server/operations/service/list_services_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServicesOKCode is the HTTP code returned for type ListServicesOK -const ListServicesOKCode int = 200 - -/*ListServicesOK A list of services - -swagger:response listServicesOK -*/ -type ListServicesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicesEnvelope `json:"body,omitempty"` -} - -// NewListServicesOK creates ListServicesOK with default headers values -func NewListServicesOK() *ListServicesOK { - - return &ListServicesOK{} -} - -// WithPayload adds the payload to the list services o k response -func (o *ListServicesOK) WithPayload(payload *rest_model.ListServicesEnvelope) *ListServicesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list services o k response -func (o *ListServicesOK) SetPayload(payload *rest_model.ListServicesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicesBadRequestCode is the HTTP code returned for type ListServicesBadRequest -const ListServicesBadRequestCode int = 400 - -/*ListServicesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServicesBadRequest -*/ -type ListServicesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicesBadRequest creates ListServicesBadRequest with default headers values -func NewListServicesBadRequest() *ListServicesBadRequest { - - return &ListServicesBadRequest{} -} - -// WithPayload adds the payload to the list services bad request response -func (o *ListServicesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list services bad request response -func (o *ListServicesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicesUnauthorizedCode is the HTTP code returned for type ListServicesUnauthorized -const ListServicesUnauthorizedCode int = 401 - -/*ListServicesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServicesUnauthorized -*/ -type ListServicesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicesUnauthorized creates ListServicesUnauthorized with default headers values -func NewListServicesUnauthorized() *ListServicesUnauthorized { - - return &ListServicesUnauthorized{} -} - -// WithPayload adds the payload to the list services unauthorized response -func (o *ListServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list services unauthorized response -func (o *ListServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/service/list_services_urlbuilder.go b/rest_client_api_server/operations/service/list_services_urlbuilder.go deleted file mode 100644 index 52a8da443..000000000 --- a/rest_client_api_server/operations/service/list_services_urlbuilder.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListServicesURL generates an URL for the list services operation -type ListServicesURL struct { - Filter *string - Limit *int64 - Offset *int64 - RoleFilter []string - RoleSemantic *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicesURL) WithBasePath(bp string) *ListServicesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServicesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var roleFilterIR []string - for _, roleFilterI := range o.RoleFilter { - roleFilterIS := roleFilterI - if roleFilterIS != "" { - roleFilterIR = append(roleFilterIR, roleFilterIS) - } - } - - roleFilter := swag.JoinByFormat(roleFilterIR, "multi") - - for _, qsv := range roleFilter { - qs.Add("roleFilter", qsv) - } - - var roleSemanticQ string - if o.RoleSemantic != nil { - roleSemanticQ = *o.RoleSemantic - } - if roleSemanticQ != "" { - qs.Set("roleSemantic", roleSemanticQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServicesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServicesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServicesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServicesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServicesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServicesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/service/patch_service.go b/rest_client_api_server/operations/service/patch_service.go deleted file mode 100644 index 688c0549a..000000000 --- a/rest_client_api_server/operations/service/patch_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchServiceHandlerFunc turns a function with the right signature into a patch service handler -type PatchServiceHandlerFunc func(PatchServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchServiceHandlerFunc) Handle(params PatchServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchServiceHandler interface for that can handle valid patch service params -type PatchServiceHandler interface { - Handle(PatchServiceParams, interface{}) middleware.Responder -} - -// NewPatchService creates a new http.Handler for the patch service operation -func NewPatchService(ctx *middleware.Context, handler PatchServiceHandler) *PatchService { - return &PatchService{Context: ctx, Handler: handler} -} - -/* PatchService swagger:route PATCH /services/{id} Service patchService - -Update the supplied fields on a service - -Update the supplied fields on a service. Requires admin access. - -*/ -type PatchService struct { - Context *middleware.Context - Handler PatchServiceHandler -} - -func (o *PatchService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/service/patch_service_parameters.go b/rest_client_api_server/operations/service/patch_service_parameters.go deleted file mode 100644 index a740fcee3..000000000 --- a/rest_client_api_server/operations/service/patch_service_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServiceParams creates a new PatchServiceParams object -// -// There are no default values defined in the spec. -func NewPatchServiceParams() PatchServiceParams { - - return PatchServiceParams{} -} - -// PatchServiceParams contains all the bound params for the patch service operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchService -type PatchServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service patch object - Required: true - In: body - */ - Service *rest_model.ServicePatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchServiceParams() beforehand. -func (o *PatchServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServicePatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("service", "body", "")) - } else { - res = append(res, errors.NewParseError("service", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Service = &body - } - } - } else { - res = append(res, errors.Required("service", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/service/patch_service_responses.go b/rest_client_api_server/operations/service/patch_service_responses.go deleted file mode 100644 index 3af129fb0..000000000 --- a/rest_client_api_server/operations/service/patch_service_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchServiceOKCode is the HTTP code returned for type PatchServiceOK -const PatchServiceOKCode int = 200 - -/*PatchServiceOK The patch request was successful and the resource has been altered - -swagger:response patchServiceOK -*/ -type PatchServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchServiceOK creates PatchServiceOK with default headers values -func NewPatchServiceOK() *PatchServiceOK { - - return &PatchServiceOK{} -} - -// WithPayload adds the payload to the patch service o k response -func (o *PatchServiceOK) WithPayload(payload *rest_model.Empty) *PatchServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service o k response -func (o *PatchServiceOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceBadRequestCode is the HTTP code returned for type PatchServiceBadRequest -const PatchServiceBadRequestCode int = 400 - -/*PatchServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchServiceBadRequest -*/ -type PatchServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceBadRequest creates PatchServiceBadRequest with default headers values -func NewPatchServiceBadRequest() *PatchServiceBadRequest { - - return &PatchServiceBadRequest{} -} - -// WithPayload adds the payload to the patch service bad request response -func (o *PatchServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service bad request response -func (o *PatchServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceUnauthorizedCode is the HTTP code returned for type PatchServiceUnauthorized -const PatchServiceUnauthorizedCode int = 401 - -/*PatchServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchServiceUnauthorized -*/ -type PatchServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceUnauthorized creates PatchServiceUnauthorized with default headers values -func NewPatchServiceUnauthorized() *PatchServiceUnauthorized { - - return &PatchServiceUnauthorized{} -} - -// WithPayload adds the payload to the patch service unauthorized response -func (o *PatchServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service unauthorized response -func (o *PatchServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceNotFoundCode is the HTTP code returned for type PatchServiceNotFound -const PatchServiceNotFoundCode int = 404 - -/*PatchServiceNotFound The requested resource does not exist - -swagger:response patchServiceNotFound -*/ -type PatchServiceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceNotFound creates PatchServiceNotFound with default headers values -func NewPatchServiceNotFound() *PatchServiceNotFound { - - return &PatchServiceNotFound{} -} - -// WithPayload adds the payload to the patch service not found response -func (o *PatchServiceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service not found response -func (o *PatchServiceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/service/patch_service_urlbuilder.go b/rest_client_api_server/operations/service/patch_service_urlbuilder.go deleted file mode 100644 index 53041ee9d..000000000 --- a/rest_client_api_server/operations/service/patch_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchServiceURL generates an URL for the patch service operation -type PatchServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceURL) WithBasePath(bp string) *PatchServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/service/update_service.go b/rest_client_api_server/operations/service/update_service.go deleted file mode 100644 index 47798263b..000000000 --- a/rest_client_api_server/operations/service/update_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateServiceHandlerFunc turns a function with the right signature into a update service handler -type UpdateServiceHandlerFunc func(UpdateServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateServiceHandlerFunc) Handle(params UpdateServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateServiceHandler interface for that can handle valid update service params -type UpdateServiceHandler interface { - Handle(UpdateServiceParams, interface{}) middleware.Responder -} - -// NewUpdateService creates a new http.Handler for the update service operation -func NewUpdateService(ctx *middleware.Context, handler UpdateServiceHandler) *UpdateService { - return &UpdateService{Context: ctx, Handler: handler} -} - -/* UpdateService swagger:route PUT /services/{id} Service updateService - -Update all fields on a service - -Update all fields on a service by id. Requires admin access. - -*/ -type UpdateService struct { - Context *middleware.Context - Handler UpdateServiceHandler -} - -func (o *UpdateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/service/update_service_parameters.go b/rest_client_api_server/operations/service/update_service_parameters.go deleted file mode 100644 index 586d36082..000000000 --- a/rest_client_api_server/operations/service/update_service_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServiceParams creates a new UpdateServiceParams object -// -// There are no default values defined in the spec. -func NewUpdateServiceParams() UpdateServiceParams { - - return UpdateServiceParams{} -} - -// UpdateServiceParams contains all the bound params for the update service operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateService -type UpdateServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service update object - Required: true - In: body - */ - Service *rest_model.ServiceUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateServiceParams() beforehand. -func (o *UpdateServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("service", "body", "")) - } else { - res = append(res, errors.NewParseError("service", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Service = &body - } - } - } else { - res = append(res, errors.Required("service", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/service/update_service_responses.go b/rest_client_api_server/operations/service/update_service_responses.go deleted file mode 100644 index ae8d559c8..000000000 --- a/rest_client_api_server/operations/service/update_service_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServiceOKCode is the HTTP code returned for type UpdateServiceOK -const UpdateServiceOKCode int = 200 - -/*UpdateServiceOK The update request was successful and the resource has been altered - -swagger:response updateServiceOK -*/ -type UpdateServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateServiceOK creates UpdateServiceOK with default headers values -func NewUpdateServiceOK() *UpdateServiceOK { - - return &UpdateServiceOK{} -} - -// WithPayload adds the payload to the update service o k response -func (o *UpdateServiceOK) WithPayload(payload *rest_model.Empty) *UpdateServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service o k response -func (o *UpdateServiceOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceBadRequestCode is the HTTP code returned for type UpdateServiceBadRequest -const UpdateServiceBadRequestCode int = 400 - -/*UpdateServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateServiceBadRequest -*/ -type UpdateServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceBadRequest creates UpdateServiceBadRequest with default headers values -func NewUpdateServiceBadRequest() *UpdateServiceBadRequest { - - return &UpdateServiceBadRequest{} -} - -// WithPayload adds the payload to the update service bad request response -func (o *UpdateServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service bad request response -func (o *UpdateServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceUnauthorizedCode is the HTTP code returned for type UpdateServiceUnauthorized -const UpdateServiceUnauthorizedCode int = 401 - -/*UpdateServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateServiceUnauthorized -*/ -type UpdateServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceUnauthorized creates UpdateServiceUnauthorized with default headers values -func NewUpdateServiceUnauthorized() *UpdateServiceUnauthorized { - - return &UpdateServiceUnauthorized{} -} - -// WithPayload adds the payload to the update service unauthorized response -func (o *UpdateServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service unauthorized response -func (o *UpdateServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceNotFoundCode is the HTTP code returned for type UpdateServiceNotFound -const UpdateServiceNotFoundCode int = 404 - -/*UpdateServiceNotFound The requested resource does not exist - -swagger:response updateServiceNotFound -*/ -type UpdateServiceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceNotFound creates UpdateServiceNotFound with default headers values -func NewUpdateServiceNotFound() *UpdateServiceNotFound { - - return &UpdateServiceNotFound{} -} - -// WithPayload adds the payload to the update service not found response -func (o *UpdateServiceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service not found response -func (o *UpdateServiceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/service/update_service_urlbuilder.go b/rest_client_api_server/operations/service/update_service_urlbuilder.go deleted file mode 100644 index 6b2e77fef..000000000 --- a/rest_client_api_server/operations/service/update_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateServiceURL generates an URL for the update service operation -type UpdateServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceURL) WithBasePath(bp string) *UpdateServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/session/create_session.go b/rest_client_api_server/operations/session/create_session.go deleted file mode 100644 index 030410cbd..000000000 --- a/rest_client_api_server/operations/session/create_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateSessionHandlerFunc turns a function with the right signature into a create session handler -type CreateSessionHandlerFunc func(CreateSessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateSessionHandlerFunc) Handle(params CreateSessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateSessionHandler interface for that can handle valid create session params -type CreateSessionHandler interface { - Handle(CreateSessionParams, interface{}) middleware.Responder -} - -// NewCreateSession creates a new http.Handler for the create session operation -func NewCreateSession(ctx *middleware.Context, handler CreateSessionHandler) *CreateSession { - return &CreateSession{Context: ctx, Handler: handler} -} - -/* CreateSession swagger:route POST /sessions Session createSession - -Create a session resource - -Create a session resource. - -*/ -type CreateSession struct { - Context *middleware.Context - Handler CreateSessionHandler -} - -func (o *CreateSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateSessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/session/create_session_parameters.go b/rest_client_api_server/operations/session/create_session_parameters.go deleted file mode 100644 index a430d971b..000000000 --- a/rest_client_api_server/operations/session/create_session_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateSessionParams creates a new CreateSessionParams object -// -// There are no default values defined in the spec. -func NewCreateSessionParams() CreateSessionParams { - - return CreateSessionParams{} -} - -// CreateSessionParams contains all the bound params for the create session operation -// typically these are obtained from a http.Request -// -// swagger:parameters createSession -type CreateSessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A session to create - Required: true - In: body - */ - Session *rest_model.SessionCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateSessionParams() beforehand. -func (o *CreateSessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.SessionCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("session", "body", "")) - } else { - res = append(res, errors.NewParseError("session", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Session = &body - } - } - } else { - res = append(res, errors.Required("session", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/session/create_session_responses.go b/rest_client_api_server/operations/session/create_session_responses.go deleted file mode 100644 index 131b8bb27..000000000 --- a/rest_client_api_server/operations/session/create_session_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateSessionCreatedCode is the HTTP code returned for type CreateSessionCreated -const CreateSessionCreatedCode int = 201 - -/*CreateSessionCreated The create request was successful and the resource has been added at the following location - -swagger:response createSessionCreated -*/ -type CreateSessionCreated struct { - - /* - In: Body - */ - Payload *rest_model.SessionCreateEnvelope `json:"body,omitempty"` -} - -// NewCreateSessionCreated creates CreateSessionCreated with default headers values -func NewCreateSessionCreated() *CreateSessionCreated { - - return &CreateSessionCreated{} -} - -// WithPayload adds the payload to the create session created response -func (o *CreateSessionCreated) WithPayload(payload *rest_model.SessionCreateEnvelope) *CreateSessionCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create session created response -func (o *CreateSessionCreated) SetPayload(payload *rest_model.SessionCreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSessionCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSessionBadRequestCode is the HTTP code returned for type CreateSessionBadRequest -const CreateSessionBadRequestCode int = 400 - -/*CreateSessionBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createSessionBadRequest -*/ -type CreateSessionBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateSessionBadRequest creates CreateSessionBadRequest with default headers values -func NewCreateSessionBadRequest() *CreateSessionBadRequest { - - return &CreateSessionBadRequest{} -} - -// WithPayload adds the payload to the create session bad request response -func (o *CreateSessionBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateSessionBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create session bad request response -func (o *CreateSessionBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSessionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSessionUnauthorizedCode is the HTTP code returned for type CreateSessionUnauthorized -const CreateSessionUnauthorizedCode int = 401 - -/*CreateSessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createSessionUnauthorized -*/ -type CreateSessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateSessionUnauthorized creates CreateSessionUnauthorized with default headers values -func NewCreateSessionUnauthorized() *CreateSessionUnauthorized { - - return &CreateSessionUnauthorized{} -} - -// WithPayload adds the payload to the create session unauthorized response -func (o *CreateSessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateSessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create session unauthorized response -func (o *CreateSessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/session/create_session_urlbuilder.go b/rest_client_api_server/operations/session/create_session_urlbuilder.go deleted file mode 100644 index af91aff66..000000000 --- a/rest_client_api_server/operations/session/create_session_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateSessionURL generates an URL for the create session operation -type CreateSessionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateSessionURL) WithBasePath(bp string) *CreateSessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateSessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateSessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateSessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateSessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateSessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateSessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateSessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateSessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/session/delete_session.go b/rest_client_api_server/operations/session/delete_session.go deleted file mode 100644 index 4194e0dbc..000000000 --- a/rest_client_api_server/operations/session/delete_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteSessionHandlerFunc turns a function with the right signature into a delete session handler -type DeleteSessionHandlerFunc func(DeleteSessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteSessionHandlerFunc) Handle(params DeleteSessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteSessionHandler interface for that can handle valid delete session params -type DeleteSessionHandler interface { - Handle(DeleteSessionParams, interface{}) middleware.Responder -} - -// NewDeleteSession creates a new http.Handler for the delete session operation -func NewDeleteSession(ctx *middleware.Context, handler DeleteSessionHandler) *DeleteSession { - return &DeleteSession{Context: ctx, Handler: handler} -} - -/* DeleteSession swagger:route DELETE /sessions/{id} Session deleteSession - -Delete a session - -Delete a session by id. - -*/ -type DeleteSession struct { - Context *middleware.Context - Handler DeleteSessionHandler -} - -func (o *DeleteSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteSessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/session/delete_session_parameters.go b/rest_client_api_server/operations/session/delete_session_parameters.go deleted file mode 100644 index 89278b349..000000000 --- a/rest_client_api_server/operations/session/delete_session_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteSessionParams creates a new DeleteSessionParams object -// -// There are no default values defined in the spec. -func NewDeleteSessionParams() DeleteSessionParams { - - return DeleteSessionParams{} -} - -// DeleteSessionParams contains all the bound params for the delete session operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteSession -type DeleteSessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteSessionParams() beforehand. -func (o *DeleteSessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteSessionParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/session/delete_session_responses.go b/rest_client_api_server/operations/session/delete_session_responses.go deleted file mode 100644 index 3b9d8156d..000000000 --- a/rest_client_api_server/operations/session/delete_session_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteSessionOKCode is the HTTP code returned for type DeleteSessionOK -const DeleteSessionOKCode int = 200 - -/*DeleteSessionOK The delete request was successful and the resource has been removed - -swagger:response deleteSessionOK -*/ -type DeleteSessionOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteSessionOK creates DeleteSessionOK with default headers values -func NewDeleteSessionOK() *DeleteSessionOK { - - return &DeleteSessionOK{} -} - -// WithPayload adds the payload to the delete session o k response -func (o *DeleteSessionOK) WithPayload(payload *rest_model.Empty) *DeleteSessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session o k response -func (o *DeleteSessionOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteSessionBadRequestCode is the HTTP code returned for type DeleteSessionBadRequest -const DeleteSessionBadRequestCode int = 400 - -/*DeleteSessionBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteSessionBadRequest -*/ -type DeleteSessionBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteSessionBadRequest creates DeleteSessionBadRequest with default headers values -func NewDeleteSessionBadRequest() *DeleteSessionBadRequest { - - return &DeleteSessionBadRequest{} -} - -// WithPayload adds the payload to the delete session bad request response -func (o *DeleteSessionBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteSessionBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session bad request response -func (o *DeleteSessionBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteSessionUnauthorizedCode is the HTTP code returned for type DeleteSessionUnauthorized -const DeleteSessionUnauthorizedCode int = 401 - -/*DeleteSessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteSessionUnauthorized -*/ -type DeleteSessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteSessionUnauthorized creates DeleteSessionUnauthorized with default headers values -func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized { - - return &DeleteSessionUnauthorized{} -} - -// WithPayload adds the payload to the delete session unauthorized response -func (o *DeleteSessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteSessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session unauthorized response -func (o *DeleteSessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteSessionConflictCode is the HTTP code returned for type DeleteSessionConflict -const DeleteSessionConflictCode int = 409 - -/*DeleteSessionConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteSessionConflict -*/ -type DeleteSessionConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteSessionConflict creates DeleteSessionConflict with default headers values -func NewDeleteSessionConflict() *DeleteSessionConflict { - - return &DeleteSessionConflict{} -} - -// WithPayload adds the payload to the delete session conflict response -func (o *DeleteSessionConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteSessionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session conflict response -func (o *DeleteSessionConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/session/delete_session_urlbuilder.go b/rest_client_api_server/operations/session/delete_session_urlbuilder.go deleted file mode 100644 index 08823a182..000000000 --- a/rest_client_api_server/operations/session/delete_session_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteSessionURL generates an URL for the delete session operation -type DeleteSessionURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteSessionURL) WithBasePath(bp string) *DeleteSessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteSessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteSessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteSessionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteSessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteSessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteSessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteSessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteSessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteSessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/session/detail_session.go b/rest_client_api_server/operations/session/detail_session.go deleted file mode 100644 index 42e87f9ed..000000000 --- a/rest_client_api_server/operations/session/detail_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSessionHandlerFunc turns a function with the right signature into a detail session handler -type DetailSessionHandlerFunc func(DetailSessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSessionHandlerFunc) Handle(params DetailSessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailSessionHandler interface for that can handle valid detail session params -type DetailSessionHandler interface { - Handle(DetailSessionParams, interface{}) middleware.Responder -} - -// NewDetailSession creates a new http.Handler for the detail session operation -func NewDetailSession(ctx *middleware.Context, handler DetailSessionHandler) *DetailSession { - return &DetailSession{Context: ctx, Handler: handler} -} - -/* DetailSession swagger:route GET /sessions/{id} Session detailSession - -Retrieves a single session - -Retrieves a single session by id. - -*/ -type DetailSession struct { - Context *middleware.Context - Handler DetailSessionHandler -} - -func (o *DetailSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/session/detail_session_parameters.go b/rest_client_api_server/operations/session/detail_session_parameters.go deleted file mode 100644 index 3d15a3c8a..000000000 --- a/rest_client_api_server/operations/session/detail_session_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSessionParams creates a new DetailSessionParams object -// -// There are no default values defined in the spec. -func NewDetailSessionParams() DetailSessionParams { - - return DetailSessionParams{} -} - -// DetailSessionParams contains all the bound params for the detail session operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSession -type DetailSessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSessionParams() beforehand. -func (o *DetailSessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSessionParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_client_api_server/operations/session/detail_session_responses.go b/rest_client_api_server/operations/session/detail_session_responses.go deleted file mode 100644 index 1f6e732f8..000000000 --- a/rest_client_api_server/operations/session/detail_session_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSessionOKCode is the HTTP code returned for type DetailSessionOK -const DetailSessionOKCode int = 200 - -/*DetailSessionOK A single session - -swagger:response detailSessionOK -*/ -type DetailSessionOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSessionEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionOK creates DetailSessionOK with default headers values -func NewDetailSessionOK() *DetailSessionOK { - - return &DetailSessionOK{} -} - -// WithPayload adds the payload to the detail session o k response -func (o *DetailSessionOK) WithPayload(payload *rest_model.DetailSessionEnvelope) *DetailSessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session o k response -func (o *DetailSessionOK) SetPayload(payload *rest_model.DetailSessionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailSessionUnauthorizedCode is the HTTP code returned for type DetailSessionUnauthorized -const DetailSessionUnauthorizedCode int = 401 - -/*DetailSessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailSessionUnauthorized -*/ -type DetailSessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionUnauthorized creates DetailSessionUnauthorized with default headers values -func NewDetailSessionUnauthorized() *DetailSessionUnauthorized { - - return &DetailSessionUnauthorized{} -} - -// WithPayload adds the payload to the detail session unauthorized response -func (o *DetailSessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailSessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session unauthorized response -func (o *DetailSessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailSessionNotFoundCode is the HTTP code returned for type DetailSessionNotFound -const DetailSessionNotFoundCode int = 404 - -/*DetailSessionNotFound The requested resource does not exist - -swagger:response detailSessionNotFound -*/ -type DetailSessionNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionNotFound creates DetailSessionNotFound with default headers values -func NewDetailSessionNotFound() *DetailSessionNotFound { - - return &DetailSessionNotFound{} -} - -// WithPayload adds the payload to the detail session not found response -func (o *DetailSessionNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailSessionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session not found response -func (o *DetailSessionNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/session/detail_session_urlbuilder.go b/rest_client_api_server/operations/session/detail_session_urlbuilder.go deleted file mode 100644 index e5ac89e6f..000000000 --- a/rest_client_api_server/operations/session/detail_session_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSessionURL generates an URL for the detail session operation -type DetailSessionURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSessionURL) WithBasePath(bp string) *DetailSessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSessionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/session/list_sessions.go b/rest_client_api_server/operations/session/list_sessions.go deleted file mode 100644 index e9a80e967..000000000 --- a/rest_client_api_server/operations/session/list_sessions.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListSessionsHandlerFunc turns a function with the right signature into a list sessions handler -type ListSessionsHandlerFunc func(ListSessionsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListSessionsHandlerFunc) Handle(params ListSessionsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListSessionsHandler interface for that can handle valid list sessions params -type ListSessionsHandler interface { - Handle(ListSessionsParams, interface{}) middleware.Responder -} - -// NewListSessions creates a new http.Handler for the list sessions operation -func NewListSessions(ctx *middleware.Context, handler ListSessionsHandler) *ListSessions { - return &ListSessions{Context: ctx, Handler: handler} -} - -/* ListSessions swagger:route GET /sessions Session listSessions - -List sessions - -Retrieves a list of active sessions resources; supports filtering, sorting, and pagination. - -Sessions are tied to an API session and are moved when an API session times out or logs out. Active sessions -(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active. - - -*/ -type ListSessions struct { - Context *middleware.Context - Handler ListSessionsHandler -} - -func (o *ListSessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListSessionsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/session/list_sessions_parameters.go b/rest_client_api_server/operations/session/list_sessions_parameters.go deleted file mode 100644 index 02d7cfd02..000000000 --- a/rest_client_api_server/operations/session/list_sessions_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListSessionsParams creates a new ListSessionsParams object -// -// There are no default values defined in the spec. -func NewListSessionsParams() ListSessionsParams { - - return ListSessionsParams{} -} - -// ListSessionsParams contains all the bound params for the list sessions operation -// typically these are obtained from a http.Request -// -// swagger:parameters listSessions -type ListSessionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListSessionsParams() beforehand. -func (o *ListSessionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListSessionsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListSessionsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListSessionsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_client_api_server/operations/session/list_sessions_responses.go b/rest_client_api_server/operations/session/list_sessions_responses.go deleted file mode 100644 index 6f309a0ba..000000000 --- a/rest_client_api_server/operations/session/list_sessions_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListSessionsOKCode is the HTTP code returned for type ListSessionsOK -const ListSessionsOKCode int = 200 - -/*ListSessionsOK A list of sessions - -swagger:response listSessionsOK -*/ -type ListSessionsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListSessionsEnvelope `json:"body,omitempty"` -} - -// NewListSessionsOK creates ListSessionsOK with default headers values -func NewListSessionsOK() *ListSessionsOK { - - return &ListSessionsOK{} -} - -// WithPayload adds the payload to the list sessions o k response -func (o *ListSessionsOK) WithPayload(payload *rest_model.ListSessionsEnvelope) *ListSessionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list sessions o k response -func (o *ListSessionsOK) SetPayload(payload *rest_model.ListSessionsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSessionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListSessionsBadRequestCode is the HTTP code returned for type ListSessionsBadRequest -const ListSessionsBadRequestCode int = 400 - -/*ListSessionsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listSessionsBadRequest -*/ -type ListSessionsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListSessionsBadRequest creates ListSessionsBadRequest with default headers values -func NewListSessionsBadRequest() *ListSessionsBadRequest { - - return &ListSessionsBadRequest{} -} - -// WithPayload adds the payload to the list sessions bad request response -func (o *ListSessionsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListSessionsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list sessions bad request response -func (o *ListSessionsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSessionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListSessionsUnauthorizedCode is the HTTP code returned for type ListSessionsUnauthorized -const ListSessionsUnauthorizedCode int = 401 - -/*ListSessionsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listSessionsUnauthorized -*/ -type ListSessionsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListSessionsUnauthorized creates ListSessionsUnauthorized with default headers values -func NewListSessionsUnauthorized() *ListSessionsUnauthorized { - - return &ListSessionsUnauthorized{} -} - -// WithPayload adds the payload to the list sessions unauthorized response -func (o *ListSessionsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListSessionsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list sessions unauthorized response -func (o *ListSessionsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSessionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_client_api_server/operations/session/list_sessions_urlbuilder.go b/rest_client_api_server/operations/session/list_sessions_urlbuilder.go deleted file mode 100644 index 44828f953..000000000 --- a/rest_client_api_server/operations/session/list_sessions_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListSessionsURL generates an URL for the list sessions operation -type ListSessionsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSessionsURL) WithBasePath(bp string) *ListSessionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSessionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListSessionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListSessionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListSessionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListSessionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListSessionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListSessionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListSessionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/well_known/list_well_known_cas.go b/rest_client_api_server/operations/well_known/list_well_known_cas.go deleted file mode 100644 index 2ea570959..000000000 --- a/rest_client_api_server/operations/well_known/list_well_known_cas.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListWellKnownCasHandlerFunc turns a function with the right signature into a list well known cas handler -type ListWellKnownCasHandlerFunc func(ListWellKnownCasParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListWellKnownCasHandlerFunc) Handle(params ListWellKnownCasParams) middleware.Responder { - return fn(params) -} - -// ListWellKnownCasHandler interface for that can handle valid list well known cas params -type ListWellKnownCasHandler interface { - Handle(ListWellKnownCasParams) middleware.Responder -} - -// NewListWellKnownCas creates a new http.Handler for the list well known cas operation -func NewListWellKnownCas(ctx *middleware.Context, handler ListWellKnownCasHandler) *ListWellKnownCas { - return &ListWellKnownCas{Context: ctx, Handler: handler} -} - -/* ListWellKnownCas swagger:route GET /.well-known/est/cacerts Well Known listWellKnownCas - -Get CA Cert Store - -This endpoint is used during enrollments to bootstrap trust between enrolling clients and the Ziti Edge API. -This endpoint returns a base64 encoded PKCS7 store. The content can be base64 decoded and parsed by any library -that supports parsing PKCS7 stores. - - -*/ -type ListWellKnownCas struct { - Context *middleware.Context - Handler ListWellKnownCasHandler -} - -func (o *ListWellKnownCas) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListWellKnownCasParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_client_api_server/operations/well_known/list_well_known_cas_parameters.go b/rest_client_api_server/operations/well_known/list_well_known_cas_parameters.go deleted file mode 100644 index b224fac21..000000000 --- a/rest_client_api_server/operations/well_known/list_well_known_cas_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListWellKnownCasParams creates a new ListWellKnownCasParams object -// -// There are no default values defined in the spec. -func NewListWellKnownCasParams() ListWellKnownCasParams { - - return ListWellKnownCasParams{} -} - -// ListWellKnownCasParams contains all the bound params for the list well known cas operation -// typically these are obtained from a http.Request -// -// swagger:parameters listWellKnownCas -type ListWellKnownCasParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListWellKnownCasParams() beforehand. -func (o *ListWellKnownCasParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_client_api_server/operations/well_known/list_well_known_cas_responses.go b/rest_client_api_server/operations/well_known/list_well_known_cas_responses.go deleted file mode 100644 index 8916972f6..000000000 --- a/rest_client_api_server/operations/well_known/list_well_known_cas_responses.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// ListWellKnownCasOKCode is the HTTP code returned for type ListWellKnownCasOK -const ListWellKnownCasOKCode int = 200 - -/*ListWellKnownCasOK A base64 encoded PKCS7 store - -swagger:response listWellKnownCasOK -*/ -type ListWellKnownCasOK struct { - - /* - In: Body - */ - Payload string `json:"body,omitempty"` -} - -// NewListWellKnownCasOK creates ListWellKnownCasOK with default headers values -func NewListWellKnownCasOK() *ListWellKnownCasOK { - - return &ListWellKnownCasOK{} -} - -// WithPayload adds the payload to the list well known cas o k response -func (o *ListWellKnownCasOK) WithPayload(payload string) *ListWellKnownCasOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list well known cas o k response -func (o *ListWellKnownCasOK) SetPayload(payload string) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListWellKnownCasOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} diff --git a/rest_client_api_server/operations/well_known/list_well_known_cas_urlbuilder.go b/rest_client_api_server/operations/well_known/list_well_known_cas_urlbuilder.go deleted file mode 100644 index 36615de83..000000000 --- a/rest_client_api_server/operations/well_known/list_well_known_cas_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package well_known - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListWellKnownCasURL generates an URL for the list well known cas operation -type ListWellKnownCasURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListWellKnownCasURL) WithBasePath(bp string) *ListWellKnownCasURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListWellKnownCasURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListWellKnownCasURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/.well-known/est/cacerts" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/client/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListWellKnownCasURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListWellKnownCasURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListWellKnownCasURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListWellKnownCasURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListWellKnownCasURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListWellKnownCasURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_client_api_server/operations/ziti_edge_client_api.go b/rest_client_api_server/operations/ziti_edge_client_api.go deleted file mode 100644 index 4a358107b..000000000 --- a/rest_client_api_server/operations/ziti_edge_client_api.go +++ /dev/null @@ -1,1048 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/openziti/edge/rest_client_api_server/operations/authentication" - "github.com/openziti/edge/rest_client_api_server/operations/current_api_session" - "github.com/openziti/edge/rest_client_api_server/operations/current_identity" - "github.com/openziti/edge/rest_client_api_server/operations/enroll" - "github.com/openziti/edge/rest_client_api_server/operations/external_jwt_signer" - "github.com/openziti/edge/rest_client_api_server/operations/informational" - "github.com/openziti/edge/rest_client_api_server/operations/posture_checks" - "github.com/openziti/edge/rest_client_api_server/operations/service" - "github.com/openziti/edge/rest_client_api_server/operations/session" - "github.com/openziti/edge/rest_client_api_server/operations/well_known" -) - -// NewZitiEdgeClientAPI creates a new ZitiEdgeClient instance -func NewZitiEdgeClientAPI(spec *loads.Document) *ZitiEdgeClientAPI { - return &ZitiEdgeClientAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - ApplicationPkcs10Consumer: runtime.ConsumerFunc(func(r io.Reader, target interface{}) error { - return errors.NotImplemented("applicationPkcs10 consumer has not yet been implemented") - }), - ApplicationXPemFileConsumer: runtime.ConsumerFunc(func(r io.Reader, target interface{}) error { - return errors.NotImplemented("applicationXPemFile consumer has not yet been implemented") - }), - JSONConsumer: runtime.JSONConsumer(), - TxtConsumer: runtime.TextConsumer(), - - ApplicationPkcs7MimeProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationPkcs7Mime producer has not yet been implemented") - }), - ApplicationXPemFileProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationXPemFile producer has not yet been implemented") - }), - ApplicationXX509UserCertProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationXX509UserCert producer has not yet been implemented") - }), - BinProducer: runtime.ByteStreamProducer(), - JSONProducer: runtime.JSONProducer(), - TextYamlProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("textYaml producer has not yet been implemented") - }), - - CurrentAPISessionDeleteCurrentAPISessionHandler: current_api_session.DeleteCurrentAPISessionHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISession has not yet been implemented") - }), - AuthenticationAuthenticateHandler: authentication.AuthenticateHandlerFunc(func(params authentication.AuthenticateParams) middleware.Responder { - return middleware.NotImplemented("operation authentication.Authenticate has not yet been implemented") - }), - AuthenticationAuthenticateMfaHandler: authentication.AuthenticateMfaHandlerFunc(func(params authentication.AuthenticateMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authentication.AuthenticateMfa has not yet been implemented") - }), - CurrentAPISessionCreateCurrentAPISessionCertificateHandler: current_api_session.CreateCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.CreateCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.CreateCurrentAPISessionCertificate has not yet been implemented") - }), - CurrentIdentityCreateMfaRecoveryCodesHandler: current_identity.CreateMfaRecoveryCodesHandlerFunc(func(params current_identity.CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.CreateMfaRecoveryCodes has not yet been implemented") - }), - PostureChecksCreatePostureResponseHandler: posture_checks.CreatePostureResponseHandlerFunc(func(params posture_checks.CreatePostureResponseParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.CreatePostureResponse has not yet been implemented") - }), - PostureChecksCreatePostureResponseBulkHandler: posture_checks.CreatePostureResponseBulkHandlerFunc(func(params posture_checks.CreatePostureResponseBulkParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.CreatePostureResponseBulk has not yet been implemented") - }), - SessionCreateSessionHandler: session.CreateSessionHandlerFunc(func(params session.CreateSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.CreateSession has not yet been implemented") - }), - CurrentAPISessionDeleteCurrentAPISessionCertificateHandler: current_api_session.DeleteCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISessionCertificate has not yet been implemented") - }), - CurrentIdentityDeleteMfaHandler: current_identity.DeleteMfaHandlerFunc(func(params current_identity.DeleteMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DeleteMfa has not yet been implemented") - }), - ServiceDeleteServiceHandler: service.DeleteServiceHandlerFunc(func(params service.DeleteServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DeleteService has not yet been implemented") - }), - SessionDeleteSessionHandler: session.DeleteSessionHandlerFunc(func(params session.DeleteSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DeleteSession has not yet been implemented") - }), - CurrentAPISessionDetailCurrentAPISessionCertificateHandler: current_api_session.DetailCurrentAPISessionCertificateHandlerFunc(func(params current_api_session.DetailCurrentAPISessionCertificateParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DetailCurrentAPISessionCertificate has not yet been implemented") - }), - CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler: current_api_session.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DetailCurrentIdentityAuthenticator has not yet been implemented") - }), - CurrentIdentityDetailMfaHandler: current_identity.DetailMfaHandlerFunc(func(params current_identity.DetailMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfa has not yet been implemented") - }), - CurrentIdentityDetailMfaQrCodeHandler: current_identity.DetailMfaQrCodeHandlerFunc(func(params current_identity.DetailMfaQrCodeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaQrCode has not yet been implemented") - }), - CurrentIdentityDetailMfaRecoveryCodesHandler: current_identity.DetailMfaRecoveryCodesHandlerFunc(func(params current_identity.DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaRecoveryCodes has not yet been implemented") - }), - ServiceDetailServiceHandler: service.DetailServiceHandlerFunc(func(params service.DetailServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DetailService has not yet been implemented") - }), - SessionDetailSessionHandler: session.DetailSessionHandlerFunc(func(params session.DetailSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DetailSession has not yet been implemented") - }), - InformationalDetailSpecHandler: informational.DetailSpecHandlerFunc(func(params informational.DetailSpecParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpec has not yet been implemented") - }), - InformationalDetailSpecBodyHandler: informational.DetailSpecBodyHandlerFunc(func(params informational.DetailSpecBodyParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpecBody has not yet been implemented") - }), - EnrollEnrollHandler: enroll.EnrollHandlerFunc(func(params enroll.EnrollParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.Enroll has not yet been implemented") - }), - EnrollEnrollCaHandler: enroll.EnrollCaHandlerFunc(func(params enroll.EnrollCaParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollCa has not yet been implemented") - }), - EnrollEnrollErOttHandler: enroll.EnrollErOttHandlerFunc(func(params enroll.EnrollErOttParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollErOtt has not yet been implemented") - }), - CurrentIdentityEnrollMfaHandler: current_identity.EnrollMfaHandlerFunc(func(params current_identity.EnrollMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.EnrollMfa has not yet been implemented") - }), - EnrollEnrollOttHandler: enroll.EnrollOttHandlerFunc(func(params enroll.EnrollOttParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollOtt has not yet been implemented") - }), - EnrollEnrollOttCaHandler: enroll.EnrollOttCaHandlerFunc(func(params enroll.EnrollOttCaParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.EnrollOttCa has not yet been implemented") - }), - EnrollErnollUpdbHandler: enroll.ErnollUpdbHandlerFunc(func(params enroll.ErnollUpdbParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.ErnollUpdb has not yet been implemented") - }), - CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler: current_api_session.ExtendCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendCurrentIdentityAuthenticator has not yet been implemented") - }), - EnrollExtendRouterEnrollmentHandler: enroll.ExtendRouterEnrollmentHandlerFunc(func(params enroll.ExtendRouterEnrollmentParams) middleware.Responder { - return middleware.NotImplemented("operation enroll.ExtendRouterEnrollment has not yet been implemented") - }), - CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler: current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendVerifyCurrentIdentityAuthenticator has not yet been implemented") - }), - CurrentAPISessionGetCurrentAPISessionHandler: current_api_session.GetCurrentAPISessionHandlerFunc(func(params current_api_session.GetCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.GetCurrentAPISession has not yet been implemented") - }), - CurrentIdentityGetCurrentIdentityHandler: current_identity.GetCurrentIdentityHandlerFunc(func(params current_identity.GetCurrentIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.GetCurrentIdentity has not yet been implemented") - }), - CurrentIdentityGetCurrentIdentityEdgeRoutersHandler: current_identity.GetCurrentIdentityEdgeRoutersHandlerFunc(func(params current_identity.GetCurrentIdentityEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.GetCurrentIdentityEdgeRouters has not yet been implemented") - }), - CurrentAPISessionListCurrentAPISessionCertificatesHandler: current_api_session.ListCurrentAPISessionCertificatesHandlerFunc(func(params current_api_session.ListCurrentAPISessionCertificatesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListCurrentAPISessionCertificates has not yet been implemented") - }), - CurrentAPISessionListCurrentIdentityAuthenticatorsHandler: current_api_session.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params current_api_session.ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListCurrentIdentityAuthenticators has not yet been implemented") - }), - ExternalJWTSignerListExternalJWTSignersHandler: external_jwt_signer.ListExternalJWTSignersHandlerFunc(func(params external_jwt_signer.ListExternalJWTSignersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.ListExternalJWTSigners has not yet been implemented") - }), - InformationalListProtocolsHandler: informational.ListProtocolsHandlerFunc(func(params informational.ListProtocolsParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListProtocols has not yet been implemented") - }), - InformationalListRootHandler: informational.ListRootHandlerFunc(func(params informational.ListRootParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListRoot has not yet been implemented") - }), - ServiceListServiceTerminatorsHandler: service.ListServiceTerminatorsHandlerFunc(func(params service.ListServiceTerminatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceTerminators has not yet been implemented") - }), - CurrentAPISessionListServiceUpdatesHandler: current_api_session.ListServiceUpdatesHandlerFunc(func(params current_api_session.ListServiceUpdatesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListServiceUpdates has not yet been implemented") - }), - ServiceListServicesHandler: service.ListServicesHandlerFunc(func(params service.ListServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServices has not yet been implemented") - }), - SessionListSessionsHandler: session.ListSessionsHandlerFunc(func(params session.ListSessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.ListSessions has not yet been implemented") - }), - InformationalListSpecsHandler: informational.ListSpecsHandlerFunc(func(params informational.ListSpecsParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListSpecs has not yet been implemented") - }), - InformationalListVersionHandler: informational.ListVersionHandlerFunc(func(params informational.ListVersionParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListVersion has not yet been implemented") - }), - WellKnownListWellKnownCasHandler: well_known.ListWellKnownCasHandlerFunc(func(params well_known.ListWellKnownCasParams) middleware.Responder { - return middleware.NotImplemented("operation well_known.ListWellKnownCas has not yet been implemented") - }), - CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler: current_api_session.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.PatchCurrentIdentityAuthenticator has not yet been implemented") - }), - ServicePatchServiceHandler: service.PatchServiceHandlerFunc(func(params service.PatchServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.PatchService has not yet been implemented") - }), - CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler: current_api_session.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.UpdateCurrentIdentityAuthenticator has not yet been implemented") - }), - ServiceUpdateServiceHandler: service.UpdateServiceHandlerFunc(func(params service.UpdateServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.UpdateService has not yet been implemented") - }), - CurrentIdentityVerifyMfaHandler: current_identity.VerifyMfaHandlerFunc(func(params current_identity.VerifyMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.VerifyMfa has not yet been implemented") - }), - - // Applies when the "zt-session" header is set - ZtSessionAuth: func(token string) (interface{}, error) { - return nil, errors.NotImplemented("api key auth (ztSession) zt-session from header param [zt-session] has not yet been implemented") - }, - // default authorizer is authorized meaning no requests are blocked - APIAuthorizer: security.Authorized(), - } -} - -/*ZitiEdgeClientAPI OpenZiti Edge Client API */ -type ZitiEdgeClientAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // ApplicationPkcs10Consumer registers a consumer for the following mime types: - // - application/pkcs10 - ApplicationPkcs10Consumer runtime.Consumer - // ApplicationXPemFileConsumer registers a consumer for the following mime types: - // - application/x-pem-file - ApplicationXPemFileConsumer runtime.Consumer - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - // TxtConsumer registers a consumer for the following mime types: - // - text/plain - TxtConsumer runtime.Consumer - - // ApplicationPkcs7MimeProducer registers a producer for the following mime types: - // - application/pkcs7-mime - ApplicationPkcs7MimeProducer runtime.Producer - // ApplicationXPemFileProducer registers a producer for the following mime types: - // - application/x-pem-file - ApplicationXPemFileProducer runtime.Producer - // ApplicationXX509UserCertProducer registers a producer for the following mime types: - // - application/x-x509-user-cert - ApplicationXX509UserCertProducer runtime.Producer - // BinProducer registers a producer for the following mime types: - // - image/png - BinProducer runtime.Producer - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - // TextYamlProducer registers a producer for the following mime types: - // - text/yaml - TextYamlProducer runtime.Producer - - // ZtSessionAuth registers a function that takes a token and returns a principal - // it performs authentication based on an api key zt-session provided in the header - ZtSessionAuth func(string) (interface{}, error) - - // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal - APIAuthorizer runtime.Authorizer - - // CurrentAPISessionDeleteCurrentAPISessionHandler sets the operation handler for the delete current API session operation - CurrentAPISessionDeleteCurrentAPISessionHandler current_api_session.DeleteCurrentAPISessionHandler - // AuthenticationAuthenticateHandler sets the operation handler for the authenticate operation - AuthenticationAuthenticateHandler authentication.AuthenticateHandler - // AuthenticationAuthenticateMfaHandler sets the operation handler for the authenticate mfa operation - AuthenticationAuthenticateMfaHandler authentication.AuthenticateMfaHandler - // CurrentAPISessionCreateCurrentAPISessionCertificateHandler sets the operation handler for the create current Api session certificate operation - CurrentAPISessionCreateCurrentAPISessionCertificateHandler current_api_session.CreateCurrentAPISessionCertificateHandler - // CurrentIdentityCreateMfaRecoveryCodesHandler sets the operation handler for the create mfa recovery codes operation - CurrentIdentityCreateMfaRecoveryCodesHandler current_identity.CreateMfaRecoveryCodesHandler - // PostureChecksCreatePostureResponseHandler sets the operation handler for the create posture response operation - PostureChecksCreatePostureResponseHandler posture_checks.CreatePostureResponseHandler - // PostureChecksCreatePostureResponseBulkHandler sets the operation handler for the create posture response bulk operation - PostureChecksCreatePostureResponseBulkHandler posture_checks.CreatePostureResponseBulkHandler - // SessionCreateSessionHandler sets the operation handler for the create session operation - SessionCreateSessionHandler session.CreateSessionHandler - // CurrentAPISessionDeleteCurrentAPISessionCertificateHandler sets the operation handler for the delete current Api session certificate operation - CurrentAPISessionDeleteCurrentAPISessionCertificateHandler current_api_session.DeleteCurrentAPISessionCertificateHandler - // CurrentIdentityDeleteMfaHandler sets the operation handler for the delete mfa operation - CurrentIdentityDeleteMfaHandler current_identity.DeleteMfaHandler - // ServiceDeleteServiceHandler sets the operation handler for the delete service operation - ServiceDeleteServiceHandler service.DeleteServiceHandler - // SessionDeleteSessionHandler sets the operation handler for the delete session operation - SessionDeleteSessionHandler session.DeleteSessionHandler - // CurrentAPISessionDetailCurrentAPISessionCertificateHandler sets the operation handler for the detail current Api session certificate operation - CurrentAPISessionDetailCurrentAPISessionCertificateHandler current_api_session.DetailCurrentAPISessionCertificateHandler - // CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler sets the operation handler for the detail current identity authenticator operation - CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler current_api_session.DetailCurrentIdentityAuthenticatorHandler - // CurrentIdentityDetailMfaHandler sets the operation handler for the detail mfa operation - CurrentIdentityDetailMfaHandler current_identity.DetailMfaHandler - // CurrentIdentityDetailMfaQrCodeHandler sets the operation handler for the detail mfa qr code operation - CurrentIdentityDetailMfaQrCodeHandler current_identity.DetailMfaQrCodeHandler - // CurrentIdentityDetailMfaRecoveryCodesHandler sets the operation handler for the detail mfa recovery codes operation - CurrentIdentityDetailMfaRecoveryCodesHandler current_identity.DetailMfaRecoveryCodesHandler - // ServiceDetailServiceHandler sets the operation handler for the detail service operation - ServiceDetailServiceHandler service.DetailServiceHandler - // SessionDetailSessionHandler sets the operation handler for the detail session operation - SessionDetailSessionHandler session.DetailSessionHandler - // InformationalDetailSpecHandler sets the operation handler for the detail spec operation - InformationalDetailSpecHandler informational.DetailSpecHandler - // InformationalDetailSpecBodyHandler sets the operation handler for the detail spec body operation - InformationalDetailSpecBodyHandler informational.DetailSpecBodyHandler - // EnrollEnrollHandler sets the operation handler for the enroll operation - EnrollEnrollHandler enroll.EnrollHandler - // EnrollEnrollCaHandler sets the operation handler for the enroll ca operation - EnrollEnrollCaHandler enroll.EnrollCaHandler - // EnrollEnrollErOttHandler sets the operation handler for the enroll er ott operation - EnrollEnrollErOttHandler enroll.EnrollErOttHandler - // CurrentIdentityEnrollMfaHandler sets the operation handler for the enroll mfa operation - CurrentIdentityEnrollMfaHandler current_identity.EnrollMfaHandler - // EnrollEnrollOttHandler sets the operation handler for the enroll ott operation - EnrollEnrollOttHandler enroll.EnrollOttHandler - // EnrollEnrollOttCaHandler sets the operation handler for the enroll ott ca operation - EnrollEnrollOttCaHandler enroll.EnrollOttCaHandler - // EnrollErnollUpdbHandler sets the operation handler for the ernoll updb operation - EnrollErnollUpdbHandler enroll.ErnollUpdbHandler - // CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler sets the operation handler for the extend current identity authenticator operation - CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler current_api_session.ExtendCurrentIdentityAuthenticatorHandler - // EnrollExtendRouterEnrollmentHandler sets the operation handler for the extend router enrollment operation - EnrollExtendRouterEnrollmentHandler enroll.ExtendRouterEnrollmentHandler - // CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler sets the operation handler for the extend verify current identity authenticator operation - CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandler - // CurrentAPISessionGetCurrentAPISessionHandler sets the operation handler for the get current API session operation - CurrentAPISessionGetCurrentAPISessionHandler current_api_session.GetCurrentAPISessionHandler - // CurrentIdentityGetCurrentIdentityHandler sets the operation handler for the get current identity operation - CurrentIdentityGetCurrentIdentityHandler current_identity.GetCurrentIdentityHandler - // CurrentIdentityGetCurrentIdentityEdgeRoutersHandler sets the operation handler for the get current identity edge routers operation - CurrentIdentityGetCurrentIdentityEdgeRoutersHandler current_identity.GetCurrentIdentityEdgeRoutersHandler - // CurrentAPISessionListCurrentAPISessionCertificatesHandler sets the operation handler for the list current Api session certificates operation - CurrentAPISessionListCurrentAPISessionCertificatesHandler current_api_session.ListCurrentAPISessionCertificatesHandler - // CurrentAPISessionListCurrentIdentityAuthenticatorsHandler sets the operation handler for the list current identity authenticators operation - CurrentAPISessionListCurrentIdentityAuthenticatorsHandler current_api_session.ListCurrentIdentityAuthenticatorsHandler - // ExternalJWTSignerListExternalJWTSignersHandler sets the operation handler for the list external Jwt signers operation - ExternalJWTSignerListExternalJWTSignersHandler external_jwt_signer.ListExternalJWTSignersHandler - // InformationalListProtocolsHandler sets the operation handler for the list protocols operation - InformationalListProtocolsHandler informational.ListProtocolsHandler - // InformationalListRootHandler sets the operation handler for the list root operation - InformationalListRootHandler informational.ListRootHandler - // ServiceListServiceTerminatorsHandler sets the operation handler for the list service terminators operation - ServiceListServiceTerminatorsHandler service.ListServiceTerminatorsHandler - // CurrentAPISessionListServiceUpdatesHandler sets the operation handler for the list service updates operation - CurrentAPISessionListServiceUpdatesHandler current_api_session.ListServiceUpdatesHandler - // ServiceListServicesHandler sets the operation handler for the list services operation - ServiceListServicesHandler service.ListServicesHandler - // SessionListSessionsHandler sets the operation handler for the list sessions operation - SessionListSessionsHandler session.ListSessionsHandler - // InformationalListSpecsHandler sets the operation handler for the list specs operation - InformationalListSpecsHandler informational.ListSpecsHandler - // InformationalListVersionHandler sets the operation handler for the list version operation - InformationalListVersionHandler informational.ListVersionHandler - // WellKnownListWellKnownCasHandler sets the operation handler for the list well known cas operation - WellKnownListWellKnownCasHandler well_known.ListWellKnownCasHandler - // CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler sets the operation handler for the patch current identity authenticator operation - CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler current_api_session.PatchCurrentIdentityAuthenticatorHandler - // ServicePatchServiceHandler sets the operation handler for the patch service operation - ServicePatchServiceHandler service.PatchServiceHandler - // CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler sets the operation handler for the update current identity authenticator operation - CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler current_api_session.UpdateCurrentIdentityAuthenticatorHandler - // ServiceUpdateServiceHandler sets the operation handler for the update service operation - ServiceUpdateServiceHandler service.UpdateServiceHandler - // CurrentIdentityVerifyMfaHandler sets the operation handler for the verify mfa operation - CurrentIdentityVerifyMfaHandler current_identity.VerifyMfaHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *ZitiEdgeClientAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *ZitiEdgeClientAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *ZitiEdgeClientAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *ZitiEdgeClientAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *ZitiEdgeClientAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *ZitiEdgeClientAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *ZitiEdgeClientAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *ZitiEdgeClientAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *ZitiEdgeClientAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the ZitiEdgeClientAPI -func (o *ZitiEdgeClientAPI) Validate() error { - var unregistered []string - - if o.ApplicationPkcs10Consumer == nil { - unregistered = append(unregistered, "ApplicationPkcs10Consumer") - } - if o.ApplicationXPemFileConsumer == nil { - unregistered = append(unregistered, "ApplicationXPemFileConsumer") - } - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - if o.TxtConsumer == nil { - unregistered = append(unregistered, "TxtConsumer") - } - - if o.ApplicationPkcs7MimeProducer == nil { - unregistered = append(unregistered, "ApplicationPkcs7MimeProducer") - } - if o.ApplicationXPemFileProducer == nil { - unregistered = append(unregistered, "ApplicationXPemFileProducer") - } - if o.ApplicationXX509UserCertProducer == nil { - unregistered = append(unregistered, "ApplicationXX509UserCertProducer") - } - if o.BinProducer == nil { - unregistered = append(unregistered, "BinProducer") - } - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - if o.TextYamlProducer == nil { - unregistered = append(unregistered, "TextYamlProducer") - } - - if o.ZtSessionAuth == nil { - unregistered = append(unregistered, "ZtSessionAuth") - } - - if o.CurrentAPISessionDeleteCurrentAPISessionHandler == nil { - unregistered = append(unregistered, "current_api_session.DeleteCurrentAPISessionHandler") - } - if o.AuthenticationAuthenticateHandler == nil { - unregistered = append(unregistered, "authentication.AuthenticateHandler") - } - if o.AuthenticationAuthenticateMfaHandler == nil { - unregistered = append(unregistered, "authentication.AuthenticateMfaHandler") - } - if o.CurrentAPISessionCreateCurrentAPISessionCertificateHandler == nil { - unregistered = append(unregistered, "current_api_session.CreateCurrentAPISessionCertificateHandler") - } - if o.CurrentIdentityCreateMfaRecoveryCodesHandler == nil { - unregistered = append(unregistered, "current_identity.CreateMfaRecoveryCodesHandler") - } - if o.PostureChecksCreatePostureResponseHandler == nil { - unregistered = append(unregistered, "posture_checks.CreatePostureResponseHandler") - } - if o.PostureChecksCreatePostureResponseBulkHandler == nil { - unregistered = append(unregistered, "posture_checks.CreatePostureResponseBulkHandler") - } - if o.SessionCreateSessionHandler == nil { - unregistered = append(unregistered, "session.CreateSessionHandler") - } - if o.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler == nil { - unregistered = append(unregistered, "current_api_session.DeleteCurrentAPISessionCertificateHandler") - } - if o.CurrentIdentityDeleteMfaHandler == nil { - unregistered = append(unregistered, "current_identity.DeleteMfaHandler") - } - if o.ServiceDeleteServiceHandler == nil { - unregistered = append(unregistered, "service.DeleteServiceHandler") - } - if o.SessionDeleteSessionHandler == nil { - unregistered = append(unregistered, "session.DeleteSessionHandler") - } - if o.CurrentAPISessionDetailCurrentAPISessionCertificateHandler == nil { - unregistered = append(unregistered, "current_api_session.DetailCurrentAPISessionCertificateHandler") - } - if o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.DetailCurrentIdentityAuthenticatorHandler") - } - if o.CurrentIdentityDetailMfaHandler == nil { - unregistered = append(unregistered, "current_identity.DetailMfaHandler") - } - if o.CurrentIdentityDetailMfaQrCodeHandler == nil { - unregistered = append(unregistered, "current_identity.DetailMfaQrCodeHandler") - } - if o.CurrentIdentityDetailMfaRecoveryCodesHandler == nil { - unregistered = append(unregistered, "current_identity.DetailMfaRecoveryCodesHandler") - } - if o.ServiceDetailServiceHandler == nil { - unregistered = append(unregistered, "service.DetailServiceHandler") - } - if o.SessionDetailSessionHandler == nil { - unregistered = append(unregistered, "session.DetailSessionHandler") - } - if o.InformationalDetailSpecHandler == nil { - unregistered = append(unregistered, "informational.DetailSpecHandler") - } - if o.InformationalDetailSpecBodyHandler == nil { - unregistered = append(unregistered, "informational.DetailSpecBodyHandler") - } - if o.EnrollEnrollHandler == nil { - unregistered = append(unregistered, "enroll.EnrollHandler") - } - if o.EnrollEnrollCaHandler == nil { - unregistered = append(unregistered, "enroll.EnrollCaHandler") - } - if o.EnrollEnrollErOttHandler == nil { - unregistered = append(unregistered, "enroll.EnrollErOttHandler") - } - if o.CurrentIdentityEnrollMfaHandler == nil { - unregistered = append(unregistered, "current_identity.EnrollMfaHandler") - } - if o.EnrollEnrollOttHandler == nil { - unregistered = append(unregistered, "enroll.EnrollOttHandler") - } - if o.EnrollEnrollOttCaHandler == nil { - unregistered = append(unregistered, "enroll.EnrollOttCaHandler") - } - if o.EnrollErnollUpdbHandler == nil { - unregistered = append(unregistered, "enroll.ErnollUpdbHandler") - } - if o.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.ExtendCurrentIdentityAuthenticatorHandler") - } - if o.EnrollExtendRouterEnrollmentHandler == nil { - unregistered = append(unregistered, "enroll.ExtendRouterEnrollmentHandler") - } - if o.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandler") - } - if o.CurrentAPISessionGetCurrentAPISessionHandler == nil { - unregistered = append(unregistered, "current_api_session.GetCurrentAPISessionHandler") - } - if o.CurrentIdentityGetCurrentIdentityHandler == nil { - unregistered = append(unregistered, "current_identity.GetCurrentIdentityHandler") - } - if o.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler == nil { - unregistered = append(unregistered, "current_identity.GetCurrentIdentityEdgeRoutersHandler") - } - if o.CurrentAPISessionListCurrentAPISessionCertificatesHandler == nil { - unregistered = append(unregistered, "current_api_session.ListCurrentAPISessionCertificatesHandler") - } - if o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler == nil { - unregistered = append(unregistered, "current_api_session.ListCurrentIdentityAuthenticatorsHandler") - } - if o.ExternalJWTSignerListExternalJWTSignersHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.ListExternalJWTSignersHandler") - } - if o.InformationalListProtocolsHandler == nil { - unregistered = append(unregistered, "informational.ListProtocolsHandler") - } - if o.InformationalListRootHandler == nil { - unregistered = append(unregistered, "informational.ListRootHandler") - } - if o.ServiceListServiceTerminatorsHandler == nil { - unregistered = append(unregistered, "service.ListServiceTerminatorsHandler") - } - if o.CurrentAPISessionListServiceUpdatesHandler == nil { - unregistered = append(unregistered, "current_api_session.ListServiceUpdatesHandler") - } - if o.ServiceListServicesHandler == nil { - unregistered = append(unregistered, "service.ListServicesHandler") - } - if o.SessionListSessionsHandler == nil { - unregistered = append(unregistered, "session.ListSessionsHandler") - } - if o.InformationalListSpecsHandler == nil { - unregistered = append(unregistered, "informational.ListSpecsHandler") - } - if o.InformationalListVersionHandler == nil { - unregistered = append(unregistered, "informational.ListVersionHandler") - } - if o.WellKnownListWellKnownCasHandler == nil { - unregistered = append(unregistered, "well_known.ListWellKnownCasHandler") - } - if o.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.PatchCurrentIdentityAuthenticatorHandler") - } - if o.ServicePatchServiceHandler == nil { - unregistered = append(unregistered, "service.PatchServiceHandler") - } - if o.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.UpdateCurrentIdentityAuthenticatorHandler") - } - if o.ServiceUpdateServiceHandler == nil { - unregistered = append(unregistered, "service.UpdateServiceHandler") - } - if o.CurrentIdentityVerifyMfaHandler == nil { - unregistered = append(unregistered, "current_identity.VerifyMfaHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *ZitiEdgeClientAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *ZitiEdgeClientAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - result := make(map[string]runtime.Authenticator) - for name := range schemes { - switch name { - case "ztSession": - scheme := schemes[name] - result[name] = o.APIKeyAuthenticator(scheme.Name, scheme.In, o.ZtSessionAuth) - - } - } - return result -} - -// Authorizer returns the registered authorizer -func (o *ZitiEdgeClientAPI) Authorizer() runtime.Authorizer { - return o.APIAuthorizer -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *ZitiEdgeClientAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/pkcs10": - result["application/pkcs10"] = o.ApplicationPkcs10Consumer - case "application/x-pem-file": - result["application/x-pem-file"] = o.ApplicationXPemFileConsumer - case "application/json": - result["application/json"] = o.JSONConsumer - case "text/plain": - result["text/plain"] = o.TxtConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *ZitiEdgeClientAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/pkcs7-mime": - result["application/pkcs7-mime"] = o.ApplicationPkcs7MimeProducer - case "application/x-pem-file": - result["application/x-pem-file"] = o.ApplicationXPemFileProducer - case "application/x-x509-user-cert": - result["application/x-x509-user-cert"] = o.ApplicationXX509UserCertProducer - case "image/png": - result["image/png"] = o.BinProducer - case "application/json": - result["application/json"] = o.JSONProducer - case "text/yaml": - result["text/yaml"] = o.TextYamlProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *ZitiEdgeClientAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the ziti edge client API -func (o *ZitiEdgeClientAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *ZitiEdgeClientAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/current-api-session"] = current_api_session.NewDeleteCurrentAPISession(o.context, o.CurrentAPISessionDeleteCurrentAPISessionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/authenticate"] = authentication.NewAuthenticate(o.context, o.AuthenticationAuthenticateHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/authenticate/mfa"] = authentication.NewAuthenticateMfa(o.context, o.AuthenticationAuthenticateMfaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-api-session/certificates"] = current_api_session.NewCreateCurrentAPISessionCertificate(o.context, o.CurrentAPISessionCreateCurrentAPISessionCertificateHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/mfa/recovery-codes"] = current_identity.NewCreateMfaRecoveryCodes(o.context, o.CurrentIdentityCreateMfaRecoveryCodesHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/posture-response"] = posture_checks.NewCreatePostureResponse(o.context, o.PostureChecksCreatePostureResponseHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/posture-response-bulk"] = posture_checks.NewCreatePostureResponseBulk(o.context, o.PostureChecksCreatePostureResponseBulkHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/sessions"] = session.NewCreateSession(o.context, o.SessionCreateSessionHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/current-api-session/certificates/{id}"] = current_api_session.NewDeleteCurrentAPISessionCertificate(o.context, o.CurrentAPISessionDeleteCurrentAPISessionCertificateHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/current-identity/mfa"] = current_identity.NewDeleteMfa(o.context, o.CurrentIdentityDeleteMfaHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/services/{id}"] = service.NewDeleteService(o.context, o.ServiceDeleteServiceHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/sessions/{id}"] = session.NewDeleteSession(o.context, o.SessionDeleteSessionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-api-session/certificates/{id}"] = current_api_session.NewDetailCurrentAPISessionCertificate(o.context, o.CurrentAPISessionDetailCurrentAPISessionCertificateHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/authenticators/{id}"] = current_api_session.NewDetailCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/mfa"] = current_identity.NewDetailMfa(o.context, o.CurrentIdentityDetailMfaHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/mfa/qr-code"] = current_identity.NewDetailMfaQrCode(o.context, o.CurrentIdentityDetailMfaQrCodeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/mfa/recovery-codes"] = current_identity.NewDetailMfaRecoveryCodes(o.context, o.CurrentIdentityDetailMfaRecoveryCodesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}"] = service.NewDetailService(o.context, o.ServiceDetailServiceHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/sessions/{id}"] = session.NewDetailSession(o.context, o.SessionDetailSessionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/specs/{id}"] = informational.NewDetailSpec(o.context, o.InformationalDetailSpecHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/specs/{id}/spec"] = informational.NewDetailSpecBody(o.context, o.InformationalDetailSpecBodyHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll"] = enroll.NewEnroll(o.context, o.EnrollEnrollHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll/ca"] = enroll.NewEnrollCa(o.context, o.EnrollEnrollCaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll/erott"] = enroll.NewEnrollErOtt(o.context, o.EnrollEnrollErOttHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/mfa"] = current_identity.NewEnrollMfa(o.context, o.CurrentIdentityEnrollMfaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll/ott"] = enroll.NewEnrollOtt(o.context, o.EnrollEnrollOttHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll/ottca"] = enroll.NewEnrollOttCa(o.context, o.EnrollEnrollOttCaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll/updb"] = enroll.NewErnollUpdb(o.context, o.EnrollErnollUpdbHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/authenticators/{id}/extend"] = current_api_session.NewExtendCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enroll/extend/router"] = enroll.NewExtendRouterEnrollment(o.context, o.EnrollExtendRouterEnrollmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/authenticators/{id}/extend-verify"] = current_api_session.NewExtendVerifyCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-api-session"] = current_api_session.NewGetCurrentAPISession(o.context, o.CurrentAPISessionGetCurrentAPISessionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity"] = current_identity.NewGetCurrentIdentity(o.context, o.CurrentIdentityGetCurrentIdentityHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/edge-routers"] = current_identity.NewGetCurrentIdentityEdgeRouters(o.context, o.CurrentIdentityGetCurrentIdentityEdgeRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-api-session/certificates"] = current_api_session.NewListCurrentAPISessionCertificates(o.context, o.CurrentAPISessionListCurrentAPISessionCertificatesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/authenticators"] = current_api_session.NewListCurrentIdentityAuthenticators(o.context, o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/external-jwt-signers"] = external_jwt_signer.NewListExternalJWTSigners(o.context, o.ExternalJWTSignerListExternalJWTSignersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/protocols"] = informational.NewListProtocols(o.context, o.InformationalListProtocolsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"][""] = informational.NewListRoot(o.context, o.InformationalListRootHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/terminators"] = service.NewListServiceTerminators(o.context, o.ServiceListServiceTerminatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-api-session/service-updates"] = current_api_session.NewListServiceUpdates(o.context, o.CurrentAPISessionListServiceUpdatesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services"] = service.NewListServices(o.context, o.ServiceListServicesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/sessions"] = session.NewListSessions(o.context, o.SessionListSessionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/specs"] = informational.NewListSpecs(o.context, o.InformationalListSpecsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/version"] = informational.NewListVersion(o.context, o.InformationalListVersionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/.well-known/est/cacerts"] = well_known.NewListWellKnownCas(o.context, o.WellKnownListWellKnownCasHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/current-identity/authenticators/{id}"] = current_api_session.NewPatchCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/services/{id}"] = service.NewPatchService(o.context, o.ServicePatchServiceHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/current-identity/authenticators/{id}"] = current_api_session.NewUpdateCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/services/{id}"] = service.NewUpdateService(o.context, o.ServiceUpdateServiceHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/mfa/verify"] = current_identity.NewVerifyMfa(o.context, o.CurrentIdentityVerifyMfaHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *ZitiEdgeClientAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *ZitiEdgeClientAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *ZitiEdgeClientAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *ZitiEdgeClientAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *ZitiEdgeClientAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[method][path] = builder(h) - } -} diff --git a/rest_client_api_server/server.go b/rest_client_api_server/server.go deleted file mode 100644 index cb07d79e5..000000000 --- a/rest_client_api_server/server.go +++ /dev/null @@ -1,532 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_client_api_server - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "io/ioutil" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/openziti/edge/rest_client_api_server/operations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTPS, - } -} - -// NewServer creates a new api ziti edge client server but does not configure it -func NewServer(api *operations.ZitiEdgeClientAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the ziti edge client API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/ziti-edge-client.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *operations.ZitiEdgeClientAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *operations.ZitiEdgeClientAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving ziti edge client at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving ziti edge client at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving ziti edge client at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving ziti edge client at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := ioutil.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving ziti edge client at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving ziti edge client at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/rest_management_api_client/api_session/api_session_client.go b/rest_management_api_client/api_session/api_session_client.go deleted file mode 100644 index a164a59e7..000000000 --- a/rest_management_api_client/api_session/api_session_client.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new api session API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for api session API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteAPISessions(params *DeleteAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPISessionsOK, error) - - DetailAPISessions(params *DetailAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAPISessionsOK, error) - - ListAPISessions(params *ListAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAPISessionsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteAPISessions deletes an API sessions - - Deletes and API sesion by id. Requires admin access. -*/ -func (a *Client) DeleteAPISessions(params *DeleteAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAPISessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteAPISessionsParams() - } - op := &runtime.ClientOperation{ - ID: "deleteAPISessions", - Method: "DELETE", - PathPattern: "/api-sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteAPISessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteAPISessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteAPISessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailAPISessions retrieves a single API session - - Retrieves a single API Session by id. Requires admin access. -*/ -func (a *Client) DetailAPISessions(params *DetailAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAPISessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailAPISessionsParams() - } - op := &runtime.ClientOperation{ - ID: "detailAPISessions", - Method: "GET", - PathPattern: "/api-sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailAPISessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailAPISessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailAPISessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListAPISessions lists active API sessions - - Returns a list of active API sessions. The resources can be sorted, filtered, and paginated. This endpoint -requries admin access. - -*/ -func (a *Client) ListAPISessions(params *ListAPISessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAPISessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListAPISessionsParams() - } - op := &runtime.ClientOperation{ - ID: "listAPISessions", - Method: "GET", - PathPattern: "/api-sessions", - ProducesMediaTypes: []string{"application/json; charset=utf-8"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListAPISessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListAPISessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listAPISessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/api_session/delete_api_sessions_parameters.go b/rest_management_api_client/api_session/delete_api_sessions_parameters.go deleted file mode 100644 index 68883413b..000000000 --- a/rest_management_api_client/api_session/delete_api_sessions_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteAPISessionsParams creates a new DeleteAPISessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteAPISessionsParams() *DeleteAPISessionsParams { - return &DeleteAPISessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteAPISessionsParamsWithTimeout creates a new DeleteAPISessionsParams object -// with the ability to set a timeout on a request. -func NewDeleteAPISessionsParamsWithTimeout(timeout time.Duration) *DeleteAPISessionsParams { - return &DeleteAPISessionsParams{ - timeout: timeout, - } -} - -// NewDeleteAPISessionsParamsWithContext creates a new DeleteAPISessionsParams object -// with the ability to set a context for a request. -func NewDeleteAPISessionsParamsWithContext(ctx context.Context) *DeleteAPISessionsParams { - return &DeleteAPISessionsParams{ - Context: ctx, - } -} - -// NewDeleteAPISessionsParamsWithHTTPClient creates a new DeleteAPISessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteAPISessionsParamsWithHTTPClient(client *http.Client) *DeleteAPISessionsParams { - return &DeleteAPISessionsParams{ - HTTPClient: client, - } -} - -/* DeleteAPISessionsParams contains all the parameters to send to the API endpoint - for the delete API sessions operation. - - Typically these are written to a http.Request. -*/ -type DeleteAPISessionsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete API sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAPISessionsParams) WithDefaults() *DeleteAPISessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete API sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAPISessionsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete API sessions params -func (o *DeleteAPISessionsParams) WithTimeout(timeout time.Duration) *DeleteAPISessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete API sessions params -func (o *DeleteAPISessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete API sessions params -func (o *DeleteAPISessionsParams) WithContext(ctx context.Context) *DeleteAPISessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete API sessions params -func (o *DeleteAPISessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete API sessions params -func (o *DeleteAPISessionsParams) WithHTTPClient(client *http.Client) *DeleteAPISessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete API sessions params -func (o *DeleteAPISessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete API sessions params -func (o *DeleteAPISessionsParams) WithID(id string) *DeleteAPISessionsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete API sessions params -func (o *DeleteAPISessionsParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteAPISessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/api_session/delete_api_sessions_responses.go b/rest_management_api_client/api_session/delete_api_sessions_responses.go deleted file mode 100644 index ee77a16dc..000000000 --- a/rest_management_api_client/api_session/delete_api_sessions_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteAPISessionsReader is a Reader for the DeleteAPISessions structure. -type DeleteAPISessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteAPISessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteAPISessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewDeleteAPISessionsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteAPISessionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteAPISessionsOK creates a DeleteAPISessionsOK with default headers values -func NewDeleteAPISessionsOK() *DeleteAPISessionsOK { - return &DeleteAPISessionsOK{} -} - -/* DeleteAPISessionsOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteAPISessionsOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteAPISessionsOK) Error() string { - return fmt.Sprintf("[DELETE /api-sessions/{id}][%d] deleteApiSessionsOK %+v", 200, o.Payload) -} -func (o *DeleteAPISessionsOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteAPISessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAPISessionsForbidden creates a DeleteAPISessionsForbidden with default headers values -func NewDeleteAPISessionsForbidden() *DeleteAPISessionsForbidden { - return &DeleteAPISessionsForbidden{} -} - -/* DeleteAPISessionsForbidden describes a response with status code 403, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteAPISessionsForbidden struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteAPISessionsForbidden) Error() string { - return fmt.Sprintf("[DELETE /api-sessions/{id}][%d] deleteApiSessionsForbidden %+v", 403, o.Payload) -} -func (o *DeleteAPISessionsForbidden) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteAPISessionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAPISessionsNotFound creates a DeleteAPISessionsNotFound with default headers values -func NewDeleteAPISessionsNotFound() *DeleteAPISessionsNotFound { - return &DeleteAPISessionsNotFound{} -} - -/* DeleteAPISessionsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DeleteAPISessionsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteAPISessionsNotFound) Error() string { - return fmt.Sprintf("[DELETE /api-sessions/{id}][%d] deleteApiSessionsNotFound %+v", 404, o.Payload) -} -func (o *DeleteAPISessionsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteAPISessionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/api_session/detail_api_sessions_parameters.go b/rest_management_api_client/api_session/detail_api_sessions_parameters.go deleted file mode 100644 index 0e443ab6b..000000000 --- a/rest_management_api_client/api_session/detail_api_sessions_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailAPISessionsParams creates a new DetailAPISessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailAPISessionsParams() *DetailAPISessionsParams { - return &DetailAPISessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailAPISessionsParamsWithTimeout creates a new DetailAPISessionsParams object -// with the ability to set a timeout on a request. -func NewDetailAPISessionsParamsWithTimeout(timeout time.Duration) *DetailAPISessionsParams { - return &DetailAPISessionsParams{ - timeout: timeout, - } -} - -// NewDetailAPISessionsParamsWithContext creates a new DetailAPISessionsParams object -// with the ability to set a context for a request. -func NewDetailAPISessionsParamsWithContext(ctx context.Context) *DetailAPISessionsParams { - return &DetailAPISessionsParams{ - Context: ctx, - } -} - -// NewDetailAPISessionsParamsWithHTTPClient creates a new DetailAPISessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailAPISessionsParamsWithHTTPClient(client *http.Client) *DetailAPISessionsParams { - return &DetailAPISessionsParams{ - HTTPClient: client, - } -} - -/* DetailAPISessionsParams contains all the parameters to send to the API endpoint - for the detail API sessions operation. - - Typically these are written to a http.Request. -*/ -type DetailAPISessionsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail API sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailAPISessionsParams) WithDefaults() *DetailAPISessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail API sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailAPISessionsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail API sessions params -func (o *DetailAPISessionsParams) WithTimeout(timeout time.Duration) *DetailAPISessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail API sessions params -func (o *DetailAPISessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail API sessions params -func (o *DetailAPISessionsParams) WithContext(ctx context.Context) *DetailAPISessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail API sessions params -func (o *DetailAPISessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail API sessions params -func (o *DetailAPISessionsParams) WithHTTPClient(client *http.Client) *DetailAPISessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail API sessions params -func (o *DetailAPISessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail API sessions params -func (o *DetailAPISessionsParams) WithID(id string) *DetailAPISessionsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail API sessions params -func (o *DetailAPISessionsParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailAPISessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/api_session/detail_api_sessions_responses.go b/rest_management_api_client/api_session/detail_api_sessions_responses.go deleted file mode 100644 index 7cf11a1db..000000000 --- a/rest_management_api_client/api_session/detail_api_sessions_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailAPISessionsReader is a Reader for the DetailAPISessions structure. -type DetailAPISessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailAPISessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailAPISessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailAPISessionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailAPISessionsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailAPISessionsOK creates a DetailAPISessionsOK with default headers values -func NewDetailAPISessionsOK() *DetailAPISessionsOK { - return &DetailAPISessionsOK{} -} - -/* DetailAPISessionsOK describes a response with status code 200, with default header values. - -Retrieves a singular API Session by id -*/ -type DetailAPISessionsOK struct { - Payload *rest_model.DetailAPISessionEnvelope -} - -func (o *DetailAPISessionsOK) Error() string { - return fmt.Sprintf("[GET /api-sessions/{id}][%d] detailApiSessionsOK %+v", 200, o.Payload) -} -func (o *DetailAPISessionsOK) GetPayload() *rest_model.DetailAPISessionEnvelope { - return o.Payload -} - -func (o *DetailAPISessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailAPISessionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailAPISessionsUnauthorized creates a DetailAPISessionsUnauthorized with default headers values -func NewDetailAPISessionsUnauthorized() *DetailAPISessionsUnauthorized { - return &DetailAPISessionsUnauthorized{} -} - -/* DetailAPISessionsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailAPISessionsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailAPISessionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api-sessions/{id}][%d] detailApiSessionsUnauthorized %+v", 401, o.Payload) -} -func (o *DetailAPISessionsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailAPISessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailAPISessionsNotFound creates a DetailAPISessionsNotFound with default headers values -func NewDetailAPISessionsNotFound() *DetailAPISessionsNotFound { - return &DetailAPISessionsNotFound{} -} - -/* DetailAPISessionsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailAPISessionsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailAPISessionsNotFound) Error() string { - return fmt.Sprintf("[GET /api-sessions/{id}][%d] detailApiSessionsNotFound %+v", 404, o.Payload) -} -func (o *DetailAPISessionsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailAPISessionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/api_session/list_api_sessions_parameters.go b/rest_management_api_client/api_session/list_api_sessions_parameters.go deleted file mode 100644 index ff188d71a..000000000 --- a/rest_management_api_client/api_session/list_api_sessions_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListAPISessionsParams creates a new ListAPISessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListAPISessionsParams() *ListAPISessionsParams { - return &ListAPISessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAPISessionsParamsWithTimeout creates a new ListAPISessionsParams object -// with the ability to set a timeout on a request. -func NewListAPISessionsParamsWithTimeout(timeout time.Duration) *ListAPISessionsParams { - return &ListAPISessionsParams{ - timeout: timeout, - } -} - -// NewListAPISessionsParamsWithContext creates a new ListAPISessionsParams object -// with the ability to set a context for a request. -func NewListAPISessionsParamsWithContext(ctx context.Context) *ListAPISessionsParams { - return &ListAPISessionsParams{ - Context: ctx, - } -} - -// NewListAPISessionsParamsWithHTTPClient creates a new ListAPISessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAPISessionsParamsWithHTTPClient(client *http.Client) *ListAPISessionsParams { - return &ListAPISessionsParams{ - HTTPClient: client, - } -} - -/* ListAPISessionsParams contains all the parameters to send to the API endpoint - for the list API sessions operation. - - Typically these are written to a http.Request. -*/ -type ListAPISessionsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list API sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAPISessionsParams) WithDefaults() *ListAPISessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list API sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAPISessionsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list API sessions params -func (o *ListAPISessionsParams) WithTimeout(timeout time.Duration) *ListAPISessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list API sessions params -func (o *ListAPISessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list API sessions params -func (o *ListAPISessionsParams) WithContext(ctx context.Context) *ListAPISessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list API sessions params -func (o *ListAPISessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list API sessions params -func (o *ListAPISessionsParams) WithHTTPClient(client *http.Client) *ListAPISessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list API sessions params -func (o *ListAPISessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list API sessions params -func (o *ListAPISessionsParams) WithFilter(filter *string) *ListAPISessionsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list API sessions params -func (o *ListAPISessionsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list API sessions params -func (o *ListAPISessionsParams) WithLimit(limit *int64) *ListAPISessionsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list API sessions params -func (o *ListAPISessionsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list API sessions params -func (o *ListAPISessionsParams) WithOffset(offset *int64) *ListAPISessionsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list API sessions params -func (o *ListAPISessionsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAPISessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/api_session/list_api_sessions_responses.go b/rest_management_api_client/api_session/list_api_sessions_responses.go deleted file mode 100644 index f70af3e9d..000000000 --- a/rest_management_api_client/api_session/list_api_sessions_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListAPISessionsReader is a Reader for the ListAPISessions structure. -type ListAPISessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAPISessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListAPISessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListAPISessionsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListAPISessionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListAPISessionsOK creates a ListAPISessionsOK with default headers values -func NewListAPISessionsOK() *ListAPISessionsOK { - return &ListAPISessionsOK{} -} - -/* ListAPISessionsOK describes a response with status code 200, with default header values. - -A list of active API Sessions -*/ -type ListAPISessionsOK struct { - Payload *rest_model.ListAPISessionsEnvelope -} - -func (o *ListAPISessionsOK) Error() string { - return fmt.Sprintf("[GET /api-sessions][%d] listApiSessionsOK %+v", 200, o.Payload) -} -func (o *ListAPISessionsOK) GetPayload() *rest_model.ListAPISessionsEnvelope { - return o.Payload -} - -func (o *ListAPISessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListAPISessionsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAPISessionsBadRequest creates a ListAPISessionsBadRequest with default headers values -func NewListAPISessionsBadRequest() *ListAPISessionsBadRequest { - return &ListAPISessionsBadRequest{} -} - -/* ListAPISessionsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListAPISessionsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListAPISessionsBadRequest) Error() string { - return fmt.Sprintf("[GET /api-sessions][%d] listApiSessionsBadRequest %+v", 400, o.Payload) -} -func (o *ListAPISessionsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListAPISessionsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAPISessionsUnauthorized creates a ListAPISessionsUnauthorized with default headers values -func NewListAPISessionsUnauthorized() *ListAPISessionsUnauthorized { - return &ListAPISessionsUnauthorized{} -} - -/* ListAPISessionsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListAPISessionsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListAPISessionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /api-sessions][%d] listApiSessionsUnauthorized %+v", 401, o.Payload) -} -func (o *ListAPISessionsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListAPISessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/auth_policy/auth_policy_client.go b/rest_management_api_client/auth_policy/auth_policy_client.go deleted file mode 100644 index 6fe0d6f41..000000000 --- a/rest_management_api_client/auth_policy/auth_policy_client.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new auth policy API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for auth policy API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateAuthPolicy(params *CreateAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthPolicyCreated, error) - - DeleteAuthPolicy(params *DeleteAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthPolicyOK, error) - - DetailAuthPolicy(params *DetailAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthPolicyOK, error) - - ListAuthPolicies(params *ListAuthPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthPoliciesOK, error) - - PatchAuthPolicy(params *PatchAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthPolicyOK, error) - - UpdateAuthPolicy(params *UpdateAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthPolicyOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateAuthPolicy creates an auth policy - - Creates an Auth Policy. Requires admin access. -*/ -func (a *Client) CreateAuthPolicy(params *CreateAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthPolicyCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateAuthPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "createAuthPolicy", - Method: "POST", - PathPattern: "/auth-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateAuthPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateAuthPolicyCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createAuthPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteAuthPolicy deletes an auth policy - - Delete an Auth Policy by id. Requires admin access. - -*/ -func (a *Client) DeleteAuthPolicy(params *DeleteAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteAuthPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "deleteAuthPolicy", - Method: "DELETE", - PathPattern: "/auth-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteAuthPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteAuthPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteAuthPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailAuthPolicy retrieves a single auth policy - - Retrieves a single Auth Policy by id. Requires admin access. -*/ -func (a *Client) DetailAuthPolicy(params *DetailAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailAuthPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "detailAuthPolicy", - Method: "GET", - PathPattern: "/auth-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailAuthPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailAuthPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailAuthPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListAuthPolicies lists auth policies - - Retrieves a list of Auth Policies -*/ -func (a *Client) ListAuthPolicies(params *ListAuthPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListAuthPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listAuthPolicies", - Method: "GET", - PathPattern: "/auth-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListAuthPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListAuthPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listAuthPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchAuthPolicy updates the supplied fields on an auth policy - - Update only the supplied fields on an Auth Policy by id. Requires admin access. -*/ -func (a *Client) PatchAuthPolicy(params *PatchAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchAuthPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "patchAuthPolicy", - Method: "PATCH", - PathPattern: "/auth-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchAuthPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchAuthPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchAuthPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateAuthPolicy updates all fields on an auth policy - - Update all fields on an Auth Policy by id. Requires admin access. -*/ -func (a *Client) UpdateAuthPolicy(params *UpdateAuthPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateAuthPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "updateAuthPolicy", - Method: "PUT", - PathPattern: "/auth-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateAuthPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateAuthPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateAuthPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/auth_policy/create_auth_policy_parameters.go b/rest_management_api_client/auth_policy/create_auth_policy_parameters.go deleted file mode 100644 index 3cc2ed778..000000000 --- a/rest_management_api_client/auth_policy/create_auth_policy_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateAuthPolicyParams creates a new CreateAuthPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateAuthPolicyParams() *CreateAuthPolicyParams { - return &CreateAuthPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateAuthPolicyParamsWithTimeout creates a new CreateAuthPolicyParams object -// with the ability to set a timeout on a request. -func NewCreateAuthPolicyParamsWithTimeout(timeout time.Duration) *CreateAuthPolicyParams { - return &CreateAuthPolicyParams{ - timeout: timeout, - } -} - -// NewCreateAuthPolicyParamsWithContext creates a new CreateAuthPolicyParams object -// with the ability to set a context for a request. -func NewCreateAuthPolicyParamsWithContext(ctx context.Context) *CreateAuthPolicyParams { - return &CreateAuthPolicyParams{ - Context: ctx, - } -} - -// NewCreateAuthPolicyParamsWithHTTPClient creates a new CreateAuthPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateAuthPolicyParamsWithHTTPClient(client *http.Client) *CreateAuthPolicyParams { - return &CreateAuthPolicyParams{ - HTTPClient: client, - } -} - -/* CreateAuthPolicyParams contains all the parameters to send to the API endpoint - for the create auth policy operation. - - Typically these are written to a http.Request. -*/ -type CreateAuthPolicyParams struct { - - /* AuthPolicy. - - An Auth Policy to create - */ - AuthPolicy *rest_model.AuthPolicyCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAuthPolicyParams) WithDefaults() *CreateAuthPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAuthPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create auth policy params -func (o *CreateAuthPolicyParams) WithTimeout(timeout time.Duration) *CreateAuthPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create auth policy params -func (o *CreateAuthPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create auth policy params -func (o *CreateAuthPolicyParams) WithContext(ctx context.Context) *CreateAuthPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create auth policy params -func (o *CreateAuthPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create auth policy params -func (o *CreateAuthPolicyParams) WithHTTPClient(client *http.Client) *CreateAuthPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create auth policy params -func (o *CreateAuthPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthPolicy adds the authPolicy to the create auth policy params -func (o *CreateAuthPolicyParams) WithAuthPolicy(authPolicy *rest_model.AuthPolicyCreate) *CreateAuthPolicyParams { - o.SetAuthPolicy(authPolicy) - return o -} - -// SetAuthPolicy adds the authPolicy to the create auth policy params -func (o *CreateAuthPolicyParams) SetAuthPolicy(authPolicy *rest_model.AuthPolicyCreate) { - o.AuthPolicy = authPolicy -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateAuthPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.AuthPolicy != nil { - if err := r.SetBodyParam(o.AuthPolicy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/auth_policy/create_auth_policy_responses.go b/rest_management_api_client/auth_policy/create_auth_policy_responses.go deleted file mode 100644 index 66c820632..000000000 --- a/rest_management_api_client/auth_policy/create_auth_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateAuthPolicyReader is a Reader for the CreateAuthPolicy structure. -type CreateAuthPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateAuthPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateAuthPolicyCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateAuthPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateAuthPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateAuthPolicyCreated creates a CreateAuthPolicyCreated with default headers values -func NewCreateAuthPolicyCreated() *CreateAuthPolicyCreated { - return &CreateAuthPolicyCreated{} -} - -/* CreateAuthPolicyCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateAuthPolicyCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateAuthPolicyCreated) Error() string { - return fmt.Sprintf("[POST /auth-policies][%d] createAuthPolicyCreated %+v", 201, o.Payload) -} -func (o *CreateAuthPolicyCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateAuthPolicyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthPolicyBadRequest creates a CreateAuthPolicyBadRequest with default headers values -func NewCreateAuthPolicyBadRequest() *CreateAuthPolicyBadRequest { - return &CreateAuthPolicyBadRequest{} -} - -/* CreateAuthPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateAuthPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateAuthPolicyBadRequest) Error() string { - return fmt.Sprintf("[POST /auth-policies][%d] createAuthPolicyBadRequest %+v", 400, o.Payload) -} -func (o *CreateAuthPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateAuthPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthPolicyUnauthorized creates a CreateAuthPolicyUnauthorized with default headers values -func NewCreateAuthPolicyUnauthorized() *CreateAuthPolicyUnauthorized { - return &CreateAuthPolicyUnauthorized{} -} - -/* CreateAuthPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateAuthPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateAuthPolicyUnauthorized) Error() string { - return fmt.Sprintf("[POST /auth-policies][%d] createAuthPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *CreateAuthPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateAuthPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/auth_policy/delete_auth_policy_parameters.go b/rest_management_api_client/auth_policy/delete_auth_policy_parameters.go deleted file mode 100644 index 85dfaf503..000000000 --- a/rest_management_api_client/auth_policy/delete_auth_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteAuthPolicyParams creates a new DeleteAuthPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteAuthPolicyParams() *DeleteAuthPolicyParams { - return &DeleteAuthPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteAuthPolicyParamsWithTimeout creates a new DeleteAuthPolicyParams object -// with the ability to set a timeout on a request. -func NewDeleteAuthPolicyParamsWithTimeout(timeout time.Duration) *DeleteAuthPolicyParams { - return &DeleteAuthPolicyParams{ - timeout: timeout, - } -} - -// NewDeleteAuthPolicyParamsWithContext creates a new DeleteAuthPolicyParams object -// with the ability to set a context for a request. -func NewDeleteAuthPolicyParamsWithContext(ctx context.Context) *DeleteAuthPolicyParams { - return &DeleteAuthPolicyParams{ - Context: ctx, - } -} - -// NewDeleteAuthPolicyParamsWithHTTPClient creates a new DeleteAuthPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteAuthPolicyParamsWithHTTPClient(client *http.Client) *DeleteAuthPolicyParams { - return &DeleteAuthPolicyParams{ - HTTPClient: client, - } -} - -/* DeleteAuthPolicyParams contains all the parameters to send to the API endpoint - for the delete auth policy operation. - - Typically these are written to a http.Request. -*/ -type DeleteAuthPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAuthPolicyParams) WithDefaults() *DeleteAuthPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAuthPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete auth policy params -func (o *DeleteAuthPolicyParams) WithTimeout(timeout time.Duration) *DeleteAuthPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete auth policy params -func (o *DeleteAuthPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete auth policy params -func (o *DeleteAuthPolicyParams) WithContext(ctx context.Context) *DeleteAuthPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete auth policy params -func (o *DeleteAuthPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete auth policy params -func (o *DeleteAuthPolicyParams) WithHTTPClient(client *http.Client) *DeleteAuthPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete auth policy params -func (o *DeleteAuthPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete auth policy params -func (o *DeleteAuthPolicyParams) WithID(id string) *DeleteAuthPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete auth policy params -func (o *DeleteAuthPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteAuthPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/auth_policy/delete_auth_policy_responses.go b/rest_management_api_client/auth_policy/delete_auth_policy_responses.go deleted file mode 100644 index 90fab6851..000000000 --- a/rest_management_api_client/auth_policy/delete_auth_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteAuthPolicyReader is a Reader for the DeleteAuthPolicy structure. -type DeleteAuthPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteAuthPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteAuthPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteAuthPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteAuthPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteAuthPolicyOK creates a DeleteAuthPolicyOK with default headers values -func NewDeleteAuthPolicyOK() *DeleteAuthPolicyOK { - return &DeleteAuthPolicyOK{} -} - -/* DeleteAuthPolicyOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteAuthPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteAuthPolicyOK) Error() string { - return fmt.Sprintf("[DELETE /auth-policies/{id}][%d] deleteAuthPolicyOK %+v", 200, o.Payload) -} -func (o *DeleteAuthPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteAuthPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAuthPolicyBadRequest creates a DeleteAuthPolicyBadRequest with default headers values -func NewDeleteAuthPolicyBadRequest() *DeleteAuthPolicyBadRequest { - return &DeleteAuthPolicyBadRequest{} -} - -/* DeleteAuthPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteAuthPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteAuthPolicyBadRequest) Error() string { - return fmt.Sprintf("[DELETE /auth-policies/{id}][%d] deleteAuthPolicyBadRequest %+v", 400, o.Payload) -} -func (o *DeleteAuthPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteAuthPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAuthPolicyUnauthorized creates a DeleteAuthPolicyUnauthorized with default headers values -func NewDeleteAuthPolicyUnauthorized() *DeleteAuthPolicyUnauthorized { - return &DeleteAuthPolicyUnauthorized{} -} - -/* DeleteAuthPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteAuthPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteAuthPolicyUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /auth-policies/{id}][%d] deleteAuthPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteAuthPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteAuthPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/auth_policy/detail_auth_policy_parameters.go b/rest_management_api_client/auth_policy/detail_auth_policy_parameters.go deleted file mode 100644 index 887c4427b..000000000 --- a/rest_management_api_client/auth_policy/detail_auth_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailAuthPolicyParams creates a new DetailAuthPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailAuthPolicyParams() *DetailAuthPolicyParams { - return &DetailAuthPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailAuthPolicyParamsWithTimeout creates a new DetailAuthPolicyParams object -// with the ability to set a timeout on a request. -func NewDetailAuthPolicyParamsWithTimeout(timeout time.Duration) *DetailAuthPolicyParams { - return &DetailAuthPolicyParams{ - timeout: timeout, - } -} - -// NewDetailAuthPolicyParamsWithContext creates a new DetailAuthPolicyParams object -// with the ability to set a context for a request. -func NewDetailAuthPolicyParamsWithContext(ctx context.Context) *DetailAuthPolicyParams { - return &DetailAuthPolicyParams{ - Context: ctx, - } -} - -// NewDetailAuthPolicyParamsWithHTTPClient creates a new DetailAuthPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailAuthPolicyParamsWithHTTPClient(client *http.Client) *DetailAuthPolicyParams { - return &DetailAuthPolicyParams{ - HTTPClient: client, - } -} - -/* DetailAuthPolicyParams contains all the parameters to send to the API endpoint - for the detail auth policy operation. - - Typically these are written to a http.Request. -*/ -type DetailAuthPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailAuthPolicyParams) WithDefaults() *DetailAuthPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailAuthPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail auth policy params -func (o *DetailAuthPolicyParams) WithTimeout(timeout time.Duration) *DetailAuthPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail auth policy params -func (o *DetailAuthPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail auth policy params -func (o *DetailAuthPolicyParams) WithContext(ctx context.Context) *DetailAuthPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail auth policy params -func (o *DetailAuthPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail auth policy params -func (o *DetailAuthPolicyParams) WithHTTPClient(client *http.Client) *DetailAuthPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail auth policy params -func (o *DetailAuthPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail auth policy params -func (o *DetailAuthPolicyParams) WithID(id string) *DetailAuthPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail auth policy params -func (o *DetailAuthPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailAuthPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/auth_policy/detail_auth_policy_responses.go b/rest_management_api_client/auth_policy/detail_auth_policy_responses.go deleted file mode 100644 index 7d484b0cd..000000000 --- a/rest_management_api_client/auth_policy/detail_auth_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailAuthPolicyReader is a Reader for the DetailAuthPolicy structure. -type DetailAuthPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailAuthPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailAuthPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailAuthPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailAuthPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailAuthPolicyOK creates a DetailAuthPolicyOK with default headers values -func NewDetailAuthPolicyOK() *DetailAuthPolicyOK { - return &DetailAuthPolicyOK{} -} - -/* DetailAuthPolicyOK describes a response with status code 200, with default header values. - -A singular Auth Policy resource -*/ -type DetailAuthPolicyOK struct { - Payload *rest_model.DetailAuthPolicyEnvelope -} - -func (o *DetailAuthPolicyOK) Error() string { - return fmt.Sprintf("[GET /auth-policies/{id}][%d] detailAuthPolicyOK %+v", 200, o.Payload) -} -func (o *DetailAuthPolicyOK) GetPayload() *rest_model.DetailAuthPolicyEnvelope { - return o.Payload -} - -func (o *DetailAuthPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailAuthPolicyEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailAuthPolicyUnauthorized creates a DetailAuthPolicyUnauthorized with default headers values -func NewDetailAuthPolicyUnauthorized() *DetailAuthPolicyUnauthorized { - return &DetailAuthPolicyUnauthorized{} -} - -/* DetailAuthPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailAuthPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailAuthPolicyUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth-policies/{id}][%d] detailAuthPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DetailAuthPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailAuthPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailAuthPolicyNotFound creates a DetailAuthPolicyNotFound with default headers values -func NewDetailAuthPolicyNotFound() *DetailAuthPolicyNotFound { - return &DetailAuthPolicyNotFound{} -} - -/* DetailAuthPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailAuthPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailAuthPolicyNotFound) Error() string { - return fmt.Sprintf("[GET /auth-policies/{id}][%d] detailAuthPolicyNotFound %+v", 404, o.Payload) -} -func (o *DetailAuthPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailAuthPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/auth_policy/list_auth_policies_parameters.go b/rest_management_api_client/auth_policy/list_auth_policies_parameters.go deleted file mode 100644 index b040d967b..000000000 --- a/rest_management_api_client/auth_policy/list_auth_policies_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListAuthPoliciesParams creates a new ListAuthPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListAuthPoliciesParams() *ListAuthPoliciesParams { - return &ListAuthPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAuthPoliciesParamsWithTimeout creates a new ListAuthPoliciesParams object -// with the ability to set a timeout on a request. -func NewListAuthPoliciesParamsWithTimeout(timeout time.Duration) *ListAuthPoliciesParams { - return &ListAuthPoliciesParams{ - timeout: timeout, - } -} - -// NewListAuthPoliciesParamsWithContext creates a new ListAuthPoliciesParams object -// with the ability to set a context for a request. -func NewListAuthPoliciesParamsWithContext(ctx context.Context) *ListAuthPoliciesParams { - return &ListAuthPoliciesParams{ - Context: ctx, - } -} - -// NewListAuthPoliciesParamsWithHTTPClient creates a new ListAuthPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAuthPoliciesParamsWithHTTPClient(client *http.Client) *ListAuthPoliciesParams { - return &ListAuthPoliciesParams{ - HTTPClient: client, - } -} - -/* ListAuthPoliciesParams contains all the parameters to send to the API endpoint - for the list auth policies operation. - - Typically these are written to a http.Request. -*/ -type ListAuthPoliciesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list auth policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAuthPoliciesParams) WithDefaults() *ListAuthPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list auth policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAuthPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list auth policies params -func (o *ListAuthPoliciesParams) WithTimeout(timeout time.Duration) *ListAuthPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list auth policies params -func (o *ListAuthPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list auth policies params -func (o *ListAuthPoliciesParams) WithContext(ctx context.Context) *ListAuthPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list auth policies params -func (o *ListAuthPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list auth policies params -func (o *ListAuthPoliciesParams) WithHTTPClient(client *http.Client) *ListAuthPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list auth policies params -func (o *ListAuthPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list auth policies params -func (o *ListAuthPoliciesParams) WithFilter(filter *string) *ListAuthPoliciesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list auth policies params -func (o *ListAuthPoliciesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list auth policies params -func (o *ListAuthPoliciesParams) WithLimit(limit *int64) *ListAuthPoliciesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list auth policies params -func (o *ListAuthPoliciesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list auth policies params -func (o *ListAuthPoliciesParams) WithOffset(offset *int64) *ListAuthPoliciesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list auth policies params -func (o *ListAuthPoliciesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAuthPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/auth_policy/list_auth_policies_responses.go b/rest_management_api_client/auth_policy/list_auth_policies_responses.go deleted file mode 100644 index 33359040e..000000000 --- a/rest_management_api_client/auth_policy/list_auth_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListAuthPoliciesReader is a Reader for the ListAuthPolicies structure. -type ListAuthPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAuthPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListAuthPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListAuthPoliciesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListAuthPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListAuthPoliciesOK creates a ListAuthPoliciesOK with default headers values -func NewListAuthPoliciesOK() *ListAuthPoliciesOK { - return &ListAuthPoliciesOK{} -} - -/* ListAuthPoliciesOK describes a response with status code 200, with default header values. - -A list of Auth Policies -*/ -type ListAuthPoliciesOK struct { - Payload *rest_model.ListAuthPoliciesEnvelope -} - -func (o *ListAuthPoliciesOK) Error() string { - return fmt.Sprintf("[GET /auth-policies][%d] listAuthPoliciesOK %+v", 200, o.Payload) -} -func (o *ListAuthPoliciesOK) GetPayload() *rest_model.ListAuthPoliciesEnvelope { - return o.Payload -} - -func (o *ListAuthPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListAuthPoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAuthPoliciesBadRequest creates a ListAuthPoliciesBadRequest with default headers values -func NewListAuthPoliciesBadRequest() *ListAuthPoliciesBadRequest { - return &ListAuthPoliciesBadRequest{} -} - -/* ListAuthPoliciesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListAuthPoliciesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListAuthPoliciesBadRequest) Error() string { - return fmt.Sprintf("[GET /auth-policies][%d] listAuthPoliciesBadRequest %+v", 400, o.Payload) -} -func (o *ListAuthPoliciesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListAuthPoliciesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAuthPoliciesUnauthorized creates a ListAuthPoliciesUnauthorized with default headers values -func NewListAuthPoliciesUnauthorized() *ListAuthPoliciesUnauthorized { - return &ListAuthPoliciesUnauthorized{} -} - -/* ListAuthPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListAuthPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListAuthPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /auth-policies][%d] listAuthPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListAuthPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListAuthPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/auth_policy/patch_auth_policy_parameters.go b/rest_management_api_client/auth_policy/patch_auth_policy_parameters.go deleted file mode 100644 index 7485ad3af..000000000 --- a/rest_management_api_client/auth_policy/patch_auth_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchAuthPolicyParams creates a new PatchAuthPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchAuthPolicyParams() *PatchAuthPolicyParams { - return &PatchAuthPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchAuthPolicyParamsWithTimeout creates a new PatchAuthPolicyParams object -// with the ability to set a timeout on a request. -func NewPatchAuthPolicyParamsWithTimeout(timeout time.Duration) *PatchAuthPolicyParams { - return &PatchAuthPolicyParams{ - timeout: timeout, - } -} - -// NewPatchAuthPolicyParamsWithContext creates a new PatchAuthPolicyParams object -// with the ability to set a context for a request. -func NewPatchAuthPolicyParamsWithContext(ctx context.Context) *PatchAuthPolicyParams { - return &PatchAuthPolicyParams{ - Context: ctx, - } -} - -// NewPatchAuthPolicyParamsWithHTTPClient creates a new PatchAuthPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchAuthPolicyParamsWithHTTPClient(client *http.Client) *PatchAuthPolicyParams { - return &PatchAuthPolicyParams{ - HTTPClient: client, - } -} - -/* PatchAuthPolicyParams contains all the parameters to send to the API endpoint - for the patch auth policy operation. - - Typically these are written to a http.Request. -*/ -type PatchAuthPolicyParams struct { - - /* AuthPolicy. - - An Auth Policy patch object - */ - AuthPolicy *rest_model.AuthPolicyPatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchAuthPolicyParams) WithDefaults() *PatchAuthPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchAuthPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch auth policy params -func (o *PatchAuthPolicyParams) WithTimeout(timeout time.Duration) *PatchAuthPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch auth policy params -func (o *PatchAuthPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch auth policy params -func (o *PatchAuthPolicyParams) WithContext(ctx context.Context) *PatchAuthPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch auth policy params -func (o *PatchAuthPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch auth policy params -func (o *PatchAuthPolicyParams) WithHTTPClient(client *http.Client) *PatchAuthPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch auth policy params -func (o *PatchAuthPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthPolicy adds the authPolicy to the patch auth policy params -func (o *PatchAuthPolicyParams) WithAuthPolicy(authPolicy *rest_model.AuthPolicyPatch) *PatchAuthPolicyParams { - o.SetAuthPolicy(authPolicy) - return o -} - -// SetAuthPolicy adds the authPolicy to the patch auth policy params -func (o *PatchAuthPolicyParams) SetAuthPolicy(authPolicy *rest_model.AuthPolicyPatch) { - o.AuthPolicy = authPolicy -} - -// WithID adds the id to the patch auth policy params -func (o *PatchAuthPolicyParams) WithID(id string) *PatchAuthPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch auth policy params -func (o *PatchAuthPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchAuthPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.AuthPolicy != nil { - if err := r.SetBodyParam(o.AuthPolicy); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/auth_policy/patch_auth_policy_responses.go b/rest_management_api_client/auth_policy/patch_auth_policy_responses.go deleted file mode 100644 index d6ff69259..000000000 --- a/rest_management_api_client/auth_policy/patch_auth_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchAuthPolicyReader is a Reader for the PatchAuthPolicy structure. -type PatchAuthPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchAuthPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchAuthPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchAuthPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchAuthPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchAuthPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchAuthPolicyOK creates a PatchAuthPolicyOK with default headers values -func NewPatchAuthPolicyOK() *PatchAuthPolicyOK { - return &PatchAuthPolicyOK{} -} - -/* PatchAuthPolicyOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchAuthPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *PatchAuthPolicyOK) Error() string { - return fmt.Sprintf("[PATCH /auth-policies/{id}][%d] patchAuthPolicyOK %+v", 200, o.Payload) -} -func (o *PatchAuthPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchAuthPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchAuthPolicyBadRequest creates a PatchAuthPolicyBadRequest with default headers values -func NewPatchAuthPolicyBadRequest() *PatchAuthPolicyBadRequest { - return &PatchAuthPolicyBadRequest{} -} - -/* PatchAuthPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchAuthPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchAuthPolicyBadRequest) Error() string { - return fmt.Sprintf("[PATCH /auth-policies/{id}][%d] patchAuthPolicyBadRequest %+v", 400, o.Payload) -} -func (o *PatchAuthPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchAuthPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchAuthPolicyUnauthorized creates a PatchAuthPolicyUnauthorized with default headers values -func NewPatchAuthPolicyUnauthorized() *PatchAuthPolicyUnauthorized { - return &PatchAuthPolicyUnauthorized{} -} - -/* PatchAuthPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchAuthPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchAuthPolicyUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /auth-policies/{id}][%d] patchAuthPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *PatchAuthPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchAuthPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchAuthPolicyNotFound creates a PatchAuthPolicyNotFound with default headers values -func NewPatchAuthPolicyNotFound() *PatchAuthPolicyNotFound { - return &PatchAuthPolicyNotFound{} -} - -/* PatchAuthPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchAuthPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchAuthPolicyNotFound) Error() string { - return fmt.Sprintf("[PATCH /auth-policies/{id}][%d] patchAuthPolicyNotFound %+v", 404, o.Payload) -} -func (o *PatchAuthPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchAuthPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/auth_policy/update_auth_policy_parameters.go b/rest_management_api_client/auth_policy/update_auth_policy_parameters.go deleted file mode 100644 index 71eac40f6..000000000 --- a/rest_management_api_client/auth_policy/update_auth_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateAuthPolicyParams creates a new UpdateAuthPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateAuthPolicyParams() *UpdateAuthPolicyParams { - return &UpdateAuthPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateAuthPolicyParamsWithTimeout creates a new UpdateAuthPolicyParams object -// with the ability to set a timeout on a request. -func NewUpdateAuthPolicyParamsWithTimeout(timeout time.Duration) *UpdateAuthPolicyParams { - return &UpdateAuthPolicyParams{ - timeout: timeout, - } -} - -// NewUpdateAuthPolicyParamsWithContext creates a new UpdateAuthPolicyParams object -// with the ability to set a context for a request. -func NewUpdateAuthPolicyParamsWithContext(ctx context.Context) *UpdateAuthPolicyParams { - return &UpdateAuthPolicyParams{ - Context: ctx, - } -} - -// NewUpdateAuthPolicyParamsWithHTTPClient creates a new UpdateAuthPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateAuthPolicyParamsWithHTTPClient(client *http.Client) *UpdateAuthPolicyParams { - return &UpdateAuthPolicyParams{ - HTTPClient: client, - } -} - -/* UpdateAuthPolicyParams contains all the parameters to send to the API endpoint - for the update auth policy operation. - - Typically these are written to a http.Request. -*/ -type UpdateAuthPolicyParams struct { - - /* AuthPolicy. - - An Auth Policy update object - */ - AuthPolicy *rest_model.AuthPolicyUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateAuthPolicyParams) WithDefaults() *UpdateAuthPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update auth policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateAuthPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update auth policy params -func (o *UpdateAuthPolicyParams) WithTimeout(timeout time.Duration) *UpdateAuthPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update auth policy params -func (o *UpdateAuthPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update auth policy params -func (o *UpdateAuthPolicyParams) WithContext(ctx context.Context) *UpdateAuthPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update auth policy params -func (o *UpdateAuthPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update auth policy params -func (o *UpdateAuthPolicyParams) WithHTTPClient(client *http.Client) *UpdateAuthPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update auth policy params -func (o *UpdateAuthPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthPolicy adds the authPolicy to the update auth policy params -func (o *UpdateAuthPolicyParams) WithAuthPolicy(authPolicy *rest_model.AuthPolicyUpdate) *UpdateAuthPolicyParams { - o.SetAuthPolicy(authPolicy) - return o -} - -// SetAuthPolicy adds the authPolicy to the update auth policy params -func (o *UpdateAuthPolicyParams) SetAuthPolicy(authPolicy *rest_model.AuthPolicyUpdate) { - o.AuthPolicy = authPolicy -} - -// WithID adds the id to the update auth policy params -func (o *UpdateAuthPolicyParams) WithID(id string) *UpdateAuthPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update auth policy params -func (o *UpdateAuthPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateAuthPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.AuthPolicy != nil { - if err := r.SetBodyParam(o.AuthPolicy); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/auth_policy/update_auth_policy_responses.go b/rest_management_api_client/auth_policy/update_auth_policy_responses.go deleted file mode 100644 index 37e52937a..000000000 --- a/rest_management_api_client/auth_policy/update_auth_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateAuthPolicyReader is a Reader for the UpdateAuthPolicy structure. -type UpdateAuthPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateAuthPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateAuthPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateAuthPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateAuthPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateAuthPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateAuthPolicyOK creates a UpdateAuthPolicyOK with default headers values -func NewUpdateAuthPolicyOK() *UpdateAuthPolicyOK { - return &UpdateAuthPolicyOK{} -} - -/* UpdateAuthPolicyOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateAuthPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateAuthPolicyOK) Error() string { - return fmt.Sprintf("[PUT /auth-policies/{id}][%d] updateAuthPolicyOK %+v", 200, o.Payload) -} -func (o *UpdateAuthPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateAuthPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAuthPolicyBadRequest creates a UpdateAuthPolicyBadRequest with default headers values -func NewUpdateAuthPolicyBadRequest() *UpdateAuthPolicyBadRequest { - return &UpdateAuthPolicyBadRequest{} -} - -/* UpdateAuthPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateAuthPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateAuthPolicyBadRequest) Error() string { - return fmt.Sprintf("[PUT /auth-policies/{id}][%d] updateAuthPolicyBadRequest %+v", 400, o.Payload) -} -func (o *UpdateAuthPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateAuthPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAuthPolicyUnauthorized creates a UpdateAuthPolicyUnauthorized with default headers values -func NewUpdateAuthPolicyUnauthorized() *UpdateAuthPolicyUnauthorized { - return &UpdateAuthPolicyUnauthorized{} -} - -/* UpdateAuthPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateAuthPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateAuthPolicyUnauthorized) Error() string { - return fmt.Sprintf("[PUT /auth-policies/{id}][%d] updateAuthPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateAuthPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateAuthPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAuthPolicyNotFound creates a UpdateAuthPolicyNotFound with default headers values -func NewUpdateAuthPolicyNotFound() *UpdateAuthPolicyNotFound { - return &UpdateAuthPolicyNotFound{} -} - -/* UpdateAuthPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateAuthPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateAuthPolicyNotFound) Error() string { - return fmt.Sprintf("[PUT /auth-policies/{id}][%d] updateAuthPolicyNotFound %+v", 404, o.Payload) -} -func (o *UpdateAuthPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateAuthPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authentication/authenticate_mfa_parameters.go b/rest_management_api_client/authentication/authenticate_mfa_parameters.go deleted file mode 100644 index 4079c1557..000000000 --- a/rest_management_api_client/authentication/authenticate_mfa_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateMfaParams creates a new AuthenticateMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAuthenticateMfaParams() *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAuthenticateMfaParamsWithTimeout creates a new AuthenticateMfaParams object -// with the ability to set a timeout on a request. -func NewAuthenticateMfaParamsWithTimeout(timeout time.Duration) *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - timeout: timeout, - } -} - -// NewAuthenticateMfaParamsWithContext creates a new AuthenticateMfaParams object -// with the ability to set a context for a request. -func NewAuthenticateMfaParamsWithContext(ctx context.Context) *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - Context: ctx, - } -} - -// NewAuthenticateMfaParamsWithHTTPClient creates a new AuthenticateMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewAuthenticateMfaParamsWithHTTPClient(client *http.Client) *AuthenticateMfaParams { - return &AuthenticateMfaParams{ - HTTPClient: client, - } -} - -/* AuthenticateMfaParams contains all the parameters to send to the API endpoint - for the authenticate mfa operation. - - Typically these are written to a http.Request. -*/ -type AuthenticateMfaParams struct { - - /* MfaAuth. - - An MFA validation request - */ - MfaAuth *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the authenticate mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateMfaParams) WithDefaults() *AuthenticateMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the authenticate mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the authenticate mfa params -func (o *AuthenticateMfaParams) WithTimeout(timeout time.Duration) *AuthenticateMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the authenticate mfa params -func (o *AuthenticateMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the authenticate mfa params -func (o *AuthenticateMfaParams) WithContext(ctx context.Context) *AuthenticateMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the authenticate mfa params -func (o *AuthenticateMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the authenticate mfa params -func (o *AuthenticateMfaParams) WithHTTPClient(client *http.Client) *AuthenticateMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the authenticate mfa params -func (o *AuthenticateMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaAuth adds the mfaAuth to the authenticate mfa params -func (o *AuthenticateMfaParams) WithMfaAuth(mfaAuth *rest_model.MfaCode) *AuthenticateMfaParams { - o.SetMfaAuth(mfaAuth) - return o -} - -// SetMfaAuth adds the mfaAuth to the authenticate mfa params -func (o *AuthenticateMfaParams) SetMfaAuth(mfaAuth *rest_model.MfaCode) { - o.MfaAuth = mfaAuth -} - -// WriteToRequest writes these params to a swagger request -func (o *AuthenticateMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.MfaAuth != nil { - if err := r.SetBodyParam(o.MfaAuth); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authentication/authenticate_mfa_responses.go b/rest_management_api_client/authentication/authenticate_mfa_responses.go deleted file mode 100644 index 066827b90..000000000 --- a/rest_management_api_client/authentication/authenticate_mfa_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateMfaReader is a Reader for the AuthenticateMfa structure. -type AuthenticateMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AuthenticateMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAuthenticateMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewAuthenticateMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewAuthenticateMfaOK creates a AuthenticateMfaOK with default headers values -func NewAuthenticateMfaOK() *AuthenticateMfaOK { - return &AuthenticateMfaOK{} -} - -/* AuthenticateMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type AuthenticateMfaOK struct { - Payload *rest_model.Empty -} - -func (o *AuthenticateMfaOK) Error() string { - return fmt.Sprintf("[POST /authenticate/mfa][%d] authenticateMfaOK %+v", 200, o.Payload) -} -func (o *AuthenticateMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *AuthenticateMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAuthenticateMfaUnauthorized creates a AuthenticateMfaUnauthorized with default headers values -func NewAuthenticateMfaUnauthorized() *AuthenticateMfaUnauthorized { - return &AuthenticateMfaUnauthorized{} -} - -/* AuthenticateMfaUnauthorized describes a response with status code 401, with default header values. - -Base empty response -*/ -type AuthenticateMfaUnauthorized struct { - Payload *rest_model.Empty -} - -func (o *AuthenticateMfaUnauthorized) Error() string { - return fmt.Sprintf("[POST /authenticate/mfa][%d] authenticateMfaUnauthorized %+v", 401, o.Payload) -} -func (o *AuthenticateMfaUnauthorized) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *AuthenticateMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authentication/authenticate_parameters.go b/rest_management_api_client/authentication/authenticate_parameters.go deleted file mode 100644 index 6ad327cf4..000000000 --- a/rest_management_api_client/authentication/authenticate_parameters.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateParams creates a new AuthenticateParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAuthenticateParams() *AuthenticateParams { - return &AuthenticateParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAuthenticateParamsWithTimeout creates a new AuthenticateParams object -// with the ability to set a timeout on a request. -func NewAuthenticateParamsWithTimeout(timeout time.Duration) *AuthenticateParams { - return &AuthenticateParams{ - timeout: timeout, - } -} - -// NewAuthenticateParamsWithContext creates a new AuthenticateParams object -// with the ability to set a context for a request. -func NewAuthenticateParamsWithContext(ctx context.Context) *AuthenticateParams { - return &AuthenticateParams{ - Context: ctx, - } -} - -// NewAuthenticateParamsWithHTTPClient creates a new AuthenticateParams object -// with the ability to set a custom HTTPClient for a request. -func NewAuthenticateParamsWithHTTPClient(client *http.Client) *AuthenticateParams { - return &AuthenticateParams{ - HTTPClient: client, - } -} - -/* AuthenticateParams contains all the parameters to send to the API endpoint - for the authenticate operation. - - Typically these are written to a http.Request. -*/ -type AuthenticateParams struct { - - // Auth. - Auth *rest_model.Authenticate - - // Method. - Method string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the authenticate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateParams) WithDefaults() *AuthenticateParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the authenticate params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AuthenticateParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the authenticate params -func (o *AuthenticateParams) WithTimeout(timeout time.Duration) *AuthenticateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the authenticate params -func (o *AuthenticateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the authenticate params -func (o *AuthenticateParams) WithContext(ctx context.Context) *AuthenticateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the authenticate params -func (o *AuthenticateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the authenticate params -func (o *AuthenticateParams) WithHTTPClient(client *http.Client) *AuthenticateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the authenticate params -func (o *AuthenticateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuth adds the auth to the authenticate params -func (o *AuthenticateParams) WithAuth(auth *rest_model.Authenticate) *AuthenticateParams { - o.SetAuth(auth) - return o -} - -// SetAuth adds the auth to the authenticate params -func (o *AuthenticateParams) SetAuth(auth *rest_model.Authenticate) { - o.Auth = auth -} - -// WithMethod adds the method to the authenticate params -func (o *AuthenticateParams) WithMethod(method string) *AuthenticateParams { - o.SetMethod(method) - return o -} - -// SetMethod adds the method to the authenticate params -func (o *AuthenticateParams) SetMethod(method string) { - o.Method = method -} - -// WriteToRequest writes these params to a swagger request -func (o *AuthenticateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Auth != nil { - if err := r.SetBodyParam(o.Auth); err != nil { - return err - } - } - - // query param method - qrMethod := o.Method - qMethod := qrMethod - if qMethod != "" { - - if err := r.SetQueryParam("method", qMethod); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authentication/authenticate_responses.go b/rest_management_api_client/authentication/authenticate_responses.go deleted file mode 100644 index 210eabe0f..000000000 --- a/rest_management_api_client/authentication/authenticate_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateReader is a Reader for the Authenticate structure. -type AuthenticateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AuthenticateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAuthenticateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewAuthenticateBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewAuthenticateForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewAuthenticateOK creates a AuthenticateOK with default headers values -func NewAuthenticateOK() *AuthenticateOK { - return &AuthenticateOK{} -} - -/* AuthenticateOK describes a response with status code 200, with default header values. - -The API session associated with the session used to issue the request -*/ -type AuthenticateOK struct { - Payload *rest_model.CurrentAPISessionDetailEnvelope -} - -func (o *AuthenticateOK) Error() string { - return fmt.Sprintf("[POST /authenticate][%d] authenticateOK %+v", 200, o.Payload) -} -func (o *AuthenticateOK) GetPayload() *rest_model.CurrentAPISessionDetailEnvelope { - return o.Payload -} - -func (o *AuthenticateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CurrentAPISessionDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAuthenticateBadRequest creates a AuthenticateBadRequest with default headers values -func NewAuthenticateBadRequest() *AuthenticateBadRequest { - return &AuthenticateBadRequest{} -} - -/* AuthenticateBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type AuthenticateBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AuthenticateBadRequest) Error() string { - return fmt.Sprintf("[POST /authenticate][%d] authenticateBadRequest %+v", 400, o.Payload) -} -func (o *AuthenticateBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AuthenticateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAuthenticateForbidden creates a AuthenticateForbidden with default headers values -func NewAuthenticateForbidden() *AuthenticateForbidden { - return &AuthenticateForbidden{} -} - -/* AuthenticateForbidden describes a response with status code 403, with default header values. - -The authentication request could not be processed as the credentials are invalid -*/ -type AuthenticateForbidden struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AuthenticateForbidden) Error() string { - return fmt.Sprintf("[POST /authenticate][%d] authenticateForbidden %+v", 403, o.Payload) -} -func (o *AuthenticateForbidden) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AuthenticateForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authentication/authentication_client.go b/rest_management_api_client/authentication/authentication_client.go deleted file mode 100644 index 7c1ea58bc..000000000 --- a/rest_management_api_client/authentication/authentication_client.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new authentication API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for authentication API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) - - AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - Authenticate authenticates via a method supplied via a query string parameter - - Allows authentication Methods include "password" and "cert" - -*/ -func (a *Client) Authenticate(params *AuthenticateParams, opts ...ClientOption) (*AuthenticateOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAuthenticateParams() - } - op := &runtime.ClientOperation{ - ID: "authenticate", - Method: "POST", - PathPattern: "/authenticate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AuthenticateReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AuthenticateOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for authenticate: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - AuthenticateMfa completes m f a authentication - - Completes MFA authentication by submitting a MFA time based one time token or backup code. -*/ -func (a *Client) AuthenticateMfa(params *AuthenticateMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AuthenticateMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAuthenticateMfaParams() - } - op := &runtime.ClientOperation{ - ID: "authenticateMfa", - Method: "POST", - PathPattern: "/authenticate/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AuthenticateMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AuthenticateMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for authenticateMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/authenticator/authenticator_client.go b/rest_management_api_client/authenticator/authenticator_client.go deleted file mode 100644 index f4ae96dce..000000000 --- a/rest_management_api_client/authenticator/authenticator_client.go +++ /dev/null @@ -1,373 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new authenticator API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for authenticator API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthenticatorCreated, error) - - DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthenticatorOK, error) - - DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthenticatorOK, error) - - ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthenticatorsOK, error) - - PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthenticatorOK, error) - - ReEnrollAuthenticator(params *ReEnrollAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollAuthenticatorCreated, error) - - UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthenticatorOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateAuthenticator creates an authenticator - - Creates an authenticator for a specific identity. Requires admin access. - -*/ -func (a *Client) CreateAuthenticator(params *CreateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAuthenticatorCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "createAuthenticator", - Method: "POST", - PathPattern: "/authenticators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateAuthenticatorCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteAuthenticator deletes an authenticator - - Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in. -Requires admin access. - -*/ -func (a *Client) DeleteAuthenticator(params *DeleteAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "deleteAuthenticator", - Method: "DELETE", - PathPattern: "/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailAuthenticator retrieves a single authenticator - - Retrieves a single authenticator by id. Requires admin access. -*/ -func (a *Client) DetailAuthenticator(params *DetailAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "detailAuthenticator", - Method: "GET", - PathPattern: "/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListAuthenticators lists authenticators - - Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated. -This endpoint requires admin access. - -*/ -func (a *Client) ListAuthenticators(params *ListAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAuthenticatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListAuthenticatorsParams() - } - op := &runtime.ClientOperation{ - ID: "listAuthenticators", - Method: "GET", - PathPattern: "/authenticators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListAuthenticatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListAuthenticatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchAuthenticator updates the supplied fields on an authenticator - - Update the supplied fields on an authenticator by id. Requires admin access. -*/ -func (a *Client) PatchAuthenticator(params *PatchAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "patchAuthenticator", - Method: "PATCH", - PathPattern: "/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ReEnrollAuthenticator reverts an authenticator to an enrollment - - Allows an authenticator to be reverted to an enrollment and allows re-enrollment to occur. On success the -created enrollment record response is provided and the source authenticator record will be deleted. The -enrollment created depends on the authenticator. UPDB authenticators result in UPDB enrollments, CERT -authenticators result in OTT enrollments, CERT + CA authenticators result in OTTCA enrollments. - -*/ -func (a *Client) ReEnrollAuthenticator(params *ReEnrollAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollAuthenticatorCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewReEnrollAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "reEnrollAuthenticator", - Method: "POST", - PathPattern: "/authenticators/{id}/re-enroll", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ReEnrollAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ReEnrollAuthenticatorCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for reEnrollAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateAuthenticator updates all fields on an authenticator - - Update all fields on an authenticator by id. Requires admin access. -*/ -func (a *Client) UpdateAuthenticator(params *UpdateAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "updateAuthenticator", - Method: "PUT", - PathPattern: "/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/authenticator/create_authenticator_parameters.go b/rest_management_api_client/authenticator/create_authenticator_parameters.go deleted file mode 100644 index 685c6c971..000000000 --- a/rest_management_api_client/authenticator/create_authenticator_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateAuthenticatorParams creates a new CreateAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateAuthenticatorParams() *CreateAuthenticatorParams { - return &CreateAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateAuthenticatorParamsWithTimeout creates a new CreateAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewCreateAuthenticatorParamsWithTimeout(timeout time.Duration) *CreateAuthenticatorParams { - return &CreateAuthenticatorParams{ - timeout: timeout, - } -} - -// NewCreateAuthenticatorParamsWithContext creates a new CreateAuthenticatorParams object -// with the ability to set a context for a request. -func NewCreateAuthenticatorParamsWithContext(ctx context.Context) *CreateAuthenticatorParams { - return &CreateAuthenticatorParams{ - Context: ctx, - } -} - -// NewCreateAuthenticatorParamsWithHTTPClient creates a new CreateAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateAuthenticatorParamsWithHTTPClient(client *http.Client) *CreateAuthenticatorParams { - return &CreateAuthenticatorParams{ - HTTPClient: client, - } -} - -/* CreateAuthenticatorParams contains all the parameters to send to the API endpoint - for the create authenticator operation. - - Typically these are written to a http.Request. -*/ -type CreateAuthenticatorParams struct { - - /* Authenticator. - - A Authenticator create object - */ - Authenticator *rest_model.AuthenticatorCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAuthenticatorParams) WithDefaults() *CreateAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create authenticator params -func (o *CreateAuthenticatorParams) WithTimeout(timeout time.Duration) *CreateAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create authenticator params -func (o *CreateAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create authenticator params -func (o *CreateAuthenticatorParams) WithContext(ctx context.Context) *CreateAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create authenticator params -func (o *CreateAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create authenticator params -func (o *CreateAuthenticatorParams) WithHTTPClient(client *http.Client) *CreateAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create authenticator params -func (o *CreateAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the create authenticator params -func (o *CreateAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorCreate) *CreateAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the create authenticator params -func (o *CreateAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorCreate) { - o.Authenticator = authenticator -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/create_authenticator_responses.go b/rest_management_api_client/authenticator/create_authenticator_responses.go deleted file mode 100644 index 016991631..000000000 --- a/rest_management_api_client/authenticator/create_authenticator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateAuthenticatorReader is a Reader for the CreateAuthenticator structure. -type CreateAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateAuthenticatorCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateAuthenticatorCreated creates a CreateAuthenticatorCreated with default headers values -func NewCreateAuthenticatorCreated() *CreateAuthenticatorCreated { - return &CreateAuthenticatorCreated{} -} - -/* CreateAuthenticatorCreated describes a response with status code 201, with default header values. - -The create was successful -*/ -type CreateAuthenticatorCreated struct { - Payload *rest_model.AuthenticatorCreate -} - -func (o *CreateAuthenticatorCreated) Error() string { - return fmt.Sprintf("[POST /authenticators][%d] createAuthenticatorCreated %+v", 201, o.Payload) -} -func (o *CreateAuthenticatorCreated) GetPayload() *rest_model.AuthenticatorCreate { - return o.Payload -} - -func (o *CreateAuthenticatorCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.AuthenticatorCreate) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthenticatorBadRequest creates a CreateAuthenticatorBadRequest with default headers values -func NewCreateAuthenticatorBadRequest() *CreateAuthenticatorBadRequest { - return &CreateAuthenticatorBadRequest{} -} - -/* CreateAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[POST /authenticators][%d] createAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *CreateAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateAuthenticatorUnauthorized creates a CreateAuthenticatorUnauthorized with default headers values -func NewCreateAuthenticatorUnauthorized() *CreateAuthenticatorUnauthorized { - return &CreateAuthenticatorUnauthorized{} -} - -/* CreateAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /authenticators][%d] createAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *CreateAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authenticator/delete_authenticator_parameters.go b/rest_management_api_client/authenticator/delete_authenticator_parameters.go deleted file mode 100644 index d432c1757..000000000 --- a/rest_management_api_client/authenticator/delete_authenticator_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteAuthenticatorParams creates a new DeleteAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteAuthenticatorParams() *DeleteAuthenticatorParams { - return &DeleteAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteAuthenticatorParamsWithTimeout creates a new DeleteAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewDeleteAuthenticatorParamsWithTimeout(timeout time.Duration) *DeleteAuthenticatorParams { - return &DeleteAuthenticatorParams{ - timeout: timeout, - } -} - -// NewDeleteAuthenticatorParamsWithContext creates a new DeleteAuthenticatorParams object -// with the ability to set a context for a request. -func NewDeleteAuthenticatorParamsWithContext(ctx context.Context) *DeleteAuthenticatorParams { - return &DeleteAuthenticatorParams{ - Context: ctx, - } -} - -// NewDeleteAuthenticatorParamsWithHTTPClient creates a new DeleteAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteAuthenticatorParamsWithHTTPClient(client *http.Client) *DeleteAuthenticatorParams { - return &DeleteAuthenticatorParams{ - HTTPClient: client, - } -} - -/* DeleteAuthenticatorParams contains all the parameters to send to the API endpoint - for the delete authenticator operation. - - Typically these are written to a http.Request. -*/ -type DeleteAuthenticatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAuthenticatorParams) WithDefaults() *DeleteAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete authenticator params -func (o *DeleteAuthenticatorParams) WithTimeout(timeout time.Duration) *DeleteAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete authenticator params -func (o *DeleteAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete authenticator params -func (o *DeleteAuthenticatorParams) WithContext(ctx context.Context) *DeleteAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete authenticator params -func (o *DeleteAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete authenticator params -func (o *DeleteAuthenticatorParams) WithHTTPClient(client *http.Client) *DeleteAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete authenticator params -func (o *DeleteAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete authenticator params -func (o *DeleteAuthenticatorParams) WithID(id string) *DeleteAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete authenticator params -func (o *DeleteAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/delete_authenticator_responses.go b/rest_management_api_client/authenticator/delete_authenticator_responses.go deleted file mode 100644 index 8e2c96e6d..000000000 --- a/rest_management_api_client/authenticator/delete_authenticator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteAuthenticatorReader is a Reader for the DeleteAuthenticator structure. -type DeleteAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteAuthenticatorOK creates a DeleteAuthenticatorOK with default headers values -func NewDeleteAuthenticatorOK() *DeleteAuthenticatorOK { - return &DeleteAuthenticatorOK{} -} - -/* DeleteAuthenticatorOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteAuthenticatorOK) Error() string { - return fmt.Sprintf("[DELETE /authenticators/{id}][%d] deleteAuthenticatorOK %+v", 200, o.Payload) -} -func (o *DeleteAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAuthenticatorBadRequest creates a DeleteAuthenticatorBadRequest with default headers values -func NewDeleteAuthenticatorBadRequest() *DeleteAuthenticatorBadRequest { - return &DeleteAuthenticatorBadRequest{} -} - -/* DeleteAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[DELETE /authenticators/{id}][%d] deleteAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *DeleteAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteAuthenticatorUnauthorized creates a DeleteAuthenticatorUnauthorized with default headers values -func NewDeleteAuthenticatorUnauthorized() *DeleteAuthenticatorUnauthorized { - return &DeleteAuthenticatorUnauthorized{} -} - -/* DeleteAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /authenticators/{id}][%d] deleteAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authenticator/detail_authenticator_parameters.go b/rest_management_api_client/authenticator/detail_authenticator_parameters.go deleted file mode 100644 index ca5e4dbc6..000000000 --- a/rest_management_api_client/authenticator/detail_authenticator_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailAuthenticatorParams creates a new DetailAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailAuthenticatorParams() *DetailAuthenticatorParams { - return &DetailAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailAuthenticatorParamsWithTimeout creates a new DetailAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewDetailAuthenticatorParamsWithTimeout(timeout time.Duration) *DetailAuthenticatorParams { - return &DetailAuthenticatorParams{ - timeout: timeout, - } -} - -// NewDetailAuthenticatorParamsWithContext creates a new DetailAuthenticatorParams object -// with the ability to set a context for a request. -func NewDetailAuthenticatorParamsWithContext(ctx context.Context) *DetailAuthenticatorParams { - return &DetailAuthenticatorParams{ - Context: ctx, - } -} - -// NewDetailAuthenticatorParamsWithHTTPClient creates a new DetailAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailAuthenticatorParamsWithHTTPClient(client *http.Client) *DetailAuthenticatorParams { - return &DetailAuthenticatorParams{ - HTTPClient: client, - } -} - -/* DetailAuthenticatorParams contains all the parameters to send to the API endpoint - for the detail authenticator operation. - - Typically these are written to a http.Request. -*/ -type DetailAuthenticatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailAuthenticatorParams) WithDefaults() *DetailAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail authenticator params -func (o *DetailAuthenticatorParams) WithTimeout(timeout time.Duration) *DetailAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail authenticator params -func (o *DetailAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail authenticator params -func (o *DetailAuthenticatorParams) WithContext(ctx context.Context) *DetailAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail authenticator params -func (o *DetailAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail authenticator params -func (o *DetailAuthenticatorParams) WithHTTPClient(client *http.Client) *DetailAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail authenticator params -func (o *DetailAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail authenticator params -func (o *DetailAuthenticatorParams) WithID(id string) *DetailAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail authenticator params -func (o *DetailAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/detail_authenticator_responses.go b/rest_management_api_client/authenticator/detail_authenticator_responses.go deleted file mode 100644 index 8551e4eec..000000000 --- a/rest_management_api_client/authenticator/detail_authenticator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailAuthenticatorReader is a Reader for the DetailAuthenticator structure. -type DetailAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailAuthenticatorOK creates a DetailAuthenticatorOK with default headers values -func NewDetailAuthenticatorOK() *DetailAuthenticatorOK { - return &DetailAuthenticatorOK{} -} - -/* DetailAuthenticatorOK describes a response with status code 200, with default header values. - -A singular authenticator resource -*/ -type DetailAuthenticatorOK struct { - Payload *rest_model.DetailAuthenticatorEnvelope -} - -func (o *DetailAuthenticatorOK) Error() string { - return fmt.Sprintf("[GET /authenticators/{id}][%d] detailAuthenticatorOK %+v", 200, o.Payload) -} -func (o *DetailAuthenticatorOK) GetPayload() *rest_model.DetailAuthenticatorEnvelope { - return o.Payload -} - -func (o *DetailAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailAuthenticatorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailAuthenticatorUnauthorized creates a DetailAuthenticatorUnauthorized with default headers values -func NewDetailAuthenticatorUnauthorized() *DetailAuthenticatorUnauthorized { - return &DetailAuthenticatorUnauthorized{} -} - -/* DetailAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[GET /authenticators/{id}][%d] detailAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *DetailAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailAuthenticatorNotFound creates a DetailAuthenticatorNotFound with default headers values -func NewDetailAuthenticatorNotFound() *DetailAuthenticatorNotFound { - return &DetailAuthenticatorNotFound{} -} - -/* DetailAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[GET /authenticators/{id}][%d] detailAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *DetailAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authenticator/list_authenticators_parameters.go b/rest_management_api_client/authenticator/list_authenticators_parameters.go deleted file mode 100644 index 18ca01aaa..000000000 --- a/rest_management_api_client/authenticator/list_authenticators_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListAuthenticatorsParams creates a new ListAuthenticatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListAuthenticatorsParams() *ListAuthenticatorsParams { - return &ListAuthenticatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListAuthenticatorsParamsWithTimeout creates a new ListAuthenticatorsParams object -// with the ability to set a timeout on a request. -func NewListAuthenticatorsParamsWithTimeout(timeout time.Duration) *ListAuthenticatorsParams { - return &ListAuthenticatorsParams{ - timeout: timeout, - } -} - -// NewListAuthenticatorsParamsWithContext creates a new ListAuthenticatorsParams object -// with the ability to set a context for a request. -func NewListAuthenticatorsParamsWithContext(ctx context.Context) *ListAuthenticatorsParams { - return &ListAuthenticatorsParams{ - Context: ctx, - } -} - -// NewListAuthenticatorsParamsWithHTTPClient creates a new ListAuthenticatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListAuthenticatorsParamsWithHTTPClient(client *http.Client) *ListAuthenticatorsParams { - return &ListAuthenticatorsParams{ - HTTPClient: client, - } -} - -/* ListAuthenticatorsParams contains all the parameters to send to the API endpoint - for the list authenticators operation. - - Typically these are written to a http.Request. -*/ -type ListAuthenticatorsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAuthenticatorsParams) WithDefaults() *ListAuthenticatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListAuthenticatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list authenticators params -func (o *ListAuthenticatorsParams) WithTimeout(timeout time.Duration) *ListAuthenticatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list authenticators params -func (o *ListAuthenticatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list authenticators params -func (o *ListAuthenticatorsParams) WithContext(ctx context.Context) *ListAuthenticatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list authenticators params -func (o *ListAuthenticatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list authenticators params -func (o *ListAuthenticatorsParams) WithHTTPClient(client *http.Client) *ListAuthenticatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list authenticators params -func (o *ListAuthenticatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list authenticators params -func (o *ListAuthenticatorsParams) WithFilter(filter *string) *ListAuthenticatorsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list authenticators params -func (o *ListAuthenticatorsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list authenticators params -func (o *ListAuthenticatorsParams) WithLimit(limit *int64) *ListAuthenticatorsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list authenticators params -func (o *ListAuthenticatorsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list authenticators params -func (o *ListAuthenticatorsParams) WithOffset(offset *int64) *ListAuthenticatorsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list authenticators params -func (o *ListAuthenticatorsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListAuthenticatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/list_authenticators_responses.go b/rest_management_api_client/authenticator/list_authenticators_responses.go deleted file mode 100644 index 6cc1b7244..000000000 --- a/rest_management_api_client/authenticator/list_authenticators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListAuthenticatorsReader is a Reader for the ListAuthenticators structure. -type ListAuthenticatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListAuthenticatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListAuthenticatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListAuthenticatorsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListAuthenticatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListAuthenticatorsOK creates a ListAuthenticatorsOK with default headers values -func NewListAuthenticatorsOK() *ListAuthenticatorsOK { - return &ListAuthenticatorsOK{} -} - -/* ListAuthenticatorsOK describes a response with status code 200, with default header values. - -A list of authenticators -*/ -type ListAuthenticatorsOK struct { - Payload *rest_model.ListAuthenticatorsEnvelope -} - -func (o *ListAuthenticatorsOK) Error() string { - return fmt.Sprintf("[GET /authenticators][%d] listAuthenticatorsOK %+v", 200, o.Payload) -} -func (o *ListAuthenticatorsOK) GetPayload() *rest_model.ListAuthenticatorsEnvelope { - return o.Payload -} - -func (o *ListAuthenticatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListAuthenticatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAuthenticatorsBadRequest creates a ListAuthenticatorsBadRequest with default headers values -func NewListAuthenticatorsBadRequest() *ListAuthenticatorsBadRequest { - return &ListAuthenticatorsBadRequest{} -} - -/* ListAuthenticatorsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListAuthenticatorsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListAuthenticatorsBadRequest) Error() string { - return fmt.Sprintf("[GET /authenticators][%d] listAuthenticatorsBadRequest %+v", 400, o.Payload) -} -func (o *ListAuthenticatorsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListAuthenticatorsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListAuthenticatorsUnauthorized creates a ListAuthenticatorsUnauthorized with default headers values -func NewListAuthenticatorsUnauthorized() *ListAuthenticatorsUnauthorized { - return &ListAuthenticatorsUnauthorized{} -} - -/* ListAuthenticatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListAuthenticatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListAuthenticatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /authenticators][%d] listAuthenticatorsUnauthorized %+v", 401, o.Payload) -} -func (o *ListAuthenticatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListAuthenticatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authenticator/patch_authenticator_parameters.go b/rest_management_api_client/authenticator/patch_authenticator_parameters.go deleted file mode 100644 index 9cbec4031..000000000 --- a/rest_management_api_client/authenticator/patch_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchAuthenticatorParams creates a new PatchAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchAuthenticatorParams() *PatchAuthenticatorParams { - return &PatchAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchAuthenticatorParamsWithTimeout creates a new PatchAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewPatchAuthenticatorParamsWithTimeout(timeout time.Duration) *PatchAuthenticatorParams { - return &PatchAuthenticatorParams{ - timeout: timeout, - } -} - -// NewPatchAuthenticatorParamsWithContext creates a new PatchAuthenticatorParams object -// with the ability to set a context for a request. -func NewPatchAuthenticatorParamsWithContext(ctx context.Context) *PatchAuthenticatorParams { - return &PatchAuthenticatorParams{ - Context: ctx, - } -} - -// NewPatchAuthenticatorParamsWithHTTPClient creates a new PatchAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchAuthenticatorParamsWithHTTPClient(client *http.Client) *PatchAuthenticatorParams { - return &PatchAuthenticatorParams{ - HTTPClient: client, - } -} - -/* PatchAuthenticatorParams contains all the parameters to send to the API endpoint - for the patch authenticator operation. - - Typically these are written to a http.Request. -*/ -type PatchAuthenticatorParams struct { - - /* Authenticator. - - An authenticator patch object - */ - Authenticator *rest_model.AuthenticatorPatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchAuthenticatorParams) WithDefaults() *PatchAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch authenticator params -func (o *PatchAuthenticatorParams) WithTimeout(timeout time.Duration) *PatchAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch authenticator params -func (o *PatchAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch authenticator params -func (o *PatchAuthenticatorParams) WithContext(ctx context.Context) *PatchAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch authenticator params -func (o *PatchAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch authenticator params -func (o *PatchAuthenticatorParams) WithHTTPClient(client *http.Client) *PatchAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch authenticator params -func (o *PatchAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the patch authenticator params -func (o *PatchAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorPatch) *PatchAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the patch authenticator params -func (o *PatchAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorPatch) { - o.Authenticator = authenticator -} - -// WithID adds the id to the patch authenticator params -func (o *PatchAuthenticatorParams) WithID(id string) *PatchAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch authenticator params -func (o *PatchAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/patch_authenticator_responses.go b/rest_management_api_client/authenticator/patch_authenticator_responses.go deleted file mode 100644 index f8e2ef47a..000000000 --- a/rest_management_api_client/authenticator/patch_authenticator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchAuthenticatorReader is a Reader for the PatchAuthenticator structure. -type PatchAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchAuthenticatorOK creates a PatchAuthenticatorOK with default headers values -func NewPatchAuthenticatorOK() *PatchAuthenticatorOK { - return &PatchAuthenticatorOK{} -} - -/* PatchAuthenticatorOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *PatchAuthenticatorOK) Error() string { - return fmt.Sprintf("[PATCH /authenticators/{id}][%d] patchAuthenticatorOK %+v", 200, o.Payload) -} -func (o *PatchAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchAuthenticatorBadRequest creates a PatchAuthenticatorBadRequest with default headers values -func NewPatchAuthenticatorBadRequest() *PatchAuthenticatorBadRequest { - return &PatchAuthenticatorBadRequest{} -} - -/* PatchAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[PATCH /authenticators/{id}][%d] patchAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *PatchAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchAuthenticatorUnauthorized creates a PatchAuthenticatorUnauthorized with default headers values -func NewPatchAuthenticatorUnauthorized() *PatchAuthenticatorUnauthorized { - return &PatchAuthenticatorUnauthorized{} -} - -/* PatchAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /authenticators/{id}][%d] patchAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *PatchAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchAuthenticatorNotFound creates a PatchAuthenticatorNotFound with default headers values -func NewPatchAuthenticatorNotFound() *PatchAuthenticatorNotFound { - return &PatchAuthenticatorNotFound{} -} - -/* PatchAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[PATCH /authenticators/{id}][%d] patchAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *PatchAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authenticator/re_enroll_authenticator_parameters.go b/rest_management_api_client/authenticator/re_enroll_authenticator_parameters.go deleted file mode 100644 index 7976ec591..000000000 --- a/rest_management_api_client/authenticator/re_enroll_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewReEnrollAuthenticatorParams creates a new ReEnrollAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewReEnrollAuthenticatorParams() *ReEnrollAuthenticatorParams { - return &ReEnrollAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewReEnrollAuthenticatorParamsWithTimeout creates a new ReEnrollAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewReEnrollAuthenticatorParamsWithTimeout(timeout time.Duration) *ReEnrollAuthenticatorParams { - return &ReEnrollAuthenticatorParams{ - timeout: timeout, - } -} - -// NewReEnrollAuthenticatorParamsWithContext creates a new ReEnrollAuthenticatorParams object -// with the ability to set a context for a request. -func NewReEnrollAuthenticatorParamsWithContext(ctx context.Context) *ReEnrollAuthenticatorParams { - return &ReEnrollAuthenticatorParams{ - Context: ctx, - } -} - -// NewReEnrollAuthenticatorParamsWithHTTPClient creates a new ReEnrollAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewReEnrollAuthenticatorParamsWithHTTPClient(client *http.Client) *ReEnrollAuthenticatorParams { - return &ReEnrollAuthenticatorParams{ - HTTPClient: client, - } -} - -/* ReEnrollAuthenticatorParams contains all the parameters to send to the API endpoint - for the re enroll authenticator operation. - - Typically these are written to a http.Request. -*/ -type ReEnrollAuthenticatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* ReEnroll. - - A reEnrollment request - */ - ReEnroll *rest_model.ReEnroll - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the re enroll authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReEnrollAuthenticatorParams) WithDefaults() *ReEnrollAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the re enroll authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReEnrollAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) WithTimeout(timeout time.Duration) *ReEnrollAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) WithContext(ctx context.Context) *ReEnrollAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) WithHTTPClient(client *http.Client) *ReEnrollAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) WithID(id string) *ReEnrollAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WithReEnroll adds the reEnroll to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) WithReEnroll(reEnroll *rest_model.ReEnroll) *ReEnrollAuthenticatorParams { - o.SetReEnroll(reEnroll) - return o -} - -// SetReEnroll adds the reEnroll to the re enroll authenticator params -func (o *ReEnrollAuthenticatorParams) SetReEnroll(reEnroll *rest_model.ReEnroll) { - o.ReEnroll = reEnroll -} - -// WriteToRequest writes these params to a swagger request -func (o *ReEnrollAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.ReEnroll != nil { - if err := r.SetBodyParam(o.ReEnroll); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/re_enroll_authenticator_responses.go b/rest_management_api_client/authenticator/re_enroll_authenticator_responses.go deleted file mode 100644 index df3c28ed1..000000000 --- a/rest_management_api_client/authenticator/re_enroll_authenticator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ReEnrollAuthenticatorReader is a Reader for the ReEnrollAuthenticator structure. -type ReEnrollAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ReEnrollAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewReEnrollAuthenticatorCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewReEnrollAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewReEnrollAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewReEnrollAuthenticatorCreated creates a ReEnrollAuthenticatorCreated with default headers values -func NewReEnrollAuthenticatorCreated() *ReEnrollAuthenticatorCreated { - return &ReEnrollAuthenticatorCreated{} -} - -/* ReEnrollAuthenticatorCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type ReEnrollAuthenticatorCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *ReEnrollAuthenticatorCreated) Error() string { - return fmt.Sprintf("[POST /authenticators/{id}/re-enroll][%d] reEnrollAuthenticatorCreated %+v", 201, o.Payload) -} -func (o *ReEnrollAuthenticatorCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *ReEnrollAuthenticatorCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReEnrollAuthenticatorUnauthorized creates a ReEnrollAuthenticatorUnauthorized with default headers values -func NewReEnrollAuthenticatorUnauthorized() *ReEnrollAuthenticatorUnauthorized { - return &ReEnrollAuthenticatorUnauthorized{} -} - -/* ReEnrollAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ReEnrollAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ReEnrollAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /authenticators/{id}/re-enroll][%d] reEnrollAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *ReEnrollAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ReEnrollAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReEnrollAuthenticatorNotFound creates a ReEnrollAuthenticatorNotFound with default headers values -func NewReEnrollAuthenticatorNotFound() *ReEnrollAuthenticatorNotFound { - return &ReEnrollAuthenticatorNotFound{} -} - -/* ReEnrollAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ReEnrollAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ReEnrollAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[POST /authenticators/{id}/re-enroll][%d] reEnrollAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *ReEnrollAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ReEnrollAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/authenticator/update_authenticator_parameters.go b/rest_management_api_client/authenticator/update_authenticator_parameters.go deleted file mode 100644 index c8a1a7e9f..000000000 --- a/rest_management_api_client/authenticator/update_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateAuthenticatorParams creates a new UpdateAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateAuthenticatorParams() *UpdateAuthenticatorParams { - return &UpdateAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateAuthenticatorParamsWithTimeout creates a new UpdateAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewUpdateAuthenticatorParamsWithTimeout(timeout time.Duration) *UpdateAuthenticatorParams { - return &UpdateAuthenticatorParams{ - timeout: timeout, - } -} - -// NewUpdateAuthenticatorParamsWithContext creates a new UpdateAuthenticatorParams object -// with the ability to set a context for a request. -func NewUpdateAuthenticatorParamsWithContext(ctx context.Context) *UpdateAuthenticatorParams { - return &UpdateAuthenticatorParams{ - Context: ctx, - } -} - -// NewUpdateAuthenticatorParamsWithHTTPClient creates a new UpdateAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateAuthenticatorParamsWithHTTPClient(client *http.Client) *UpdateAuthenticatorParams { - return &UpdateAuthenticatorParams{ - HTTPClient: client, - } -} - -/* UpdateAuthenticatorParams contains all the parameters to send to the API endpoint - for the update authenticator operation. - - Typically these are written to a http.Request. -*/ -type UpdateAuthenticatorParams struct { - - /* Authenticator. - - An authenticator put object - */ - Authenticator *rest_model.AuthenticatorUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateAuthenticatorParams) WithDefaults() *UpdateAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update authenticator params -func (o *UpdateAuthenticatorParams) WithTimeout(timeout time.Duration) *UpdateAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update authenticator params -func (o *UpdateAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update authenticator params -func (o *UpdateAuthenticatorParams) WithContext(ctx context.Context) *UpdateAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update authenticator params -func (o *UpdateAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update authenticator params -func (o *UpdateAuthenticatorParams) WithHTTPClient(client *http.Client) *UpdateAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update authenticator params -func (o *UpdateAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the update authenticator params -func (o *UpdateAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorUpdate) *UpdateAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the update authenticator params -func (o *UpdateAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorUpdate) { - o.Authenticator = authenticator -} - -// WithID adds the id to the update authenticator params -func (o *UpdateAuthenticatorParams) WithID(id string) *UpdateAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update authenticator params -func (o *UpdateAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/authenticator/update_authenticator_responses.go b/rest_management_api_client/authenticator/update_authenticator_responses.go deleted file mode 100644 index 3c2efae4f..000000000 --- a/rest_management_api_client/authenticator/update_authenticator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateAuthenticatorReader is a Reader for the UpdateAuthenticator structure. -type UpdateAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateAuthenticatorOK creates a UpdateAuthenticatorOK with default headers values -func NewUpdateAuthenticatorOK() *UpdateAuthenticatorOK { - return &UpdateAuthenticatorOK{} -} - -/* UpdateAuthenticatorOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateAuthenticatorOK) Error() string { - return fmt.Sprintf("[PUT /authenticators/{id}][%d] updateAuthenticatorOK %+v", 200, o.Payload) -} -func (o *UpdateAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAuthenticatorBadRequest creates a UpdateAuthenticatorBadRequest with default headers values -func NewUpdateAuthenticatorBadRequest() *UpdateAuthenticatorBadRequest { - return &UpdateAuthenticatorBadRequest{} -} - -/* UpdateAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[PUT /authenticators/{id}][%d] updateAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *UpdateAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAuthenticatorUnauthorized creates a UpdateAuthenticatorUnauthorized with default headers values -func NewUpdateAuthenticatorUnauthorized() *UpdateAuthenticatorUnauthorized { - return &UpdateAuthenticatorUnauthorized{} -} - -/* UpdateAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[PUT /authenticators/{id}][%d] updateAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateAuthenticatorNotFound creates a UpdateAuthenticatorNotFound with default headers values -func NewUpdateAuthenticatorNotFound() *UpdateAuthenticatorNotFound { - return &UpdateAuthenticatorNotFound{} -} - -/* UpdateAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[PUT /authenticators/{id}][%d] updateAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *UpdateAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/certificate_authority_client.go b/rest_management_api_client/certificate_authority/certificate_authority_client.go deleted file mode 100644 index 580e4fc80..000000000 --- a/rest_management_api_client/certificate_authority/certificate_authority_client.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new certificate authority API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for certificate authority API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCaCreated, error) - - DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCaOK, error) - - DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCaOK, error) - - GetCaJWT(params *GetCaJWTParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCaJWTOK, error) - - ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCasOK, error) - - PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCaOK, error) - - UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCaOK, error) - - VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyCaOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateCa creates a c a - - Creates a CA in an unverified state. Requires admin access. -*/ -func (a *Client) CreateCa(params *CreateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateCaCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateCaParams() - } - op := &runtime.ClientOperation{ - ID: "createCa", - Method: "POST", - PathPattern: "/cas", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateCaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateCaCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteCa deletes a c a - - Delete a CA by id. Deleting a CA will delete its associated certificate authenticators. This can make it -impossible for identities to authenticate if they no longer have any valid authenticators. Requires admin access. - -*/ -func (a *Client) DeleteCa(params *DeleteCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteCaParams() - } - op := &runtime.ClientOperation{ - ID: "deleteCa", - Method: "DELETE", - PathPattern: "/cas/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteCaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailCa retrieves a single c a - - Retrieves a single CA by id. Requires admin access. -*/ -func (a *Client) DetailCa(params *DetailCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailCaParams() - } - op := &runtime.ClientOperation{ - ID: "detailCa", - Method: "GET", - PathPattern: "/cas/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailCaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCaJWT retrieves the enrollment JWT for a c a - - For CA auto enrollment, the enrollment JWT is static and provided on each CA resource. This endpoint provides -the jwt as a text response. - -*/ -func (a *Client) GetCaJWT(params *GetCaJWTParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCaJWTOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCaJWTParams() - } - op := &runtime.ClientOperation{ - ID: "getCaJwt", - Method: "GET", - PathPattern: "/cas/{id}/jwt", - ProducesMediaTypes: []string{"application/jwt"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCaJWTReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCaJWTOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCaJwt: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListCas lists c as - - Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access. -*/ -func (a *Client) ListCas(params *ListCasParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCasOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListCasParams() - } - op := &runtime.ClientOperation{ - ID: "listCas", - Method: "GET", - PathPattern: "/cas", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListCasReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListCasOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listCas: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchCa updates the supplied fields on a c a - - Update only the supplied fields on a CA by id. Requires admin access. -*/ -func (a *Client) PatchCa(params *PatchCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchCaParams() - } - op := &runtime.ClientOperation{ - ID: "patchCa", - Method: "PATCH", - PathPattern: "/cas/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchCaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateCa updates all fields on a c a - - Update all fields on a CA by id. Requires admin access. -*/ -func (a *Client) UpdateCa(params *UpdateCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateCaParams() - } - op := &runtime.ClientOperation{ - ID: "updateCa", - Method: "PUT", - PathPattern: "/cas/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateCaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - VerifyCa verifies a c a - - Allows a CA to become verified by submitting a certificate in PEM format that has been signed by the target CA. -The common name on the certificate must match the verificationToken property of the CA. Unverfieid CAs can not -be used for enrollment/authentication. Requires admin access. - -*/ -func (a *Client) VerifyCa(params *VerifyCaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyCaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewVerifyCaParams() - } - op := &runtime.ClientOperation{ - ID: "verifyCa", - Method: "POST", - PathPattern: "/cas/{id}/verify", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"text/plain"}, - Schemes: []string{"https"}, - Params: params, - Reader: &VerifyCaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*VerifyCaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for verifyCa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/certificate_authority/create_ca_parameters.go b/rest_management_api_client/certificate_authority/create_ca_parameters.go deleted file mode 100644 index cac05637f..000000000 --- a/rest_management_api_client/certificate_authority/create_ca_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateCaParams creates a new CreateCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateCaParams() *CreateCaParams { - return &CreateCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateCaParamsWithTimeout creates a new CreateCaParams object -// with the ability to set a timeout on a request. -func NewCreateCaParamsWithTimeout(timeout time.Duration) *CreateCaParams { - return &CreateCaParams{ - timeout: timeout, - } -} - -// NewCreateCaParamsWithContext creates a new CreateCaParams object -// with the ability to set a context for a request. -func NewCreateCaParamsWithContext(ctx context.Context) *CreateCaParams { - return &CreateCaParams{ - Context: ctx, - } -} - -// NewCreateCaParamsWithHTTPClient creates a new CreateCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateCaParamsWithHTTPClient(client *http.Client) *CreateCaParams { - return &CreateCaParams{ - HTTPClient: client, - } -} - -/* CreateCaParams contains all the parameters to send to the API endpoint - for the create ca operation. - - Typically these are written to a http.Request. -*/ -type CreateCaParams struct { - - /* Ca. - - A CA to create - */ - Ca *rest_model.CaCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCaParams) WithDefaults() *CreateCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create ca params -func (o *CreateCaParams) WithTimeout(timeout time.Duration) *CreateCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create ca params -func (o *CreateCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create ca params -func (o *CreateCaParams) WithContext(ctx context.Context) *CreateCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create ca params -func (o *CreateCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create ca params -func (o *CreateCaParams) WithHTTPClient(client *http.Client) *CreateCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create ca params -func (o *CreateCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCa adds the ca to the create ca params -func (o *CreateCaParams) WithCa(ca *rest_model.CaCreate) *CreateCaParams { - o.SetCa(ca) - return o -} - -// SetCa adds the ca to the create ca params -func (o *CreateCaParams) SetCa(ca *rest_model.CaCreate) { - o.Ca = ca -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Ca != nil { - if err := r.SetBodyParam(o.Ca); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/create_ca_responses.go b/rest_management_api_client/certificate_authority/create_ca_responses.go deleted file mode 100644 index 640b9059a..000000000 --- a/rest_management_api_client/certificate_authority/create_ca_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateCaReader is a Reader for the CreateCa structure. -type CreateCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateCaCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateCaBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateCaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateCaCreated creates a CreateCaCreated with default headers values -func NewCreateCaCreated() *CreateCaCreated { - return &CreateCaCreated{} -} - -/* CreateCaCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateCaCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateCaCreated) Error() string { - return fmt.Sprintf("[POST /cas][%d] createCaCreated %+v", 201, o.Payload) -} -func (o *CreateCaCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateCaCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCaBadRequest creates a CreateCaBadRequest with default headers values -func NewCreateCaBadRequest() *CreateCaBadRequest { - return &CreateCaBadRequest{} -} - -/* CreateCaBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateCaBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateCaBadRequest) Error() string { - return fmt.Sprintf("[POST /cas][%d] createCaBadRequest %+v", 400, o.Payload) -} -func (o *CreateCaBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateCaBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateCaUnauthorized creates a CreateCaUnauthorized with default headers values -func NewCreateCaUnauthorized() *CreateCaUnauthorized { - return &CreateCaUnauthorized{} -} - -/* CreateCaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateCaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateCaUnauthorized) Error() string { - return fmt.Sprintf("[POST /cas][%d] createCaUnauthorized %+v", 401, o.Payload) -} -func (o *CreateCaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateCaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/delete_ca_parameters.go b/rest_management_api_client/certificate_authority/delete_ca_parameters.go deleted file mode 100644 index e5bbda418..000000000 --- a/rest_management_api_client/certificate_authority/delete_ca_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCaParams creates a new DeleteCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteCaParams() *DeleteCaParams { - return &DeleteCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteCaParamsWithTimeout creates a new DeleteCaParams object -// with the ability to set a timeout on a request. -func NewDeleteCaParamsWithTimeout(timeout time.Duration) *DeleteCaParams { - return &DeleteCaParams{ - timeout: timeout, - } -} - -// NewDeleteCaParamsWithContext creates a new DeleteCaParams object -// with the ability to set a context for a request. -func NewDeleteCaParamsWithContext(ctx context.Context) *DeleteCaParams { - return &DeleteCaParams{ - Context: ctx, - } -} - -// NewDeleteCaParamsWithHTTPClient creates a new DeleteCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteCaParamsWithHTTPClient(client *http.Client) *DeleteCaParams { - return &DeleteCaParams{ - HTTPClient: client, - } -} - -/* DeleteCaParams contains all the parameters to send to the API endpoint - for the delete ca operation. - - Typically these are written to a http.Request. -*/ -type DeleteCaParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCaParams) WithDefaults() *DeleteCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete ca params -func (o *DeleteCaParams) WithTimeout(timeout time.Duration) *DeleteCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete ca params -func (o *DeleteCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete ca params -func (o *DeleteCaParams) WithContext(ctx context.Context) *DeleteCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete ca params -func (o *DeleteCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete ca params -func (o *DeleteCaParams) WithHTTPClient(client *http.Client) *DeleteCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete ca params -func (o *DeleteCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete ca params -func (o *DeleteCaParams) WithID(id string) *DeleteCaParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete ca params -func (o *DeleteCaParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/delete_ca_responses.go b/rest_management_api_client/certificate_authority/delete_ca_responses.go deleted file mode 100644 index 84ed08728..000000000 --- a/rest_management_api_client/certificate_authority/delete_ca_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCaReader is a Reader for the DeleteCa structure. -type DeleteCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteCaBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteCaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteCaOK creates a DeleteCaOK with default headers values -func NewDeleteCaOK() *DeleteCaOK { - return &DeleteCaOK{} -} - -/* DeleteCaOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteCaOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteCaOK) Error() string { - return fmt.Sprintf("[DELETE /cas/{id}][%d] deleteCaOK %+v", 200, o.Payload) -} -func (o *DeleteCaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCaBadRequest creates a DeleteCaBadRequest with default headers values -func NewDeleteCaBadRequest() *DeleteCaBadRequest { - return &DeleteCaBadRequest{} -} - -/* DeleteCaBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteCaBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteCaBadRequest) Error() string { - return fmt.Sprintf("[DELETE /cas/{id}][%d] deleteCaBadRequest %+v", 400, o.Payload) -} -func (o *DeleteCaBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteCaBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCaUnauthorized creates a DeleteCaUnauthorized with default headers values -func NewDeleteCaUnauthorized() *DeleteCaUnauthorized { - return &DeleteCaUnauthorized{} -} - -/* DeleteCaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteCaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteCaUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /cas/{id}][%d] deleteCaUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteCaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteCaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/detail_ca_parameters.go b/rest_management_api_client/certificate_authority/detail_ca_parameters.go deleted file mode 100644 index 6be10f755..000000000 --- a/rest_management_api_client/certificate_authority/detail_ca_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailCaParams creates a new DetailCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailCaParams() *DetailCaParams { - return &DetailCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailCaParamsWithTimeout creates a new DetailCaParams object -// with the ability to set a timeout on a request. -func NewDetailCaParamsWithTimeout(timeout time.Duration) *DetailCaParams { - return &DetailCaParams{ - timeout: timeout, - } -} - -// NewDetailCaParamsWithContext creates a new DetailCaParams object -// with the ability to set a context for a request. -func NewDetailCaParamsWithContext(ctx context.Context) *DetailCaParams { - return &DetailCaParams{ - Context: ctx, - } -} - -// NewDetailCaParamsWithHTTPClient creates a new DetailCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailCaParamsWithHTTPClient(client *http.Client) *DetailCaParams { - return &DetailCaParams{ - HTTPClient: client, - } -} - -/* DetailCaParams contains all the parameters to send to the API endpoint - for the detail ca operation. - - Typically these are written to a http.Request. -*/ -type DetailCaParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCaParams) WithDefaults() *DetailCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail ca params -func (o *DetailCaParams) WithTimeout(timeout time.Duration) *DetailCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail ca params -func (o *DetailCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail ca params -func (o *DetailCaParams) WithContext(ctx context.Context) *DetailCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail ca params -func (o *DetailCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail ca params -func (o *DetailCaParams) WithHTTPClient(client *http.Client) *DetailCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail ca params -func (o *DetailCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail ca params -func (o *DetailCaParams) WithID(id string) *DetailCaParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail ca params -func (o *DetailCaParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/detail_ca_responses.go b/rest_management_api_client/certificate_authority/detail_ca_responses.go deleted file mode 100644 index fff004131..000000000 --- a/rest_management_api_client/certificate_authority/detail_ca_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailCaReader is a Reader for the DetailCa structure. -type DetailCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailCaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailCaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailCaOK creates a DetailCaOK with default headers values -func NewDetailCaOK() *DetailCaOK { - return &DetailCaOK{} -} - -/* DetailCaOK describes a response with status code 200, with default header values. - -A singular Certificate Authority (CA) resource -*/ -type DetailCaOK struct { - Payload *rest_model.DetailCaEnvelope -} - -func (o *DetailCaOK) Error() string { - return fmt.Sprintf("[GET /cas/{id}][%d] detailCaOK %+v", 200, o.Payload) -} -func (o *DetailCaOK) GetPayload() *rest_model.DetailCaEnvelope { - return o.Payload -} - -func (o *DetailCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailCaEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCaUnauthorized creates a DetailCaUnauthorized with default headers values -func NewDetailCaUnauthorized() *DetailCaUnauthorized { - return &DetailCaUnauthorized{} -} - -/* DetailCaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailCaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCaUnauthorized) Error() string { - return fmt.Sprintf("[GET /cas/{id}][%d] detailCaUnauthorized %+v", 401, o.Payload) -} -func (o *DetailCaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCaNotFound creates a DetailCaNotFound with default headers values -func NewDetailCaNotFound() *DetailCaNotFound { - return &DetailCaNotFound{} -} - -/* DetailCaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailCaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCaNotFound) Error() string { - return fmt.Sprintf("[GET /cas/{id}][%d] detailCaNotFound %+v", 404, o.Payload) -} -func (o *DetailCaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/get_ca_jwt_parameters.go b/rest_management_api_client/certificate_authority/get_ca_jwt_parameters.go deleted file mode 100644 index 678358bf6..000000000 --- a/rest_management_api_client/certificate_authority/get_ca_jwt_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCaJWTParams creates a new GetCaJWTParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCaJWTParams() *GetCaJWTParams { - return &GetCaJWTParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCaJWTParamsWithTimeout creates a new GetCaJWTParams object -// with the ability to set a timeout on a request. -func NewGetCaJWTParamsWithTimeout(timeout time.Duration) *GetCaJWTParams { - return &GetCaJWTParams{ - timeout: timeout, - } -} - -// NewGetCaJWTParamsWithContext creates a new GetCaJWTParams object -// with the ability to set a context for a request. -func NewGetCaJWTParamsWithContext(ctx context.Context) *GetCaJWTParams { - return &GetCaJWTParams{ - Context: ctx, - } -} - -// NewGetCaJWTParamsWithHTTPClient creates a new GetCaJWTParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCaJWTParamsWithHTTPClient(client *http.Client) *GetCaJWTParams { - return &GetCaJWTParams{ - HTTPClient: client, - } -} - -/* GetCaJWTParams contains all the parameters to send to the API endpoint - for the get ca Jwt operation. - - Typically these are written to a http.Request. -*/ -type GetCaJWTParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get ca Jwt params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCaJWTParams) WithDefaults() *GetCaJWTParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get ca Jwt params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCaJWTParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get ca Jwt params -func (o *GetCaJWTParams) WithTimeout(timeout time.Duration) *GetCaJWTParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get ca Jwt params -func (o *GetCaJWTParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get ca Jwt params -func (o *GetCaJWTParams) WithContext(ctx context.Context) *GetCaJWTParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get ca Jwt params -func (o *GetCaJWTParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get ca Jwt params -func (o *GetCaJWTParams) WithHTTPClient(client *http.Client) *GetCaJWTParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get ca Jwt params -func (o *GetCaJWTParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get ca Jwt params -func (o *GetCaJWTParams) WithID(id string) *GetCaJWTParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get ca Jwt params -func (o *GetCaJWTParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCaJWTParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/get_ca_jwt_responses.go b/rest_management_api_client/certificate_authority/get_ca_jwt_responses.go deleted file mode 100644 index 697441d2c..000000000 --- a/rest_management_api_client/certificate_authority/get_ca_jwt_responses.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetCaJWTReader is a Reader for the GetCaJWT structure. -type GetCaJWTReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCaJWTReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCaJWTOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCaJWTUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetCaJWTNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCaJWTOK creates a GetCaJWTOK with default headers values -func NewGetCaJWTOK() *GetCaJWTOK { - return &GetCaJWTOK{} -} - -/* GetCaJWTOK describes a response with status code 200, with default header values. - -The result is the JWT text to validate the CA -*/ -type GetCaJWTOK struct { - Payload string -} - -func (o *GetCaJWTOK) Error() string { - return fmt.Sprintf("[GET /cas/{id}/jwt][%d] getCaJwtOK %+v", 200, o.Payload) -} -func (o *GetCaJWTOK) GetPayload() string { - return o.Payload -} - -func (o *GetCaJWTOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCaJWTUnauthorized creates a GetCaJWTUnauthorized with default headers values -func NewGetCaJWTUnauthorized() *GetCaJWTUnauthorized { - return &GetCaJWTUnauthorized{} -} - -/* GetCaJWTUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetCaJWTUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCaJWTUnauthorized) Error() string { - return fmt.Sprintf("[GET /cas/{id}/jwt][%d] getCaJwtUnauthorized %+v", 401, o.Payload) -} -func (o *GetCaJWTUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCaJWTUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCaJWTNotFound creates a GetCaJWTNotFound with default headers values -func NewGetCaJWTNotFound() *GetCaJWTNotFound { - return &GetCaJWTNotFound{} -} - -/* GetCaJWTNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type GetCaJWTNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCaJWTNotFound) Error() string { - return fmt.Sprintf("[GET /cas/{id}/jwt][%d] getCaJwtNotFound %+v", 404, o.Payload) -} -func (o *GetCaJWTNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCaJWTNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/list_cas_parameters.go b/rest_management_api_client/certificate_authority/list_cas_parameters.go deleted file mode 100644 index c72bdc759..000000000 --- a/rest_management_api_client/certificate_authority/list_cas_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCasParams creates a new ListCasParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListCasParams() *ListCasParams { - return &ListCasParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListCasParamsWithTimeout creates a new ListCasParams object -// with the ability to set a timeout on a request. -func NewListCasParamsWithTimeout(timeout time.Duration) *ListCasParams { - return &ListCasParams{ - timeout: timeout, - } -} - -// NewListCasParamsWithContext creates a new ListCasParams object -// with the ability to set a context for a request. -func NewListCasParamsWithContext(ctx context.Context) *ListCasParams { - return &ListCasParams{ - Context: ctx, - } -} - -// NewListCasParamsWithHTTPClient creates a new ListCasParams object -// with the ability to set a custom HTTPClient for a request. -func NewListCasParamsWithHTTPClient(client *http.Client) *ListCasParams { - return &ListCasParams{ - HTTPClient: client, - } -} - -/* ListCasParams contains all the parameters to send to the API endpoint - for the list cas operation. - - Typically these are written to a http.Request. -*/ -type ListCasParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list cas params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCasParams) WithDefaults() *ListCasParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list cas params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCasParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list cas params -func (o *ListCasParams) WithTimeout(timeout time.Duration) *ListCasParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list cas params -func (o *ListCasParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list cas params -func (o *ListCasParams) WithContext(ctx context.Context) *ListCasParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list cas params -func (o *ListCasParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list cas params -func (o *ListCasParams) WithHTTPClient(client *http.Client) *ListCasParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list cas params -func (o *ListCasParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list cas params -func (o *ListCasParams) WithFilter(filter *string) *ListCasParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list cas params -func (o *ListCasParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list cas params -func (o *ListCasParams) WithLimit(limit *int64) *ListCasParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list cas params -func (o *ListCasParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list cas params -func (o *ListCasParams) WithOffset(offset *int64) *ListCasParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list cas params -func (o *ListCasParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListCasParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/list_cas_responses.go b/rest_management_api_client/certificate_authority/list_cas_responses.go deleted file mode 100644 index 50e3eb818..000000000 --- a/rest_management_api_client/certificate_authority/list_cas_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListCasReader is a Reader for the ListCas structure. -type ListCasReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListCasReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListCasOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListCasBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListCasUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListCasOK creates a ListCasOK with default headers values -func NewListCasOK() *ListCasOK { - return &ListCasOK{} -} - -/* ListCasOK describes a response with status code 200, with default header values. - -A list of Certificate Authorities (CAs) -*/ -type ListCasOK struct { - Payload *rest_model.ListCasEnvelope -} - -func (o *ListCasOK) Error() string { - return fmt.Sprintf("[GET /cas][%d] listCasOK %+v", 200, o.Payload) -} -func (o *ListCasOK) GetPayload() *rest_model.ListCasEnvelope { - return o.Payload -} - -func (o *ListCasOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListCasEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCasBadRequest creates a ListCasBadRequest with default headers values -func NewListCasBadRequest() *ListCasBadRequest { - return &ListCasBadRequest{} -} - -/* ListCasBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListCasBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCasBadRequest) Error() string { - return fmt.Sprintf("[GET /cas][%d] listCasBadRequest %+v", 400, o.Payload) -} -func (o *ListCasBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCasBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCasUnauthorized creates a ListCasUnauthorized with default headers values -func NewListCasUnauthorized() *ListCasUnauthorized { - return &ListCasUnauthorized{} -} - -/* ListCasUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListCasUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCasUnauthorized) Error() string { - return fmt.Sprintf("[GET /cas][%d] listCasUnauthorized %+v", 401, o.Payload) -} -func (o *ListCasUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCasUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/patch_ca_parameters.go b/rest_management_api_client/certificate_authority/patch_ca_parameters.go deleted file mode 100644 index a5e11dfcb..000000000 --- a/rest_management_api_client/certificate_authority/patch_ca_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchCaParams creates a new PatchCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchCaParams() *PatchCaParams { - return &PatchCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchCaParamsWithTimeout creates a new PatchCaParams object -// with the ability to set a timeout on a request. -func NewPatchCaParamsWithTimeout(timeout time.Duration) *PatchCaParams { - return &PatchCaParams{ - timeout: timeout, - } -} - -// NewPatchCaParamsWithContext creates a new PatchCaParams object -// with the ability to set a context for a request. -func NewPatchCaParamsWithContext(ctx context.Context) *PatchCaParams { - return &PatchCaParams{ - Context: ctx, - } -} - -// NewPatchCaParamsWithHTTPClient creates a new PatchCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchCaParamsWithHTTPClient(client *http.Client) *PatchCaParams { - return &PatchCaParams{ - HTTPClient: client, - } -} - -/* PatchCaParams contains all the parameters to send to the API endpoint - for the patch ca operation. - - Typically these are written to a http.Request. -*/ -type PatchCaParams struct { - - /* Ca. - - A CA patch object - */ - Ca *rest_model.CaPatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchCaParams) WithDefaults() *PatchCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch ca params -func (o *PatchCaParams) WithTimeout(timeout time.Duration) *PatchCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch ca params -func (o *PatchCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch ca params -func (o *PatchCaParams) WithContext(ctx context.Context) *PatchCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch ca params -func (o *PatchCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch ca params -func (o *PatchCaParams) WithHTTPClient(client *http.Client) *PatchCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch ca params -func (o *PatchCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCa adds the ca to the patch ca params -func (o *PatchCaParams) WithCa(ca *rest_model.CaPatch) *PatchCaParams { - o.SetCa(ca) - return o -} - -// SetCa adds the ca to the patch ca params -func (o *PatchCaParams) SetCa(ca *rest_model.CaPatch) { - o.Ca = ca -} - -// WithID adds the id to the patch ca params -func (o *PatchCaParams) WithID(id string) *PatchCaParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch ca params -func (o *PatchCaParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Ca != nil { - if err := r.SetBodyParam(o.Ca); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/patch_ca_responses.go b/rest_management_api_client/certificate_authority/patch_ca_responses.go deleted file mode 100644 index 6f41f7046..000000000 --- a/rest_management_api_client/certificate_authority/patch_ca_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchCaReader is a Reader for the PatchCa structure. -type PatchCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchCaBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchCaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchCaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchCaOK creates a PatchCaOK with default headers values -func NewPatchCaOK() *PatchCaOK { - return &PatchCaOK{} -} - -/* PatchCaOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchCaOK struct { - Payload *rest_model.Empty -} - -func (o *PatchCaOK) Error() string { - return fmt.Sprintf("[PATCH /cas/{id}][%d] patchCaOK %+v", 200, o.Payload) -} -func (o *PatchCaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCaBadRequest creates a PatchCaBadRequest with default headers values -func NewPatchCaBadRequest() *PatchCaBadRequest { - return &PatchCaBadRequest{} -} - -/* PatchCaBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchCaBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCaBadRequest) Error() string { - return fmt.Sprintf("[PATCH /cas/{id}][%d] patchCaBadRequest %+v", 400, o.Payload) -} -func (o *PatchCaBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCaBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCaUnauthorized creates a PatchCaUnauthorized with default headers values -func NewPatchCaUnauthorized() *PatchCaUnauthorized { - return &PatchCaUnauthorized{} -} - -/* PatchCaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchCaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCaUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /cas/{id}][%d] patchCaUnauthorized %+v", 401, o.Payload) -} -func (o *PatchCaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCaNotFound creates a PatchCaNotFound with default headers values -func NewPatchCaNotFound() *PatchCaNotFound { - return &PatchCaNotFound{} -} - -/* PatchCaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchCaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCaNotFound) Error() string { - return fmt.Sprintf("[PATCH /cas/{id}][%d] patchCaNotFound %+v", 404, o.Payload) -} -func (o *PatchCaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/update_ca_parameters.go b/rest_management_api_client/certificate_authority/update_ca_parameters.go deleted file mode 100644 index d52bacc21..000000000 --- a/rest_management_api_client/certificate_authority/update_ca_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateCaParams creates a new UpdateCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateCaParams() *UpdateCaParams { - return &UpdateCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateCaParamsWithTimeout creates a new UpdateCaParams object -// with the ability to set a timeout on a request. -func NewUpdateCaParamsWithTimeout(timeout time.Duration) *UpdateCaParams { - return &UpdateCaParams{ - timeout: timeout, - } -} - -// NewUpdateCaParamsWithContext creates a new UpdateCaParams object -// with the ability to set a context for a request. -func NewUpdateCaParamsWithContext(ctx context.Context) *UpdateCaParams { - return &UpdateCaParams{ - Context: ctx, - } -} - -// NewUpdateCaParamsWithHTTPClient creates a new UpdateCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateCaParamsWithHTTPClient(client *http.Client) *UpdateCaParams { - return &UpdateCaParams{ - HTTPClient: client, - } -} - -/* UpdateCaParams contains all the parameters to send to the API endpoint - for the update ca operation. - - Typically these are written to a http.Request. -*/ -type UpdateCaParams struct { - - /* Ca. - - A CA update object - */ - Ca *rest_model.CaUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCaParams) WithDefaults() *UpdateCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update ca params -func (o *UpdateCaParams) WithTimeout(timeout time.Duration) *UpdateCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update ca params -func (o *UpdateCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update ca params -func (o *UpdateCaParams) WithContext(ctx context.Context) *UpdateCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update ca params -func (o *UpdateCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update ca params -func (o *UpdateCaParams) WithHTTPClient(client *http.Client) *UpdateCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update ca params -func (o *UpdateCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCa adds the ca to the update ca params -func (o *UpdateCaParams) WithCa(ca *rest_model.CaUpdate) *UpdateCaParams { - o.SetCa(ca) - return o -} - -// SetCa adds the ca to the update ca params -func (o *UpdateCaParams) SetCa(ca *rest_model.CaUpdate) { - o.Ca = ca -} - -// WithID adds the id to the update ca params -func (o *UpdateCaParams) WithID(id string) *UpdateCaParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update ca params -func (o *UpdateCaParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Ca != nil { - if err := r.SetBodyParam(o.Ca); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/update_ca_responses.go b/rest_management_api_client/certificate_authority/update_ca_responses.go deleted file mode 100644 index 1c99e96bc..000000000 --- a/rest_management_api_client/certificate_authority/update_ca_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateCaReader is a Reader for the UpdateCa structure. -type UpdateCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateCaBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateCaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateCaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateCaOK creates a UpdateCaOK with default headers values -func NewUpdateCaOK() *UpdateCaOK { - return &UpdateCaOK{} -} - -/* UpdateCaOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateCaOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateCaOK) Error() string { - return fmt.Sprintf("[PUT /cas/{id}][%d] updateCaOK %+v", 200, o.Payload) -} -func (o *UpdateCaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCaBadRequest creates a UpdateCaBadRequest with default headers values -func NewUpdateCaBadRequest() *UpdateCaBadRequest { - return &UpdateCaBadRequest{} -} - -/* UpdateCaBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateCaBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCaBadRequest) Error() string { - return fmt.Sprintf("[PUT /cas/{id}][%d] updateCaBadRequest %+v", 400, o.Payload) -} -func (o *UpdateCaBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCaBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCaUnauthorized creates a UpdateCaUnauthorized with default headers values -func NewUpdateCaUnauthorized() *UpdateCaUnauthorized { - return &UpdateCaUnauthorized{} -} - -/* UpdateCaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateCaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCaUnauthorized) Error() string { - return fmt.Sprintf("[PUT /cas/{id}][%d] updateCaUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateCaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCaNotFound creates a UpdateCaNotFound with default headers values -func NewUpdateCaNotFound() *UpdateCaNotFound { - return &UpdateCaNotFound{} -} - -/* UpdateCaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateCaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCaNotFound) Error() string { - return fmt.Sprintf("[PUT /cas/{id}][%d] updateCaNotFound %+v", 404, o.Payload) -} -func (o *UpdateCaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/certificate_authority/verify_ca_parameters.go b/rest_management_api_client/certificate_authority/verify_ca_parameters.go deleted file mode 100644 index 043d7d80c..000000000 --- a/rest_management_api_client/certificate_authority/verify_ca_parameters.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewVerifyCaParams creates a new VerifyCaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewVerifyCaParams() *VerifyCaParams { - return &VerifyCaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewVerifyCaParamsWithTimeout creates a new VerifyCaParams object -// with the ability to set a timeout on a request. -func NewVerifyCaParamsWithTimeout(timeout time.Duration) *VerifyCaParams { - return &VerifyCaParams{ - timeout: timeout, - } -} - -// NewVerifyCaParamsWithContext creates a new VerifyCaParams object -// with the ability to set a context for a request. -func NewVerifyCaParamsWithContext(ctx context.Context) *VerifyCaParams { - return &VerifyCaParams{ - Context: ctx, - } -} - -// NewVerifyCaParamsWithHTTPClient creates a new VerifyCaParams object -// with the ability to set a custom HTTPClient for a request. -func NewVerifyCaParamsWithHTTPClient(client *http.Client) *VerifyCaParams { - return &VerifyCaParams{ - HTTPClient: client, - } -} - -/* VerifyCaParams contains all the parameters to send to the API endpoint - for the verify ca operation. - - Typically these are written to a http.Request. -*/ -type VerifyCaParams struct { - - /* Certificate. - - A PEM formatted certificate signed by the target CA with the common name matching the CA's validationToken - */ - Certificate string - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the verify ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VerifyCaParams) WithDefaults() *VerifyCaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the verify ca params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VerifyCaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the verify ca params -func (o *VerifyCaParams) WithTimeout(timeout time.Duration) *VerifyCaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the verify ca params -func (o *VerifyCaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the verify ca params -func (o *VerifyCaParams) WithContext(ctx context.Context) *VerifyCaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the verify ca params -func (o *VerifyCaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the verify ca params -func (o *VerifyCaParams) WithHTTPClient(client *http.Client) *VerifyCaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the verify ca params -func (o *VerifyCaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithCertificate adds the certificate to the verify ca params -func (o *VerifyCaParams) WithCertificate(certificate string) *VerifyCaParams { - o.SetCertificate(certificate) - return o -} - -// SetCertificate adds the certificate to the verify ca params -func (o *VerifyCaParams) SetCertificate(certificate string) { - o.Certificate = certificate -} - -// WithID adds the id to the verify ca params -func (o *VerifyCaParams) WithID(id string) *VerifyCaParams { - o.SetID(id) - return o -} - -// SetID adds the id to the verify ca params -func (o *VerifyCaParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *VerifyCaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Certificate); err != nil { - return err - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/certificate_authority/verify_ca_responses.go b/rest_management_api_client/certificate_authority/verify_ca_responses.go deleted file mode 100644 index 8f2fcc600..000000000 --- a/rest_management_api_client/certificate_authority/verify_ca_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// VerifyCaReader is a Reader for the VerifyCa structure. -type VerifyCaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *VerifyCaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewVerifyCaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewVerifyCaBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewVerifyCaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewVerifyCaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewVerifyCaOK creates a VerifyCaOK with default headers values -func NewVerifyCaOK() *VerifyCaOK { - return &VerifyCaOK{} -} - -/* VerifyCaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type VerifyCaOK struct { - Payload *rest_model.Empty -} - -func (o *VerifyCaOK) Error() string { - return fmt.Sprintf("[POST /cas/{id}/verify][%d] verifyCaOK %+v", 200, o.Payload) -} -func (o *VerifyCaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *VerifyCaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyCaBadRequest creates a VerifyCaBadRequest with default headers values -func NewVerifyCaBadRequest() *VerifyCaBadRequest { - return &VerifyCaBadRequest{} -} - -/* VerifyCaBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type VerifyCaBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyCaBadRequest) Error() string { - return fmt.Sprintf("[POST /cas/{id}/verify][%d] verifyCaBadRequest %+v", 400, o.Payload) -} -func (o *VerifyCaBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyCaBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyCaUnauthorized creates a VerifyCaUnauthorized with default headers values -func NewVerifyCaUnauthorized() *VerifyCaUnauthorized { - return &VerifyCaUnauthorized{} -} - -/* VerifyCaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type VerifyCaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyCaUnauthorized) Error() string { - return fmt.Sprintf("[POST /cas/{id}/verify][%d] verifyCaUnauthorized %+v", 401, o.Payload) -} -func (o *VerifyCaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyCaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyCaNotFound creates a VerifyCaNotFound with default headers values -func NewVerifyCaNotFound() *VerifyCaNotFound { - return &VerifyCaNotFound{} -} - -/* VerifyCaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type VerifyCaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyCaNotFound) Error() string { - return fmt.Sprintf("[POST /cas/{id}/verify][%d] verifyCaNotFound %+v", 404, o.Payload) -} -func (o *VerifyCaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyCaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/config_client.go b/rest_management_api_client/config/config_client.go deleted file mode 100644 index 378db8959..000000000 --- a/rest_management_api_client/config/config_client.go +++ /dev/null @@ -1,622 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new config API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for config API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigCreated, error) - - CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigTypeCreated, error) - - DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) - - DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigTypeOK, error) - - DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigOK, error) - - DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error) - - ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error) - - ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) - - ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsForConfigTypeOK, error) - - PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigOK, error) - - PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigTypeOK, error) - - UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) - - UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigTypeOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateConfig creates a config resource - - Create a config resource. Requires admin access. -*/ -func (a *Client) CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateConfigParams() - } - op := &runtime.ClientOperation{ - ID: "createConfig", - Method: "POST", - PathPattern: "/configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateConfigReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateConfigCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateConfigType creates a config type requires admin access -*/ -func (a *Client) CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigTypeCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateConfigTypeParams() - } - op := &runtime.ClientOperation{ - ID: "createConfigType", - Method: "POST", - PathPattern: "/config-types", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateConfigTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateConfigTypeCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteConfig deletes a config - - Delete a config by id. Requires admin access. -*/ -func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteConfigParams() - } - op := &runtime.ClientOperation{ - ID: "deleteConfig", - Method: "DELETE", - PathPattern: "/configs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteConfigReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteConfigOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteConfigType deletes a config type - - Delete a config-type by id. Removing a configuration type that are in use will result in a 409 conflict HTTP status code and error. All configurations of a type must be removed first. -*/ -func (a *Client) DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteConfigTypeParams() - } - op := &runtime.ClientOperation{ - ID: "deleteConfigType", - Method: "DELETE", - PathPattern: "/config-types/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteConfigTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteConfigTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailConfig retrieves a single config - - Retrieves a single config by id. Requires admin access. -*/ -func (a *Client) DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailConfigParams() - } - op := &runtime.ClientOperation{ - ID: "detailConfig", - Method: "GET", - PathPattern: "/configs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailConfigReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailConfigOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailConfigType retrieves a single config type - - Retrieves a single config-type by id. Requires admin access. -*/ -func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailConfigTypeParams() - } - op := &runtime.ClientOperation{ - ID: "detailConfigType", - Method: "GET", - PathPattern: "/config-types/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailConfigTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailConfigTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListConfigTypes lists config types - - Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListConfigTypesParams() - } - op := &runtime.ClientOperation{ - ID: "listConfigTypes", - Method: "GET", - PathPattern: "/config-types", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListConfigTypesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListConfigTypesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listConfigTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListConfigs lists configs - - Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListConfigsParams() - } - op := &runtime.ClientOperation{ - ID: "listConfigs", - Method: "GET", - PathPattern: "/configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListConfigsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListConfigsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListConfigsForConfigType lists the configs of a specific config type - - Lists the configs associated to a config-type. Requires admin access. -*/ -func (a *Client) ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsForConfigTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListConfigsForConfigTypeParams() - } - op := &runtime.ClientOperation{ - ID: "listConfigsForConfigType", - Method: "GET", - PathPattern: "/config-types/{id}/configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListConfigsForConfigTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListConfigsForConfigTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listConfigsForConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchConfig updates the supplied fields on a config - - Update the supplied fields on a config. Requires admin access. -*/ -func (a *Client) PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchConfigParams() - } - op := &runtime.ClientOperation{ - ID: "patchConfig", - Method: "PATCH", - PathPattern: "/configs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchConfigReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchConfigOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchConfigType updates the supplied fields on a config type - - Update the supplied fields on a config-type. Requires admin access. -*/ -func (a *Client) PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchConfigTypeParams() - } - op := &runtime.ClientOperation{ - ID: "patchConfigType", - Method: "PATCH", - PathPattern: "/config-types/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchConfigTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchConfigTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateConfig updates all fields on a config - - Update all fields on a config by id. Requires admin access. -*/ -func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateConfigParams() - } - op := &runtime.ClientOperation{ - ID: "updateConfig", - Method: "PUT", - PathPattern: "/configs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateConfigReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateConfigOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateConfigType updates all fields on a config type - - Update all fields on a config-type by id. Requires admin access. -*/ -func (a *Client) UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateConfigTypeParams() - } - op := &runtime.ClientOperation{ - ID: "updateConfigType", - Method: "PUT", - PathPattern: "/config-types/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateConfigTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateConfigTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/config/create_config_parameters.go b/rest_management_api_client/config/create_config_parameters.go deleted file mode 100644 index d9d80acb1..000000000 --- a/rest_management_api_client/config/create_config_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateConfigParams creates a new CreateConfigParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateConfigParams() *CreateConfigParams { - return &CreateConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateConfigParamsWithTimeout creates a new CreateConfigParams object -// with the ability to set a timeout on a request. -func NewCreateConfigParamsWithTimeout(timeout time.Duration) *CreateConfigParams { - return &CreateConfigParams{ - timeout: timeout, - } -} - -// NewCreateConfigParamsWithContext creates a new CreateConfigParams object -// with the ability to set a context for a request. -func NewCreateConfigParamsWithContext(ctx context.Context) *CreateConfigParams { - return &CreateConfigParams{ - Context: ctx, - } -} - -// NewCreateConfigParamsWithHTTPClient creates a new CreateConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateConfigParamsWithHTTPClient(client *http.Client) *CreateConfigParams { - return &CreateConfigParams{ - HTTPClient: client, - } -} - -/* CreateConfigParams contains all the parameters to send to the API endpoint - for the create config operation. - - Typically these are written to a http.Request. -*/ -type CreateConfigParams struct { - - /* Config. - - A config to create - */ - Config *rest_model.ConfigCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateConfigParams) WithDefaults() *CreateConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create config params -func (o *CreateConfigParams) WithTimeout(timeout time.Duration) *CreateConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create config params -func (o *CreateConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create config params -func (o *CreateConfigParams) WithContext(ctx context.Context) *CreateConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create config params -func (o *CreateConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create config params -func (o *CreateConfigParams) WithHTTPClient(client *http.Client) *CreateConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create config params -func (o *CreateConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithConfig adds the config to the create config params -func (o *CreateConfigParams) WithConfig(config *rest_model.ConfigCreate) *CreateConfigParams { - o.SetConfig(config) - return o -} - -// SetConfig adds the config to the create config params -func (o *CreateConfigParams) SetConfig(config *rest_model.ConfigCreate) { - o.Config = config -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Config != nil { - if err := r.SetBodyParam(o.Config); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/create_config_responses.go b/rest_management_api_client/config/create_config_responses.go deleted file mode 100644 index 5cebcac58..000000000 --- a/rest_management_api_client/config/create_config_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateConfigReader is a Reader for the CreateConfig structure. -type CreateConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateConfigCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateConfigBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateConfigUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateConfigCreated creates a CreateConfigCreated with default headers values -func NewCreateConfigCreated() *CreateConfigCreated { - return &CreateConfigCreated{} -} - -/* CreateConfigCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateConfigCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateConfigCreated) Error() string { - return fmt.Sprintf("[POST /configs][%d] createConfigCreated %+v", 201, o.Payload) -} -func (o *CreateConfigCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateConfigCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateConfigBadRequest creates a CreateConfigBadRequest with default headers values -func NewCreateConfigBadRequest() *CreateConfigBadRequest { - return &CreateConfigBadRequest{} -} - -/* CreateConfigBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateConfigBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateConfigBadRequest) Error() string { - return fmt.Sprintf("[POST /configs][%d] createConfigBadRequest %+v", 400, o.Payload) -} -func (o *CreateConfigBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateConfigUnauthorized creates a CreateConfigUnauthorized with default headers values -func NewCreateConfigUnauthorized() *CreateConfigUnauthorized { - return &CreateConfigUnauthorized{} -} - -/* CreateConfigUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateConfigUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateConfigUnauthorized) Error() string { - return fmt.Sprintf("[POST /configs][%d] createConfigUnauthorized %+v", 401, o.Payload) -} -func (o *CreateConfigUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/create_config_type_parameters.go b/rest_management_api_client/config/create_config_type_parameters.go deleted file mode 100644 index 1bd2ccfb8..000000000 --- a/rest_management_api_client/config/create_config_type_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateConfigTypeParams creates a new CreateConfigTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateConfigTypeParams() *CreateConfigTypeParams { - return &CreateConfigTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateConfigTypeParamsWithTimeout creates a new CreateConfigTypeParams object -// with the ability to set a timeout on a request. -func NewCreateConfigTypeParamsWithTimeout(timeout time.Duration) *CreateConfigTypeParams { - return &CreateConfigTypeParams{ - timeout: timeout, - } -} - -// NewCreateConfigTypeParamsWithContext creates a new CreateConfigTypeParams object -// with the ability to set a context for a request. -func NewCreateConfigTypeParamsWithContext(ctx context.Context) *CreateConfigTypeParams { - return &CreateConfigTypeParams{ - Context: ctx, - } -} - -// NewCreateConfigTypeParamsWithHTTPClient creates a new CreateConfigTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateConfigTypeParamsWithHTTPClient(client *http.Client) *CreateConfigTypeParams { - return &CreateConfigTypeParams{ - HTTPClient: client, - } -} - -/* CreateConfigTypeParams contains all the parameters to send to the API endpoint - for the create config type operation. - - Typically these are written to a http.Request. -*/ -type CreateConfigTypeParams struct { - - /* ConfigType. - - A config-type to create - */ - ConfigType *rest_model.ConfigTypeCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateConfigTypeParams) WithDefaults() *CreateConfigTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateConfigTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create config type params -func (o *CreateConfigTypeParams) WithTimeout(timeout time.Duration) *CreateConfigTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create config type params -func (o *CreateConfigTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create config type params -func (o *CreateConfigTypeParams) WithContext(ctx context.Context) *CreateConfigTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create config type params -func (o *CreateConfigTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create config type params -func (o *CreateConfigTypeParams) WithHTTPClient(client *http.Client) *CreateConfigTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create config type params -func (o *CreateConfigTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithConfigType adds the configType to the create config type params -func (o *CreateConfigTypeParams) WithConfigType(configType *rest_model.ConfigTypeCreate) *CreateConfigTypeParams { - o.SetConfigType(configType) - return o -} - -// SetConfigType adds the configType to the create config type params -func (o *CreateConfigTypeParams) SetConfigType(configType *rest_model.ConfigTypeCreate) { - o.ConfigType = configType -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.ConfigType != nil { - if err := r.SetBodyParam(o.ConfigType); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/create_config_type_responses.go b/rest_management_api_client/config/create_config_type_responses.go deleted file mode 100644 index 2d385af43..000000000 --- a/rest_management_api_client/config/create_config_type_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateConfigTypeReader is a Reader for the CreateConfigType structure. -type CreateConfigTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateConfigTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateConfigTypeCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateConfigTypeBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateConfigTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateConfigTypeCreated creates a CreateConfigTypeCreated with default headers values -func NewCreateConfigTypeCreated() *CreateConfigTypeCreated { - return &CreateConfigTypeCreated{} -} - -/* CreateConfigTypeCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateConfigTypeCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateConfigTypeCreated) Error() string { - return fmt.Sprintf("[POST /config-types][%d] createConfigTypeCreated %+v", 201, o.Payload) -} -func (o *CreateConfigTypeCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateConfigTypeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateConfigTypeBadRequest creates a CreateConfigTypeBadRequest with default headers values -func NewCreateConfigTypeBadRequest() *CreateConfigTypeBadRequest { - return &CreateConfigTypeBadRequest{} -} - -/* CreateConfigTypeBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateConfigTypeBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateConfigTypeBadRequest) Error() string { - return fmt.Sprintf("[POST /config-types][%d] createConfigTypeBadRequest %+v", 400, o.Payload) -} -func (o *CreateConfigTypeBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateConfigTypeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateConfigTypeUnauthorized creates a CreateConfigTypeUnauthorized with default headers values -func NewCreateConfigTypeUnauthorized() *CreateConfigTypeUnauthorized { - return &CreateConfigTypeUnauthorized{} -} - -/* CreateConfigTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateConfigTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateConfigTypeUnauthorized) Error() string { - return fmt.Sprintf("[POST /config-types][%d] createConfigTypeUnauthorized %+v", 401, o.Payload) -} -func (o *CreateConfigTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateConfigTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/delete_config_parameters.go b/rest_management_api_client/config/delete_config_parameters.go deleted file mode 100644 index 4a6cf20a9..000000000 --- a/rest_management_api_client/config/delete_config_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteConfigParams creates a new DeleteConfigParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteConfigParams() *DeleteConfigParams { - return &DeleteConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteConfigParamsWithTimeout creates a new DeleteConfigParams object -// with the ability to set a timeout on a request. -func NewDeleteConfigParamsWithTimeout(timeout time.Duration) *DeleteConfigParams { - return &DeleteConfigParams{ - timeout: timeout, - } -} - -// NewDeleteConfigParamsWithContext creates a new DeleteConfigParams object -// with the ability to set a context for a request. -func NewDeleteConfigParamsWithContext(ctx context.Context) *DeleteConfigParams { - return &DeleteConfigParams{ - Context: ctx, - } -} - -// NewDeleteConfigParamsWithHTTPClient creates a new DeleteConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteConfigParamsWithHTTPClient(client *http.Client) *DeleteConfigParams { - return &DeleteConfigParams{ - HTTPClient: client, - } -} - -/* DeleteConfigParams contains all the parameters to send to the API endpoint - for the delete config operation. - - Typically these are written to a http.Request. -*/ -type DeleteConfigParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteConfigParams) WithDefaults() *DeleteConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete config params -func (o *DeleteConfigParams) WithTimeout(timeout time.Duration) *DeleteConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete config params -func (o *DeleteConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete config params -func (o *DeleteConfigParams) WithContext(ctx context.Context) *DeleteConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete config params -func (o *DeleteConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete config params -func (o *DeleteConfigParams) WithHTTPClient(client *http.Client) *DeleteConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete config params -func (o *DeleteConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete config params -func (o *DeleteConfigParams) WithID(id string) *DeleteConfigParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete config params -func (o *DeleteConfigParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/delete_config_responses.go b/rest_management_api_client/config/delete_config_responses.go deleted file mode 100644 index f21a90e0d..000000000 --- a/rest_management_api_client/config/delete_config_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteConfigReader is a Reader for the DeleteConfig structure. -type DeleteConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteConfigOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteConfigBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteConfigUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteConfigConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteConfigOK creates a DeleteConfigOK with default headers values -func NewDeleteConfigOK() *DeleteConfigOK { - return &DeleteConfigOK{} -} - -/* DeleteConfigOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteConfigOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteConfigOK) Error() string { - return fmt.Sprintf("[DELETE /configs/{id}][%d] deleteConfigOK %+v", 200, o.Payload) -} -func (o *DeleteConfigOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigBadRequest creates a DeleteConfigBadRequest with default headers values -func NewDeleteConfigBadRequest() *DeleteConfigBadRequest { - return &DeleteConfigBadRequest{} -} - -/* DeleteConfigBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteConfigBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteConfigBadRequest) Error() string { - return fmt.Sprintf("[DELETE /configs/{id}][%d] deleteConfigBadRequest %+v", 400, o.Payload) -} -func (o *DeleteConfigBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigUnauthorized creates a DeleteConfigUnauthorized with default headers values -func NewDeleteConfigUnauthorized() *DeleteConfigUnauthorized { - return &DeleteConfigUnauthorized{} -} - -/* DeleteConfigUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteConfigUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteConfigUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /configs/{id}][%d] deleteConfigUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteConfigUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigConflict creates a DeleteConfigConflict with default headers values -func NewDeleteConfigConflict() *DeleteConfigConflict { - return &DeleteConfigConflict{} -} - -/* DeleteConfigConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteConfigConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteConfigConflict) Error() string { - return fmt.Sprintf("[DELETE /configs/{id}][%d] deleteConfigConflict %+v", 409, o.Payload) -} -func (o *DeleteConfigConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteConfigConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/delete_config_type_parameters.go b/rest_management_api_client/config/delete_config_type_parameters.go deleted file mode 100644 index a8963b5de..000000000 --- a/rest_management_api_client/config/delete_config_type_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteConfigTypeParams creates a new DeleteConfigTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteConfigTypeParams() *DeleteConfigTypeParams { - return &DeleteConfigTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteConfigTypeParamsWithTimeout creates a new DeleteConfigTypeParams object -// with the ability to set a timeout on a request. -func NewDeleteConfigTypeParamsWithTimeout(timeout time.Duration) *DeleteConfigTypeParams { - return &DeleteConfigTypeParams{ - timeout: timeout, - } -} - -// NewDeleteConfigTypeParamsWithContext creates a new DeleteConfigTypeParams object -// with the ability to set a context for a request. -func NewDeleteConfigTypeParamsWithContext(ctx context.Context) *DeleteConfigTypeParams { - return &DeleteConfigTypeParams{ - Context: ctx, - } -} - -// NewDeleteConfigTypeParamsWithHTTPClient creates a new DeleteConfigTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteConfigTypeParamsWithHTTPClient(client *http.Client) *DeleteConfigTypeParams { - return &DeleteConfigTypeParams{ - HTTPClient: client, - } -} - -/* DeleteConfigTypeParams contains all the parameters to send to the API endpoint - for the delete config type operation. - - Typically these are written to a http.Request. -*/ -type DeleteConfigTypeParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteConfigTypeParams) WithDefaults() *DeleteConfigTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteConfigTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete config type params -func (o *DeleteConfigTypeParams) WithTimeout(timeout time.Duration) *DeleteConfigTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete config type params -func (o *DeleteConfigTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete config type params -func (o *DeleteConfigTypeParams) WithContext(ctx context.Context) *DeleteConfigTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete config type params -func (o *DeleteConfigTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete config type params -func (o *DeleteConfigTypeParams) WithHTTPClient(client *http.Client) *DeleteConfigTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete config type params -func (o *DeleteConfigTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete config type params -func (o *DeleteConfigTypeParams) WithID(id string) *DeleteConfigTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete config type params -func (o *DeleteConfigTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/delete_config_type_responses.go b/rest_management_api_client/config/delete_config_type_responses.go deleted file mode 100644 index c543aa4cb..000000000 --- a/rest_management_api_client/config/delete_config_type_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteConfigTypeReader is a Reader for the DeleteConfigType structure. -type DeleteConfigTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteConfigTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteConfigTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteConfigTypeBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteConfigTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteConfigTypeConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteConfigTypeOK creates a DeleteConfigTypeOK with default headers values -func NewDeleteConfigTypeOK() *DeleteConfigTypeOK { - return &DeleteConfigTypeOK{} -} - -/* DeleteConfigTypeOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteConfigTypeOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteConfigTypeOK) Error() string { - return fmt.Sprintf("[DELETE /config-types/{id}][%d] deleteConfigTypeOK %+v", 200, o.Payload) -} -func (o *DeleteConfigTypeOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteConfigTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigTypeBadRequest creates a DeleteConfigTypeBadRequest with default headers values -func NewDeleteConfigTypeBadRequest() *DeleteConfigTypeBadRequest { - return &DeleteConfigTypeBadRequest{} -} - -/* DeleteConfigTypeBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteConfigTypeBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteConfigTypeBadRequest) Error() string { - return fmt.Sprintf("[DELETE /config-types/{id}][%d] deleteConfigTypeBadRequest %+v", 400, o.Payload) -} -func (o *DeleteConfigTypeBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteConfigTypeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigTypeUnauthorized creates a DeleteConfigTypeUnauthorized with default headers values -func NewDeleteConfigTypeUnauthorized() *DeleteConfigTypeUnauthorized { - return &DeleteConfigTypeUnauthorized{} -} - -/* DeleteConfigTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteConfigTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteConfigTypeUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /config-types/{id}][%d] deleteConfigTypeUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteConfigTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteConfigTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteConfigTypeConflict creates a DeleteConfigTypeConflict with default headers values -func NewDeleteConfigTypeConflict() *DeleteConfigTypeConflict { - return &DeleteConfigTypeConflict{} -} - -/* DeleteConfigTypeConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteConfigTypeConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteConfigTypeConflict) Error() string { - return fmt.Sprintf("[DELETE /config-types/{id}][%d] deleteConfigTypeConflict %+v", 409, o.Payload) -} -func (o *DeleteConfigTypeConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteConfigTypeConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/detail_config_parameters.go b/rest_management_api_client/config/detail_config_parameters.go deleted file mode 100644 index e0e2369c3..000000000 --- a/rest_management_api_client/config/detail_config_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailConfigParams creates a new DetailConfigParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailConfigParams() *DetailConfigParams { - return &DetailConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailConfigParamsWithTimeout creates a new DetailConfigParams object -// with the ability to set a timeout on a request. -func NewDetailConfigParamsWithTimeout(timeout time.Duration) *DetailConfigParams { - return &DetailConfigParams{ - timeout: timeout, - } -} - -// NewDetailConfigParamsWithContext creates a new DetailConfigParams object -// with the ability to set a context for a request. -func NewDetailConfigParamsWithContext(ctx context.Context) *DetailConfigParams { - return &DetailConfigParams{ - Context: ctx, - } -} - -// NewDetailConfigParamsWithHTTPClient creates a new DetailConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailConfigParamsWithHTTPClient(client *http.Client) *DetailConfigParams { - return &DetailConfigParams{ - HTTPClient: client, - } -} - -/* DetailConfigParams contains all the parameters to send to the API endpoint - for the detail config operation. - - Typically these are written to a http.Request. -*/ -type DetailConfigParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailConfigParams) WithDefaults() *DetailConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail config params -func (o *DetailConfigParams) WithTimeout(timeout time.Duration) *DetailConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail config params -func (o *DetailConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail config params -func (o *DetailConfigParams) WithContext(ctx context.Context) *DetailConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail config params -func (o *DetailConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail config params -func (o *DetailConfigParams) WithHTTPClient(client *http.Client) *DetailConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail config params -func (o *DetailConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail config params -func (o *DetailConfigParams) WithID(id string) *DetailConfigParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail config params -func (o *DetailConfigParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/detail_config_responses.go b/rest_management_api_client/config/detail_config_responses.go deleted file mode 100644 index ce549d1c1..000000000 --- a/rest_management_api_client/config/detail_config_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailConfigReader is a Reader for the DetailConfig structure. -type DetailConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailConfigOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailConfigUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailConfigNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailConfigOK creates a DetailConfigOK with default headers values -func NewDetailConfigOK() *DetailConfigOK { - return &DetailConfigOK{} -} - -/* DetailConfigOK describes a response with status code 200, with default header values. - -A singular config resource -*/ -type DetailConfigOK struct { - Payload *rest_model.DetailConfigEnvelope -} - -func (o *DetailConfigOK) Error() string { - return fmt.Sprintf("[GET /configs/{id}][%d] detailConfigOK %+v", 200, o.Payload) -} -func (o *DetailConfigOK) GetPayload() *rest_model.DetailConfigEnvelope { - return o.Payload -} - -func (o *DetailConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailConfigEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailConfigUnauthorized creates a DetailConfigUnauthorized with default headers values -func NewDetailConfigUnauthorized() *DetailConfigUnauthorized { - return &DetailConfigUnauthorized{} -} - -/* DetailConfigUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailConfigUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailConfigUnauthorized) Error() string { - return fmt.Sprintf("[GET /configs/{id}][%d] detailConfigUnauthorized %+v", 401, o.Payload) -} -func (o *DetailConfigUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailConfigNotFound creates a DetailConfigNotFound with default headers values -func NewDetailConfigNotFound() *DetailConfigNotFound { - return &DetailConfigNotFound{} -} - -/* DetailConfigNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailConfigNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailConfigNotFound) Error() string { - return fmt.Sprintf("[GET /configs/{id}][%d] detailConfigNotFound %+v", 404, o.Payload) -} -func (o *DetailConfigNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/detail_config_type_parameters.go b/rest_management_api_client/config/detail_config_type_parameters.go deleted file mode 100644 index b2950fea7..000000000 --- a/rest_management_api_client/config/detail_config_type_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailConfigTypeParams creates a new DetailConfigTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailConfigTypeParams() *DetailConfigTypeParams { - return &DetailConfigTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailConfigTypeParamsWithTimeout creates a new DetailConfigTypeParams object -// with the ability to set a timeout on a request. -func NewDetailConfigTypeParamsWithTimeout(timeout time.Duration) *DetailConfigTypeParams { - return &DetailConfigTypeParams{ - timeout: timeout, - } -} - -// NewDetailConfigTypeParamsWithContext creates a new DetailConfigTypeParams object -// with the ability to set a context for a request. -func NewDetailConfigTypeParamsWithContext(ctx context.Context) *DetailConfigTypeParams { - return &DetailConfigTypeParams{ - Context: ctx, - } -} - -// NewDetailConfigTypeParamsWithHTTPClient creates a new DetailConfigTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailConfigTypeParamsWithHTTPClient(client *http.Client) *DetailConfigTypeParams { - return &DetailConfigTypeParams{ - HTTPClient: client, - } -} - -/* DetailConfigTypeParams contains all the parameters to send to the API endpoint - for the detail config type operation. - - Typically these are written to a http.Request. -*/ -type DetailConfigTypeParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailConfigTypeParams) WithDefaults() *DetailConfigTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailConfigTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail config type params -func (o *DetailConfigTypeParams) WithTimeout(timeout time.Duration) *DetailConfigTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail config type params -func (o *DetailConfigTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail config type params -func (o *DetailConfigTypeParams) WithContext(ctx context.Context) *DetailConfigTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail config type params -func (o *DetailConfigTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail config type params -func (o *DetailConfigTypeParams) WithHTTPClient(client *http.Client) *DetailConfigTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail config type params -func (o *DetailConfigTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail config type params -func (o *DetailConfigTypeParams) WithID(id string) *DetailConfigTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail config type params -func (o *DetailConfigTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/detail_config_type_responses.go b/rest_management_api_client/config/detail_config_type_responses.go deleted file mode 100644 index 76ef6f21c..000000000 --- a/rest_management_api_client/config/detail_config_type_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailConfigTypeReader is a Reader for the DetailConfigType structure. -type DetailConfigTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailConfigTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailConfigTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailConfigTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailConfigTypeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailConfigTypeOK creates a DetailConfigTypeOK with default headers values -func NewDetailConfigTypeOK() *DetailConfigTypeOK { - return &DetailConfigTypeOK{} -} - -/* DetailConfigTypeOK describes a response with status code 200, with default header values. - -A singular config-type resource -*/ -type DetailConfigTypeOK struct { - Payload *rest_model.DetailConfigTypeEnvelope -} - -func (o *DetailConfigTypeOK) Error() string { - return fmt.Sprintf("[GET /config-types/{id}][%d] detailConfigTypeOK %+v", 200, o.Payload) -} -func (o *DetailConfigTypeOK) GetPayload() *rest_model.DetailConfigTypeEnvelope { - return o.Payload -} - -func (o *DetailConfigTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailConfigTypeEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailConfigTypeUnauthorized creates a DetailConfigTypeUnauthorized with default headers values -func NewDetailConfigTypeUnauthorized() *DetailConfigTypeUnauthorized { - return &DetailConfigTypeUnauthorized{} -} - -/* DetailConfigTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailConfigTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailConfigTypeUnauthorized) Error() string { - return fmt.Sprintf("[GET /config-types/{id}][%d] detailConfigTypeUnauthorized %+v", 401, o.Payload) -} -func (o *DetailConfigTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailConfigTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailConfigTypeNotFound creates a DetailConfigTypeNotFound with default headers values -func NewDetailConfigTypeNotFound() *DetailConfigTypeNotFound { - return &DetailConfigTypeNotFound{} -} - -/* DetailConfigTypeNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailConfigTypeNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailConfigTypeNotFound) Error() string { - return fmt.Sprintf("[GET /config-types/{id}][%d] detailConfigTypeNotFound %+v", 404, o.Payload) -} -func (o *DetailConfigTypeNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailConfigTypeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/list_config_types_parameters.go b/rest_management_api_client/config/list_config_types_parameters.go deleted file mode 100644 index 329214ee4..000000000 --- a/rest_management_api_client/config/list_config_types_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListConfigTypesParams creates a new ListConfigTypesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListConfigTypesParams() *ListConfigTypesParams { - return &ListConfigTypesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListConfigTypesParamsWithTimeout creates a new ListConfigTypesParams object -// with the ability to set a timeout on a request. -func NewListConfigTypesParamsWithTimeout(timeout time.Duration) *ListConfigTypesParams { - return &ListConfigTypesParams{ - timeout: timeout, - } -} - -// NewListConfigTypesParamsWithContext creates a new ListConfigTypesParams object -// with the ability to set a context for a request. -func NewListConfigTypesParamsWithContext(ctx context.Context) *ListConfigTypesParams { - return &ListConfigTypesParams{ - Context: ctx, - } -} - -// NewListConfigTypesParamsWithHTTPClient creates a new ListConfigTypesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListConfigTypesParamsWithHTTPClient(client *http.Client) *ListConfigTypesParams { - return &ListConfigTypesParams{ - HTTPClient: client, - } -} - -/* ListConfigTypesParams contains all the parameters to send to the API endpoint - for the list config types operation. - - Typically these are written to a http.Request. -*/ -type ListConfigTypesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list config types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListConfigTypesParams) WithDefaults() *ListConfigTypesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list config types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListConfigTypesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list config types params -func (o *ListConfigTypesParams) WithTimeout(timeout time.Duration) *ListConfigTypesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list config types params -func (o *ListConfigTypesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list config types params -func (o *ListConfigTypesParams) WithContext(ctx context.Context) *ListConfigTypesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list config types params -func (o *ListConfigTypesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list config types params -func (o *ListConfigTypesParams) WithHTTPClient(client *http.Client) *ListConfigTypesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list config types params -func (o *ListConfigTypesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list config types params -func (o *ListConfigTypesParams) WithFilter(filter *string) *ListConfigTypesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list config types params -func (o *ListConfigTypesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list config types params -func (o *ListConfigTypesParams) WithLimit(limit *int64) *ListConfigTypesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list config types params -func (o *ListConfigTypesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list config types params -func (o *ListConfigTypesParams) WithOffset(offset *int64) *ListConfigTypesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list config types params -func (o *ListConfigTypesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListConfigTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/list_config_types_responses.go b/rest_management_api_client/config/list_config_types_responses.go deleted file mode 100644 index 9eaf4e30d..000000000 --- a/rest_management_api_client/config/list_config_types_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListConfigTypesReader is a Reader for the ListConfigTypes structure. -type ListConfigTypesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListConfigTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListConfigTypesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListConfigTypesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListConfigTypesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListConfigTypesOK creates a ListConfigTypesOK with default headers values -func NewListConfigTypesOK() *ListConfigTypesOK { - return &ListConfigTypesOK{} -} - -/* ListConfigTypesOK describes a response with status code 200, with default header values. - -A list of config-types -*/ -type ListConfigTypesOK struct { - Payload *rest_model.ListConfigTypesEnvelope -} - -func (o *ListConfigTypesOK) Error() string { - return fmt.Sprintf("[GET /config-types][%d] listConfigTypesOK %+v", 200, o.Payload) -} -func (o *ListConfigTypesOK) GetPayload() *rest_model.ListConfigTypesEnvelope { - return o.Payload -} - -func (o *ListConfigTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListConfigTypesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListConfigTypesBadRequest creates a ListConfigTypesBadRequest with default headers values -func NewListConfigTypesBadRequest() *ListConfigTypesBadRequest { - return &ListConfigTypesBadRequest{} -} - -/* ListConfigTypesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListConfigTypesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListConfigTypesBadRequest) Error() string { - return fmt.Sprintf("[GET /config-types][%d] listConfigTypesBadRequest %+v", 400, o.Payload) -} -func (o *ListConfigTypesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListConfigTypesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListConfigTypesUnauthorized creates a ListConfigTypesUnauthorized with default headers values -func NewListConfigTypesUnauthorized() *ListConfigTypesUnauthorized { - return &ListConfigTypesUnauthorized{} -} - -/* ListConfigTypesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListConfigTypesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListConfigTypesUnauthorized) Error() string { - return fmt.Sprintf("[GET /config-types][%d] listConfigTypesUnauthorized %+v", 401, o.Payload) -} -func (o *ListConfigTypesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListConfigTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/list_configs_for_config_type_parameters.go b/rest_management_api_client/config/list_configs_for_config_type_parameters.go deleted file mode 100644 index ac0a10344..000000000 --- a/rest_management_api_client/config/list_configs_for_config_type_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListConfigsForConfigTypeParams creates a new ListConfigsForConfigTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListConfigsForConfigTypeParams() *ListConfigsForConfigTypeParams { - return &ListConfigsForConfigTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListConfigsForConfigTypeParamsWithTimeout creates a new ListConfigsForConfigTypeParams object -// with the ability to set a timeout on a request. -func NewListConfigsForConfigTypeParamsWithTimeout(timeout time.Duration) *ListConfigsForConfigTypeParams { - return &ListConfigsForConfigTypeParams{ - timeout: timeout, - } -} - -// NewListConfigsForConfigTypeParamsWithContext creates a new ListConfigsForConfigTypeParams object -// with the ability to set a context for a request. -func NewListConfigsForConfigTypeParamsWithContext(ctx context.Context) *ListConfigsForConfigTypeParams { - return &ListConfigsForConfigTypeParams{ - Context: ctx, - } -} - -// NewListConfigsForConfigTypeParamsWithHTTPClient creates a new ListConfigsForConfigTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewListConfigsForConfigTypeParamsWithHTTPClient(client *http.Client) *ListConfigsForConfigTypeParams { - return &ListConfigsForConfigTypeParams{ - HTTPClient: client, - } -} - -/* ListConfigsForConfigTypeParams contains all the parameters to send to the API endpoint - for the list configs for config type operation. - - Typically these are written to a http.Request. -*/ -type ListConfigsForConfigTypeParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list configs for config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListConfigsForConfigTypeParams) WithDefaults() *ListConfigsForConfigTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list configs for config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListConfigsForConfigTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) WithTimeout(timeout time.Duration) *ListConfigsForConfigTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) WithContext(ctx context.Context) *ListConfigsForConfigTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) WithHTTPClient(client *http.Client) *ListConfigsForConfigTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) WithID(id string) *ListConfigsForConfigTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list configs for config type params -func (o *ListConfigsForConfigTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListConfigsForConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/list_configs_for_config_type_responses.go b/rest_management_api_client/config/list_configs_for_config_type_responses.go deleted file mode 100644 index a8346d7a7..000000000 --- a/rest_management_api_client/config/list_configs_for_config_type_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListConfigsForConfigTypeReader is a Reader for the ListConfigsForConfigType structure. -type ListConfigsForConfigTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListConfigsForConfigTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListConfigsForConfigTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListConfigsForConfigTypeOK creates a ListConfigsForConfigTypeOK with default headers values -func NewListConfigsForConfigTypeOK() *ListConfigsForConfigTypeOK { - return &ListConfigsForConfigTypeOK{} -} - -/* ListConfigsForConfigTypeOK describes a response with status code 200, with default header values. - -A list of configs -*/ -type ListConfigsForConfigTypeOK struct { - Payload *rest_model.ListConfigsEnvelope -} - -func (o *ListConfigsForConfigTypeOK) Error() string { - return fmt.Sprintf("[GET /config-types/{id}/configs][%d] listConfigsForConfigTypeOK %+v", 200, o.Payload) -} -func (o *ListConfigsForConfigTypeOK) GetPayload() *rest_model.ListConfigsEnvelope { - return o.Payload -} - -func (o *ListConfigsForConfigTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListConfigsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/list_configs_parameters.go b/rest_management_api_client/config/list_configs_parameters.go deleted file mode 100644 index 779d91088..000000000 --- a/rest_management_api_client/config/list_configs_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListConfigsParams creates a new ListConfigsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListConfigsParams() *ListConfigsParams { - return &ListConfigsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListConfigsParamsWithTimeout creates a new ListConfigsParams object -// with the ability to set a timeout on a request. -func NewListConfigsParamsWithTimeout(timeout time.Duration) *ListConfigsParams { - return &ListConfigsParams{ - timeout: timeout, - } -} - -// NewListConfigsParamsWithContext creates a new ListConfigsParams object -// with the ability to set a context for a request. -func NewListConfigsParamsWithContext(ctx context.Context) *ListConfigsParams { - return &ListConfigsParams{ - Context: ctx, - } -} - -// NewListConfigsParamsWithHTTPClient creates a new ListConfigsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListConfigsParamsWithHTTPClient(client *http.Client) *ListConfigsParams { - return &ListConfigsParams{ - HTTPClient: client, - } -} - -/* ListConfigsParams contains all the parameters to send to the API endpoint - for the list configs operation. - - Typically these are written to a http.Request. -*/ -type ListConfigsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListConfigsParams) WithDefaults() *ListConfigsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListConfigsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list configs params -func (o *ListConfigsParams) WithTimeout(timeout time.Duration) *ListConfigsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list configs params -func (o *ListConfigsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list configs params -func (o *ListConfigsParams) WithContext(ctx context.Context) *ListConfigsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list configs params -func (o *ListConfigsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list configs params -func (o *ListConfigsParams) WithHTTPClient(client *http.Client) *ListConfigsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list configs params -func (o *ListConfigsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list configs params -func (o *ListConfigsParams) WithFilter(filter *string) *ListConfigsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list configs params -func (o *ListConfigsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list configs params -func (o *ListConfigsParams) WithLimit(limit *int64) *ListConfigsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list configs params -func (o *ListConfigsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list configs params -func (o *ListConfigsParams) WithOffset(offset *int64) *ListConfigsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list configs params -func (o *ListConfigsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/list_configs_responses.go b/rest_management_api_client/config/list_configs_responses.go deleted file mode 100644 index aed1d032f..000000000 --- a/rest_management_api_client/config/list_configs_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListConfigsReader is a Reader for the ListConfigs structure. -type ListConfigsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListConfigsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListConfigsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListConfigsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListConfigsOK creates a ListConfigsOK with default headers values -func NewListConfigsOK() *ListConfigsOK { - return &ListConfigsOK{} -} - -/* ListConfigsOK describes a response with status code 200, with default header values. - -A list of configs -*/ -type ListConfigsOK struct { - Payload *rest_model.ListConfigsEnvelope -} - -func (o *ListConfigsOK) Error() string { - return fmt.Sprintf("[GET /configs][%d] listConfigsOK %+v", 200, o.Payload) -} -func (o *ListConfigsOK) GetPayload() *rest_model.ListConfigsEnvelope { - return o.Payload -} - -func (o *ListConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListConfigsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListConfigsBadRequest creates a ListConfigsBadRequest with default headers values -func NewListConfigsBadRequest() *ListConfigsBadRequest { - return &ListConfigsBadRequest{} -} - -/* ListConfigsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListConfigsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListConfigsBadRequest) Error() string { - return fmt.Sprintf("[GET /configs][%d] listConfigsBadRequest %+v", 400, o.Payload) -} -func (o *ListConfigsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListConfigsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListConfigsUnauthorized creates a ListConfigsUnauthorized with default headers values -func NewListConfigsUnauthorized() *ListConfigsUnauthorized { - return &ListConfigsUnauthorized{} -} - -/* ListConfigsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListConfigsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListConfigsUnauthorized) Error() string { - return fmt.Sprintf("[GET /configs][%d] listConfigsUnauthorized %+v", 401, o.Payload) -} -func (o *ListConfigsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListConfigsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/patch_config_parameters.go b/rest_management_api_client/config/patch_config_parameters.go deleted file mode 100644 index 6c97202ec..000000000 --- a/rest_management_api_client/config/patch_config_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchConfigParams creates a new PatchConfigParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchConfigParams() *PatchConfigParams { - return &PatchConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchConfigParamsWithTimeout creates a new PatchConfigParams object -// with the ability to set a timeout on a request. -func NewPatchConfigParamsWithTimeout(timeout time.Duration) *PatchConfigParams { - return &PatchConfigParams{ - timeout: timeout, - } -} - -// NewPatchConfigParamsWithContext creates a new PatchConfigParams object -// with the ability to set a context for a request. -func NewPatchConfigParamsWithContext(ctx context.Context) *PatchConfigParams { - return &PatchConfigParams{ - Context: ctx, - } -} - -// NewPatchConfigParamsWithHTTPClient creates a new PatchConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchConfigParamsWithHTTPClient(client *http.Client) *PatchConfigParams { - return &PatchConfigParams{ - HTTPClient: client, - } -} - -/* PatchConfigParams contains all the parameters to send to the API endpoint - for the patch config operation. - - Typically these are written to a http.Request. -*/ -type PatchConfigParams struct { - - /* Config. - - A config patch object - */ - Config *rest_model.ConfigPatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchConfigParams) WithDefaults() *PatchConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch config params -func (o *PatchConfigParams) WithTimeout(timeout time.Duration) *PatchConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch config params -func (o *PatchConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch config params -func (o *PatchConfigParams) WithContext(ctx context.Context) *PatchConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch config params -func (o *PatchConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch config params -func (o *PatchConfigParams) WithHTTPClient(client *http.Client) *PatchConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch config params -func (o *PatchConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithConfig adds the config to the patch config params -func (o *PatchConfigParams) WithConfig(config *rest_model.ConfigPatch) *PatchConfigParams { - o.SetConfig(config) - return o -} - -// SetConfig adds the config to the patch config params -func (o *PatchConfigParams) SetConfig(config *rest_model.ConfigPatch) { - o.Config = config -} - -// WithID adds the id to the patch config params -func (o *PatchConfigParams) WithID(id string) *PatchConfigParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch config params -func (o *PatchConfigParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Config != nil { - if err := r.SetBodyParam(o.Config); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/patch_config_responses.go b/rest_management_api_client/config/patch_config_responses.go deleted file mode 100644 index f250e4016..000000000 --- a/rest_management_api_client/config/patch_config_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchConfigReader is a Reader for the PatchConfig structure. -type PatchConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchConfigOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchConfigBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchConfigUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchConfigNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchConfigOK creates a PatchConfigOK with default headers values -func NewPatchConfigOK() *PatchConfigOK { - return &PatchConfigOK{} -} - -/* PatchConfigOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchConfigOK struct { - Payload *rest_model.Empty -} - -func (o *PatchConfigOK) Error() string { - return fmt.Sprintf("[PATCH /configs/{id}][%d] patchConfigOK %+v", 200, o.Payload) -} -func (o *PatchConfigOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchConfigBadRequest creates a PatchConfigBadRequest with default headers values -func NewPatchConfigBadRequest() *PatchConfigBadRequest { - return &PatchConfigBadRequest{} -} - -/* PatchConfigBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchConfigBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchConfigBadRequest) Error() string { - return fmt.Sprintf("[PATCH /configs/{id}][%d] patchConfigBadRequest %+v", 400, o.Payload) -} -func (o *PatchConfigBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchConfigUnauthorized creates a PatchConfigUnauthorized with default headers values -func NewPatchConfigUnauthorized() *PatchConfigUnauthorized { - return &PatchConfigUnauthorized{} -} - -/* PatchConfigUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchConfigUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchConfigUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /configs/{id}][%d] patchConfigUnauthorized %+v", 401, o.Payload) -} -func (o *PatchConfigUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchConfigNotFound creates a PatchConfigNotFound with default headers values -func NewPatchConfigNotFound() *PatchConfigNotFound { - return &PatchConfigNotFound{} -} - -/* PatchConfigNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchConfigNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchConfigNotFound) Error() string { - return fmt.Sprintf("[PATCH /configs/{id}][%d] patchConfigNotFound %+v", 404, o.Payload) -} -func (o *PatchConfigNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/patch_config_type_parameters.go b/rest_management_api_client/config/patch_config_type_parameters.go deleted file mode 100644 index 70195bdd5..000000000 --- a/rest_management_api_client/config/patch_config_type_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchConfigTypeParams creates a new PatchConfigTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchConfigTypeParams() *PatchConfigTypeParams { - return &PatchConfigTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchConfigTypeParamsWithTimeout creates a new PatchConfigTypeParams object -// with the ability to set a timeout on a request. -func NewPatchConfigTypeParamsWithTimeout(timeout time.Duration) *PatchConfigTypeParams { - return &PatchConfigTypeParams{ - timeout: timeout, - } -} - -// NewPatchConfigTypeParamsWithContext creates a new PatchConfigTypeParams object -// with the ability to set a context for a request. -func NewPatchConfigTypeParamsWithContext(ctx context.Context) *PatchConfigTypeParams { - return &PatchConfigTypeParams{ - Context: ctx, - } -} - -// NewPatchConfigTypeParamsWithHTTPClient creates a new PatchConfigTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchConfigTypeParamsWithHTTPClient(client *http.Client) *PatchConfigTypeParams { - return &PatchConfigTypeParams{ - HTTPClient: client, - } -} - -/* PatchConfigTypeParams contains all the parameters to send to the API endpoint - for the patch config type operation. - - Typically these are written to a http.Request. -*/ -type PatchConfigTypeParams struct { - - /* ConfigType. - - A config-type patch object - */ - ConfigType *rest_model.ConfigTypePatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchConfigTypeParams) WithDefaults() *PatchConfigTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchConfigTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch config type params -func (o *PatchConfigTypeParams) WithTimeout(timeout time.Duration) *PatchConfigTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch config type params -func (o *PatchConfigTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch config type params -func (o *PatchConfigTypeParams) WithContext(ctx context.Context) *PatchConfigTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch config type params -func (o *PatchConfigTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch config type params -func (o *PatchConfigTypeParams) WithHTTPClient(client *http.Client) *PatchConfigTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch config type params -func (o *PatchConfigTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithConfigType adds the configType to the patch config type params -func (o *PatchConfigTypeParams) WithConfigType(configType *rest_model.ConfigTypePatch) *PatchConfigTypeParams { - o.SetConfigType(configType) - return o -} - -// SetConfigType adds the configType to the patch config type params -func (o *PatchConfigTypeParams) SetConfigType(configType *rest_model.ConfigTypePatch) { - o.ConfigType = configType -} - -// WithID adds the id to the patch config type params -func (o *PatchConfigTypeParams) WithID(id string) *PatchConfigTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch config type params -func (o *PatchConfigTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.ConfigType != nil { - if err := r.SetBodyParam(o.ConfigType); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/patch_config_type_responses.go b/rest_management_api_client/config/patch_config_type_responses.go deleted file mode 100644 index b076810fc..000000000 --- a/rest_management_api_client/config/patch_config_type_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchConfigTypeReader is a Reader for the PatchConfigType structure. -type PatchConfigTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchConfigTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchConfigTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchConfigTypeBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchConfigTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchConfigTypeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchConfigTypeOK creates a PatchConfigTypeOK with default headers values -func NewPatchConfigTypeOK() *PatchConfigTypeOK { - return &PatchConfigTypeOK{} -} - -/* PatchConfigTypeOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchConfigTypeOK struct { - Payload *rest_model.Empty -} - -func (o *PatchConfigTypeOK) Error() string { - return fmt.Sprintf("[PATCH /config-types/{id}][%d] patchConfigTypeOK %+v", 200, o.Payload) -} -func (o *PatchConfigTypeOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchConfigTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchConfigTypeBadRequest creates a PatchConfigTypeBadRequest with default headers values -func NewPatchConfigTypeBadRequest() *PatchConfigTypeBadRequest { - return &PatchConfigTypeBadRequest{} -} - -/* PatchConfigTypeBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchConfigTypeBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchConfigTypeBadRequest) Error() string { - return fmt.Sprintf("[PATCH /config-types/{id}][%d] patchConfigTypeBadRequest %+v", 400, o.Payload) -} -func (o *PatchConfigTypeBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchConfigTypeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchConfigTypeUnauthorized creates a PatchConfigTypeUnauthorized with default headers values -func NewPatchConfigTypeUnauthorized() *PatchConfigTypeUnauthorized { - return &PatchConfigTypeUnauthorized{} -} - -/* PatchConfigTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchConfigTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchConfigTypeUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /config-types/{id}][%d] patchConfigTypeUnauthorized %+v", 401, o.Payload) -} -func (o *PatchConfigTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchConfigTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchConfigTypeNotFound creates a PatchConfigTypeNotFound with default headers values -func NewPatchConfigTypeNotFound() *PatchConfigTypeNotFound { - return &PatchConfigTypeNotFound{} -} - -/* PatchConfigTypeNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchConfigTypeNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchConfigTypeNotFound) Error() string { - return fmt.Sprintf("[PATCH /config-types/{id}][%d] patchConfigTypeNotFound %+v", 404, o.Payload) -} -func (o *PatchConfigTypeNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchConfigTypeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/update_config_parameters.go b/rest_management_api_client/config/update_config_parameters.go deleted file mode 100644 index abbb1607b..000000000 --- a/rest_management_api_client/config/update_config_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateConfigParams creates a new UpdateConfigParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateConfigParams() *UpdateConfigParams { - return &UpdateConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateConfigParamsWithTimeout creates a new UpdateConfigParams object -// with the ability to set a timeout on a request. -func NewUpdateConfigParamsWithTimeout(timeout time.Duration) *UpdateConfigParams { - return &UpdateConfigParams{ - timeout: timeout, - } -} - -// NewUpdateConfigParamsWithContext creates a new UpdateConfigParams object -// with the ability to set a context for a request. -func NewUpdateConfigParamsWithContext(ctx context.Context) *UpdateConfigParams { - return &UpdateConfigParams{ - Context: ctx, - } -} - -// NewUpdateConfigParamsWithHTTPClient creates a new UpdateConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateConfigParamsWithHTTPClient(client *http.Client) *UpdateConfigParams { - return &UpdateConfigParams{ - HTTPClient: client, - } -} - -/* UpdateConfigParams contains all the parameters to send to the API endpoint - for the update config operation. - - Typically these are written to a http.Request. -*/ -type UpdateConfigParams struct { - - /* Config. - - A config update object - */ - Config *rest_model.ConfigUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateConfigParams) WithDefaults() *UpdateConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update config params -func (o *UpdateConfigParams) WithTimeout(timeout time.Duration) *UpdateConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update config params -func (o *UpdateConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update config params -func (o *UpdateConfigParams) WithContext(ctx context.Context) *UpdateConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update config params -func (o *UpdateConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update config params -func (o *UpdateConfigParams) WithHTTPClient(client *http.Client) *UpdateConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update config params -func (o *UpdateConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithConfig adds the config to the update config params -func (o *UpdateConfigParams) WithConfig(config *rest_model.ConfigUpdate) *UpdateConfigParams { - o.SetConfig(config) - return o -} - -// SetConfig adds the config to the update config params -func (o *UpdateConfigParams) SetConfig(config *rest_model.ConfigUpdate) { - o.Config = config -} - -// WithID adds the id to the update config params -func (o *UpdateConfigParams) WithID(id string) *UpdateConfigParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update config params -func (o *UpdateConfigParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Config != nil { - if err := r.SetBodyParam(o.Config); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/update_config_responses.go b/rest_management_api_client/config/update_config_responses.go deleted file mode 100644 index aef035072..000000000 --- a/rest_management_api_client/config/update_config_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateConfigReader is a Reader for the UpdateConfig structure. -type UpdateConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateConfigOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateConfigBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateConfigUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateConfigNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateConfigOK creates a UpdateConfigOK with default headers values -func NewUpdateConfigOK() *UpdateConfigOK { - return &UpdateConfigOK{} -} - -/* UpdateConfigOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateConfigOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateConfigOK) Error() string { - return fmt.Sprintf("[PUT /configs/{id}][%d] updateConfigOK %+v", 200, o.Payload) -} -func (o *UpdateConfigOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigBadRequest creates a UpdateConfigBadRequest with default headers values -func NewUpdateConfigBadRequest() *UpdateConfigBadRequest { - return &UpdateConfigBadRequest{} -} - -/* UpdateConfigBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateConfigBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateConfigBadRequest) Error() string { - return fmt.Sprintf("[PUT /configs/{id}][%d] updateConfigBadRequest %+v", 400, o.Payload) -} -func (o *UpdateConfigBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigUnauthorized creates a UpdateConfigUnauthorized with default headers values -func NewUpdateConfigUnauthorized() *UpdateConfigUnauthorized { - return &UpdateConfigUnauthorized{} -} - -/* UpdateConfigUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateConfigUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateConfigUnauthorized) Error() string { - return fmt.Sprintf("[PUT /configs/{id}][%d] updateConfigUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateConfigUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigNotFound creates a UpdateConfigNotFound with default headers values -func NewUpdateConfigNotFound() *UpdateConfigNotFound { - return &UpdateConfigNotFound{} -} - -/* UpdateConfigNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateConfigNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateConfigNotFound) Error() string { - return fmt.Sprintf("[PUT /configs/{id}][%d] updateConfigNotFound %+v", 404, o.Payload) -} -func (o *UpdateConfigNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/config/update_config_type_parameters.go b/rest_management_api_client/config/update_config_type_parameters.go deleted file mode 100644 index 4db208874..000000000 --- a/rest_management_api_client/config/update_config_type_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateConfigTypeParams creates a new UpdateConfigTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateConfigTypeParams() *UpdateConfigTypeParams { - return &UpdateConfigTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateConfigTypeParamsWithTimeout creates a new UpdateConfigTypeParams object -// with the ability to set a timeout on a request. -func NewUpdateConfigTypeParamsWithTimeout(timeout time.Duration) *UpdateConfigTypeParams { - return &UpdateConfigTypeParams{ - timeout: timeout, - } -} - -// NewUpdateConfigTypeParamsWithContext creates a new UpdateConfigTypeParams object -// with the ability to set a context for a request. -func NewUpdateConfigTypeParamsWithContext(ctx context.Context) *UpdateConfigTypeParams { - return &UpdateConfigTypeParams{ - Context: ctx, - } -} - -// NewUpdateConfigTypeParamsWithHTTPClient creates a new UpdateConfigTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateConfigTypeParamsWithHTTPClient(client *http.Client) *UpdateConfigTypeParams { - return &UpdateConfigTypeParams{ - HTTPClient: client, - } -} - -/* UpdateConfigTypeParams contains all the parameters to send to the API endpoint - for the update config type operation. - - Typically these are written to a http.Request. -*/ -type UpdateConfigTypeParams struct { - - /* ConfigType. - - A config-type update object - */ - ConfigType *rest_model.ConfigTypeUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateConfigTypeParams) WithDefaults() *UpdateConfigTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update config type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateConfigTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update config type params -func (o *UpdateConfigTypeParams) WithTimeout(timeout time.Duration) *UpdateConfigTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update config type params -func (o *UpdateConfigTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update config type params -func (o *UpdateConfigTypeParams) WithContext(ctx context.Context) *UpdateConfigTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update config type params -func (o *UpdateConfigTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update config type params -func (o *UpdateConfigTypeParams) WithHTTPClient(client *http.Client) *UpdateConfigTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update config type params -func (o *UpdateConfigTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithConfigType adds the configType to the update config type params -func (o *UpdateConfigTypeParams) WithConfigType(configType *rest_model.ConfigTypeUpdate) *UpdateConfigTypeParams { - o.SetConfigType(configType) - return o -} - -// SetConfigType adds the configType to the update config type params -func (o *UpdateConfigTypeParams) SetConfigType(configType *rest_model.ConfigTypeUpdate) { - o.ConfigType = configType -} - -// WithID adds the id to the update config type params -func (o *UpdateConfigTypeParams) WithID(id string) *UpdateConfigTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update config type params -func (o *UpdateConfigTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateConfigTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.ConfigType != nil { - if err := r.SetBodyParam(o.ConfigType); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/config/update_config_type_responses.go b/rest_management_api_client/config/update_config_type_responses.go deleted file mode 100644 index 1e3dfd162..000000000 --- a/rest_management_api_client/config/update_config_type_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateConfigTypeReader is a Reader for the UpdateConfigType structure. -type UpdateConfigTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateConfigTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateConfigTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateConfigTypeBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateConfigTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateConfigTypeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateConfigTypeOK creates a UpdateConfigTypeOK with default headers values -func NewUpdateConfigTypeOK() *UpdateConfigTypeOK { - return &UpdateConfigTypeOK{} -} - -/* UpdateConfigTypeOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateConfigTypeOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateConfigTypeOK) Error() string { - return fmt.Sprintf("[PUT /config-types/{id}][%d] updateConfigTypeOK %+v", 200, o.Payload) -} -func (o *UpdateConfigTypeOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateConfigTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigTypeBadRequest creates a UpdateConfigTypeBadRequest with default headers values -func NewUpdateConfigTypeBadRequest() *UpdateConfigTypeBadRequest { - return &UpdateConfigTypeBadRequest{} -} - -/* UpdateConfigTypeBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateConfigTypeBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateConfigTypeBadRequest) Error() string { - return fmt.Sprintf("[PUT /config-types/{id}][%d] updateConfigTypeBadRequest %+v", 400, o.Payload) -} -func (o *UpdateConfigTypeBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateConfigTypeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigTypeUnauthorized creates a UpdateConfigTypeUnauthorized with default headers values -func NewUpdateConfigTypeUnauthorized() *UpdateConfigTypeUnauthorized { - return &UpdateConfigTypeUnauthorized{} -} - -/* UpdateConfigTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateConfigTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateConfigTypeUnauthorized) Error() string { - return fmt.Sprintf("[PUT /config-types/{id}][%d] updateConfigTypeUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateConfigTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateConfigTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateConfigTypeNotFound creates a UpdateConfigTypeNotFound with default headers values -func NewUpdateConfigTypeNotFound() *UpdateConfigTypeNotFound { - return &UpdateConfigTypeNotFound{} -} - -/* UpdateConfigTypeNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateConfigTypeNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateConfigTypeNotFound) Error() string { - return fmt.Sprintf("[PUT /config-types/{id}][%d] updateConfigTypeNotFound %+v", 404, o.Payload) -} -func (o *UpdateConfigTypeNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateConfigTypeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/current_api_session_client.go b/rest_management_api_client/current_api_session/current_api_session_client.go deleted file mode 100644 index 5d0dcea0b..000000000 --- a/rest_management_api_client/current_api_session/current_api_session_client.go +++ /dev/null @@ -1,415 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new current api session API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for current api session API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionOK, error) - - DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentIdentityAuthenticatorOK, error) - - ExtendCurrentIdentityAuthenticator(params *ExtendCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendCurrentIdentityAuthenticatorOK, error) - - ExtendVerifyCurrentIdentityAuthenticator(params *ExtendVerifyCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendVerifyCurrentIdentityAuthenticatorOK, error) - - GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentAPISessionOK, error) - - ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentIdentityAuthenticatorsOK, error) - - PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCurrentIdentityAuthenticatorOK, error) - - UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCurrentIdentityAuthenticatorOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteCurrentAPISession logouts - - Terminates the current API session -*/ -func (a *Client) DeleteCurrentAPISession(params *DeleteCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCurrentAPISessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteCurrentAPISessionParams() - } - op := &runtime.ClientOperation{ - ID: "DeleteCurrentAPISession", - Method: "DELETE", - PathPattern: "/current-api-session", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteCurrentAPISessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteCurrentAPISessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for DeleteCurrentAPISession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailCurrentIdentityAuthenticator retrieves an authenticator for the current identity - - Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity. -*/ -func (a *Client) DetailCurrentIdentityAuthenticator(params *DetailCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "detailCurrentIdentityAuthenticator", - Method: "GET", - PathPattern: "/current-identity/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExtendCurrentIdentityAuthenticator allows the current identity to recieve a new certificate associated with a certificate based authenticator - - This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled. -Allows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation. -The response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint. -After verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active. -*/ -func (a *Client) ExtendCurrentIdentityAuthenticator(params *ExtendCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExtendCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "extendCurrentIdentityAuthenticator", - Method: "POST", - PathPattern: "/current-identity/authenticators/{id}/extend", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExtendCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExtendCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for extendCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ExtendVerifyCurrentIdentityAuthenticator allows the current identity to validate reciept of a new client certificate - - After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt. -After receipt, the new client certificate must be used for new authentication requests. -*/ -func (a *Client) ExtendVerifyCurrentIdentityAuthenticator(params *ExtendVerifyCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ExtendVerifyCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewExtendVerifyCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "extendVerifyCurrentIdentityAuthenticator", - Method: "POST", - PathPattern: "/current-identity/authenticators/{id}/extend-verify", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ExtendVerifyCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ExtendVerifyCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for extendVerifyCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCurrentAPISession returns the current API session - - Retrieves the API session that was used to issue the current request -*/ -func (a *Client) GetCurrentAPISession(params *GetCurrentAPISessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentAPISessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCurrentAPISessionParams() - } - op := &runtime.ClientOperation{ - ID: "getCurrentAPISession", - Method: "GET", - PathPattern: "/current-api-session", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCurrentAPISessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCurrentAPISessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCurrentAPISession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListCurrentIdentityAuthenticators lists authenticators for the current identity - - Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination. -*/ -func (a *Client) ListCurrentIdentityAuthenticators(params *ListCurrentIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListCurrentIdentityAuthenticatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListCurrentIdentityAuthenticatorsParams() - } - op := &runtime.ClientOperation{ - ID: "listCurrentIdentityAuthenticators", - Method: "GET", - PathPattern: "/current-identity/authenticators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListCurrentIdentityAuthenticatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListCurrentIdentityAuthenticatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listCurrentIdentityAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchCurrentIdentityAuthenticator updates the supplied fields on an authenticator of this identity - - Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API -session's identity. - -*/ -func (a *Client) PatchCurrentIdentityAuthenticator(params *PatchCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "patchCurrentIdentityAuthenticator", - Method: "PATCH", - PathPattern: "/current-identity/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateCurrentIdentityAuthenticator updates all fields on an authenticator of this identity - - Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's -identity. - -*/ -func (a *Client) UpdateCurrentIdentityAuthenticator(params *UpdateCurrentIdentityAuthenticatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateCurrentIdentityAuthenticatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateCurrentIdentityAuthenticatorParams() - } - op := &runtime.ClientOperation{ - ID: "updateCurrentIdentityAuthenticator", - Method: "PUT", - PathPattern: "/current-identity/authenticators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateCurrentIdentityAuthenticatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateCurrentIdentityAuthenticatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateCurrentIdentityAuthenticator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/current_api_session/delete_current_api_session_parameters.go b/rest_management_api_client/current_api_session/delete_current_api_session_parameters.go deleted file mode 100644 index eafb99cf7..000000000 --- a/rest_management_api_client/current_api_session/delete_current_api_session_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCurrentAPISessionParams creates a new DeleteCurrentAPISessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteCurrentAPISessionParams() *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteCurrentAPISessionParamsWithTimeout creates a new DeleteCurrentAPISessionParams object -// with the ability to set a timeout on a request. -func NewDeleteCurrentAPISessionParamsWithTimeout(timeout time.Duration) *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - timeout: timeout, - } -} - -// NewDeleteCurrentAPISessionParamsWithContext creates a new DeleteCurrentAPISessionParams object -// with the ability to set a context for a request. -func NewDeleteCurrentAPISessionParamsWithContext(ctx context.Context) *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - Context: ctx, - } -} - -// NewDeleteCurrentAPISessionParamsWithHTTPClient creates a new DeleteCurrentAPISessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteCurrentAPISessionParamsWithHTTPClient(client *http.Client) *DeleteCurrentAPISessionParams { - return &DeleteCurrentAPISessionParams{ - HTTPClient: client, - } -} - -/* DeleteCurrentAPISessionParams contains all the parameters to send to the API endpoint - for the delete current API session operation. - - Typically these are written to a http.Request. -*/ -type DeleteCurrentAPISessionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCurrentAPISessionParams) WithDefaults() *DeleteCurrentAPISessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteCurrentAPISessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete current API session params -func (o *DeleteCurrentAPISessionParams) WithTimeout(timeout time.Duration) *DeleteCurrentAPISessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete current API session params -func (o *DeleteCurrentAPISessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete current API session params -func (o *DeleteCurrentAPISessionParams) WithContext(ctx context.Context) *DeleteCurrentAPISessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete current API session params -func (o *DeleteCurrentAPISessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete current API session params -func (o *DeleteCurrentAPISessionParams) WithHTTPClient(client *http.Client) *DeleteCurrentAPISessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete current API session params -func (o *DeleteCurrentAPISessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteCurrentAPISessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/delete_current_api_session_responses.go b/rest_management_api_client/current_api_session/delete_current_api_session_responses.go deleted file mode 100644 index fe6773d1c..000000000 --- a/rest_management_api_client/current_api_session/delete_current_api_session_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCurrentAPISessionReader is a Reader for the DeleteCurrentAPISession structure. -type DeleteCurrentAPISessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteCurrentAPISessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteCurrentAPISessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteCurrentAPISessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteCurrentAPISessionOK creates a DeleteCurrentAPISessionOK with default headers values -func NewDeleteCurrentAPISessionOK() *DeleteCurrentAPISessionOK { - return &DeleteCurrentAPISessionOK{} -} - -/* DeleteCurrentAPISessionOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DeleteCurrentAPISessionOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteCurrentAPISessionOK) Error() string { - return fmt.Sprintf("[DELETE /current-api-session][%d] deleteCurrentApiSessionOK %+v", 200, o.Payload) -} -func (o *DeleteCurrentAPISessionOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteCurrentAPISessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteCurrentAPISessionUnauthorized creates a DeleteCurrentAPISessionUnauthorized with default headers values -func NewDeleteCurrentAPISessionUnauthorized() *DeleteCurrentAPISessionUnauthorized { - return &DeleteCurrentAPISessionUnauthorized{} -} - -/* DeleteCurrentAPISessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteCurrentAPISessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteCurrentAPISessionUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /current-api-session][%d] deleteCurrentApiSessionUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteCurrentAPISessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteCurrentAPISessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/detail_current_identity_authenticator_parameters.go b/rest_management_api_client/current_api_session/detail_current_identity_authenticator_parameters.go deleted file mode 100644 index 25eee1aae..000000000 --- a/rest_management_api_client/current_api_session/detail_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailCurrentIdentityAuthenticatorParams creates a new DetailCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailCurrentIdentityAuthenticatorParams() *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailCurrentIdentityAuthenticatorParamsWithTimeout creates a new DetailCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewDetailCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewDetailCurrentIdentityAuthenticatorParamsWithContext creates a new DetailCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewDetailCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewDetailCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new DetailCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *DetailCurrentIdentityAuthenticatorParams { - return &DetailCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* DetailCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the detail current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type DetailCurrentIdentityAuthenticatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCurrentIdentityAuthenticatorParams) WithDefaults() *DetailCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *DetailCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *DetailCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *DetailCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) WithID(id string) *DetailCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail current identity authenticator params -func (o *DetailCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/detail_current_identity_authenticator_responses.go b/rest_management_api_client/current_api_session/detail_current_identity_authenticator_responses.go deleted file mode 100644 index 707e09eef..000000000 --- a/rest_management_api_client/current_api_session/detail_current_identity_authenticator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailCurrentIdentityAuthenticatorReader is a Reader for the DetailCurrentIdentityAuthenticator structure. -type DetailCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailCurrentIdentityAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailCurrentIdentityAuthenticatorOK creates a DetailCurrentIdentityAuthenticatorOK with default headers values -func NewDetailCurrentIdentityAuthenticatorOK() *DetailCurrentIdentityAuthenticatorOK { - return &DetailCurrentIdentityAuthenticatorOK{} -} - -/* DetailCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -A singular authenticator resource -*/ -type DetailCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.DetailAuthenticatorEnvelope -} - -func (o *DetailCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators/{id}][%d] detailCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *DetailCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.DetailAuthenticatorEnvelope { - return o.Payload -} - -func (o *DetailCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailAuthenticatorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCurrentIdentityAuthenticatorUnauthorized creates a DetailCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewDetailCurrentIdentityAuthenticatorUnauthorized() *DetailCurrentIdentityAuthenticatorUnauthorized { - return &DetailCurrentIdentityAuthenticatorUnauthorized{} -} - -/* DetailCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators/{id}][%d] detailCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailCurrentIdentityAuthenticatorNotFound creates a DetailCurrentIdentityAuthenticatorNotFound with default headers values -func NewDetailCurrentIdentityAuthenticatorNotFound() *DetailCurrentIdentityAuthenticatorNotFound { - return &DetailCurrentIdentityAuthenticatorNotFound{} -} - -/* DetailCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailCurrentIdentityAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailCurrentIdentityAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators/{id}][%d] detailCurrentIdentityAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *DetailCurrentIdentityAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailCurrentIdentityAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/extend_current_identity_authenticator_parameters.go b/rest_management_api_client/current_api_session/extend_current_identity_authenticator_parameters.go deleted file mode 100644 index f10d59225..000000000 --- a/rest_management_api_client/current_api_session/extend_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendCurrentIdentityAuthenticatorParams creates a new ExtendCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExtendCurrentIdentityAuthenticatorParams() *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExtendCurrentIdentityAuthenticatorParamsWithTimeout creates a new ExtendCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewExtendCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewExtendCurrentIdentityAuthenticatorParamsWithContext creates a new ExtendCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewExtendCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewExtendCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new ExtendCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewExtendCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *ExtendCurrentIdentityAuthenticatorParams { - return &ExtendCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* ExtendCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the extend current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type ExtendCurrentIdentityAuthenticatorParams struct { - - // Extend. - Extend *rest_model.IdentityExtendEnrollmentRequest - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the extend current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendCurrentIdentityAuthenticatorParams) WithDefaults() *ExtendCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the extend current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *ExtendCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *ExtendCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *ExtendCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExtend adds the extend to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithExtend(extend *rest_model.IdentityExtendEnrollmentRequest) *ExtendCurrentIdentityAuthenticatorParams { - o.SetExtend(extend) - return o -} - -// SetExtend adds the extend to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetExtend(extend *rest_model.IdentityExtendEnrollmentRequest) { - o.Extend = extend -} - -// WithID adds the id to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) WithID(id string) *ExtendCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the extend current identity authenticator params -func (o *ExtendCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtendCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Extend != nil { - if err := r.SetBodyParam(o.Extend); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/extend_current_identity_authenticator_responses.go b/rest_management_api_client/current_api_session/extend_current_identity_authenticator_responses.go deleted file mode 100644 index af4120ce8..000000000 --- a/rest_management_api_client/current_api_session/extend_current_identity_authenticator_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ExtendCurrentIdentityAuthenticatorReader is a Reader for the ExtendCurrentIdentityAuthenticator structure. -type ExtendCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExtendCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExtendCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewExtendCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExtendCurrentIdentityAuthenticatorOK creates a ExtendCurrentIdentityAuthenticatorOK with default headers values -func NewExtendCurrentIdentityAuthenticatorOK() *ExtendCurrentIdentityAuthenticatorOK { - return &ExtendCurrentIdentityAuthenticatorOK{} -} - -/* ExtendCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -A response containg the identity's new certificate -*/ -type ExtendCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.IdentityExtendEnrollmentEnvelope -} - -func (o *ExtendCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend][%d] extendCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *ExtendCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.IdentityExtendEnrollmentEnvelope { - return o.Payload -} - -func (o *ExtendCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.IdentityExtendEnrollmentEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExtendCurrentIdentityAuthenticatorUnauthorized creates a ExtendCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendCurrentIdentityAuthenticatorUnauthorized() *ExtendCurrentIdentityAuthenticatorUnauthorized { - return &ExtendCurrentIdentityAuthenticatorUnauthorized{} -} - -/* ExtendCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ExtendCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend][%d] extendCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/extend_verify_current_identity_authenticator_parameters.go b/rest_management_api_client/current_api_session/extend_verify_current_identity_authenticator_parameters.go deleted file mode 100644 index 66d03fa38..000000000 --- a/rest_management_api_client/current_api_session/extend_verify_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendVerifyCurrentIdentityAuthenticatorParams creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewExtendVerifyCurrentIdentityAuthenticatorParams() *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorParamsWithTimeout creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewExtendVerifyCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorParamsWithContext creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewExtendVerifyCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewExtendVerifyCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *ExtendVerifyCurrentIdentityAuthenticatorParams { - return &ExtendVerifyCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* ExtendVerifyCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the extend verify current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type ExtendVerifyCurrentIdentityAuthenticatorParams struct { - - // Extend. - Extend *rest_model.IdentityExtendValidateEnrollmentRequest - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the extend verify current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithDefaults() *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the extend verify current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExtend adds the extend to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithExtend(extend *rest_model.IdentityExtendValidateEnrollmentRequest) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetExtend(extend) - return o -} - -// SetExtend adds the extend to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetExtend(extend *rest_model.IdentityExtendValidateEnrollmentRequest) { - o.Extend = extend -} - -// WithID adds the id to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WithID(id string) *ExtendVerifyCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the extend verify current identity authenticator params -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Extend != nil { - if err := r.SetBodyParam(o.Extend); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/extend_verify_current_identity_authenticator_responses.go b/rest_management_api_client/current_api_session/extend_verify_current_identity_authenticator_responses.go deleted file mode 100644 index fc5588800..000000000 --- a/rest_management_api_client/current_api_session/extend_verify_current_identity_authenticator_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ExtendVerifyCurrentIdentityAuthenticatorReader is a Reader for the ExtendVerifyCurrentIdentityAuthenticator structure. -type ExtendVerifyCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ExtendVerifyCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewExtendVerifyCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewExtendVerifyCurrentIdentityAuthenticatorOK creates a ExtendVerifyCurrentIdentityAuthenticatorOK with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorOK() *ExtendVerifyCurrentIdentityAuthenticatorOK { - return &ExtendVerifyCurrentIdentityAuthenticatorOK{} -} - -/* ExtendVerifyCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type ExtendVerifyCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend-verify][%d] extendVerifyCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized creates a ExtendVerifyCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized() *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized { - return &ExtendVerifyCurrentIdentityAuthenticatorUnauthorized{} -} - -/* ExtendVerifyCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ExtendVerifyCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/authenticators/{id}/extend-verify][%d] extendVerifyCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/get_current_api_session_parameters.go b/rest_management_api_client/current_api_session/get_current_api_session_parameters.go deleted file mode 100644 index caa755863..000000000 --- a/rest_management_api_client/current_api_session/get_current_api_session_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCurrentAPISessionParams creates a new GetCurrentAPISessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCurrentAPISessionParams() *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCurrentAPISessionParamsWithTimeout creates a new GetCurrentAPISessionParams object -// with the ability to set a timeout on a request. -func NewGetCurrentAPISessionParamsWithTimeout(timeout time.Duration) *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - timeout: timeout, - } -} - -// NewGetCurrentAPISessionParamsWithContext creates a new GetCurrentAPISessionParams object -// with the ability to set a context for a request. -func NewGetCurrentAPISessionParamsWithContext(ctx context.Context) *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - Context: ctx, - } -} - -// NewGetCurrentAPISessionParamsWithHTTPClient creates a new GetCurrentAPISessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCurrentAPISessionParamsWithHTTPClient(client *http.Client) *GetCurrentAPISessionParams { - return &GetCurrentAPISessionParams{ - HTTPClient: client, - } -} - -/* GetCurrentAPISessionParams contains all the parameters to send to the API endpoint - for the get current API session operation. - - Typically these are written to a http.Request. -*/ -type GetCurrentAPISessionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentAPISessionParams) WithDefaults() *GetCurrentAPISessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get current API session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentAPISessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get current API session params -func (o *GetCurrentAPISessionParams) WithTimeout(timeout time.Duration) *GetCurrentAPISessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get current API session params -func (o *GetCurrentAPISessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get current API session params -func (o *GetCurrentAPISessionParams) WithContext(ctx context.Context) *GetCurrentAPISessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get current API session params -func (o *GetCurrentAPISessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get current API session params -func (o *GetCurrentAPISessionParams) WithHTTPClient(client *http.Client) *GetCurrentAPISessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get current API session params -func (o *GetCurrentAPISessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCurrentAPISessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/get_current_api_session_responses.go b/rest_management_api_client/current_api_session/get_current_api_session_responses.go deleted file mode 100644 index fe10a356e..000000000 --- a/rest_management_api_client/current_api_session/get_current_api_session_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentAPISessionReader is a Reader for the GetCurrentAPISession structure. -type GetCurrentAPISessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCurrentAPISessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCurrentAPISessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCurrentAPISessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCurrentAPISessionOK creates a GetCurrentAPISessionOK with default headers values -func NewGetCurrentAPISessionOK() *GetCurrentAPISessionOK { - return &GetCurrentAPISessionOK{} -} - -/* GetCurrentAPISessionOK describes a response with status code 200, with default header values. - -The API session associated with the session used to issue the request -*/ -type GetCurrentAPISessionOK struct { - Payload *rest_model.CurrentAPISessionDetailEnvelope -} - -func (o *GetCurrentAPISessionOK) Error() string { - return fmt.Sprintf("[GET /current-api-session][%d] getCurrentApiSessionOK %+v", 200, o.Payload) -} -func (o *GetCurrentAPISessionOK) GetPayload() *rest_model.CurrentAPISessionDetailEnvelope { - return o.Payload -} - -func (o *GetCurrentAPISessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CurrentAPISessionDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCurrentAPISessionUnauthorized creates a GetCurrentAPISessionUnauthorized with default headers values -func NewGetCurrentAPISessionUnauthorized() *GetCurrentAPISessionUnauthorized { - return &GetCurrentAPISessionUnauthorized{} -} - -/* GetCurrentAPISessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetCurrentAPISessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCurrentAPISessionUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-api-session][%d] getCurrentApiSessionUnauthorized %+v", 401, o.Payload) -} -func (o *GetCurrentAPISessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCurrentAPISessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/list_current_identity_authenticators_parameters.go b/rest_management_api_client/current_api_session/list_current_identity_authenticators_parameters.go deleted file mode 100644 index 2867bd7eb..000000000 --- a/rest_management_api_client/current_api_session/list_current_identity_authenticators_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCurrentIdentityAuthenticatorsParams creates a new ListCurrentIdentityAuthenticatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListCurrentIdentityAuthenticatorsParams() *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListCurrentIdentityAuthenticatorsParamsWithTimeout creates a new ListCurrentIdentityAuthenticatorsParams object -// with the ability to set a timeout on a request. -func NewListCurrentIdentityAuthenticatorsParamsWithTimeout(timeout time.Duration) *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - timeout: timeout, - } -} - -// NewListCurrentIdentityAuthenticatorsParamsWithContext creates a new ListCurrentIdentityAuthenticatorsParams object -// with the ability to set a context for a request. -func NewListCurrentIdentityAuthenticatorsParamsWithContext(ctx context.Context) *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - Context: ctx, - } -} - -// NewListCurrentIdentityAuthenticatorsParamsWithHTTPClient creates a new ListCurrentIdentityAuthenticatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListCurrentIdentityAuthenticatorsParamsWithHTTPClient(client *http.Client) *ListCurrentIdentityAuthenticatorsParams { - return &ListCurrentIdentityAuthenticatorsParams{ - HTTPClient: client, - } -} - -/* ListCurrentIdentityAuthenticatorsParams contains all the parameters to send to the API endpoint - for the list current identity authenticators operation. - - Typically these are written to a http.Request. -*/ -type ListCurrentIdentityAuthenticatorsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list current identity authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCurrentIdentityAuthenticatorsParams) WithDefaults() *ListCurrentIdentityAuthenticatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list current identity authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListCurrentIdentityAuthenticatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithTimeout(timeout time.Duration) *ListCurrentIdentityAuthenticatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithContext(ctx context.Context) *ListCurrentIdentityAuthenticatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithHTTPClient(client *http.Client) *ListCurrentIdentityAuthenticatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithFilter(filter *string) *ListCurrentIdentityAuthenticatorsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithLimit(limit *int64) *ListCurrentIdentityAuthenticatorsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) WithOffset(offset *int64) *ListCurrentIdentityAuthenticatorsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list current identity authenticators params -func (o *ListCurrentIdentityAuthenticatorsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListCurrentIdentityAuthenticatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/list_current_identity_authenticators_responses.go b/rest_management_api_client/current_api_session/list_current_identity_authenticators_responses.go deleted file mode 100644 index 7d507b824..000000000 --- a/rest_management_api_client/current_api_session/list_current_identity_authenticators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListCurrentIdentityAuthenticatorsReader is a Reader for the ListCurrentIdentityAuthenticators structure. -type ListCurrentIdentityAuthenticatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListCurrentIdentityAuthenticatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListCurrentIdentityAuthenticatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListCurrentIdentityAuthenticatorsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListCurrentIdentityAuthenticatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListCurrentIdentityAuthenticatorsOK creates a ListCurrentIdentityAuthenticatorsOK with default headers values -func NewListCurrentIdentityAuthenticatorsOK() *ListCurrentIdentityAuthenticatorsOK { - return &ListCurrentIdentityAuthenticatorsOK{} -} - -/* ListCurrentIdentityAuthenticatorsOK describes a response with status code 200, with default header values. - -A list of authenticators -*/ -type ListCurrentIdentityAuthenticatorsOK struct { - Payload *rest_model.ListAuthenticatorsEnvelope -} - -func (o *ListCurrentIdentityAuthenticatorsOK) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators][%d] listCurrentIdentityAuthenticatorsOK %+v", 200, o.Payload) -} -func (o *ListCurrentIdentityAuthenticatorsOK) GetPayload() *rest_model.ListAuthenticatorsEnvelope { - return o.Payload -} - -func (o *ListCurrentIdentityAuthenticatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListAuthenticatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCurrentIdentityAuthenticatorsBadRequest creates a ListCurrentIdentityAuthenticatorsBadRequest with default headers values -func NewListCurrentIdentityAuthenticatorsBadRequest() *ListCurrentIdentityAuthenticatorsBadRequest { - return &ListCurrentIdentityAuthenticatorsBadRequest{} -} - -/* ListCurrentIdentityAuthenticatorsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListCurrentIdentityAuthenticatorsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCurrentIdentityAuthenticatorsBadRequest) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators][%d] listCurrentIdentityAuthenticatorsBadRequest %+v", 400, o.Payload) -} -func (o *ListCurrentIdentityAuthenticatorsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCurrentIdentityAuthenticatorsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListCurrentIdentityAuthenticatorsUnauthorized creates a ListCurrentIdentityAuthenticatorsUnauthorized with default headers values -func NewListCurrentIdentityAuthenticatorsUnauthorized() *ListCurrentIdentityAuthenticatorsUnauthorized { - return &ListCurrentIdentityAuthenticatorsUnauthorized{} -} - -/* ListCurrentIdentityAuthenticatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListCurrentIdentityAuthenticatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/authenticators][%d] listCurrentIdentityAuthenticatorsUnauthorized %+v", 401, o.Payload) -} -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/patch_current_identity_authenticator_parameters.go b/rest_management_api_client/current_api_session/patch_current_identity_authenticator_parameters.go deleted file mode 100644 index a357899c0..000000000 --- a/rest_management_api_client/current_api_session/patch_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchCurrentIdentityAuthenticatorParams creates a new PatchCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchCurrentIdentityAuthenticatorParams() *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchCurrentIdentityAuthenticatorParamsWithTimeout creates a new PatchCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewPatchCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewPatchCurrentIdentityAuthenticatorParamsWithContext creates a new PatchCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewPatchCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewPatchCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new PatchCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *PatchCurrentIdentityAuthenticatorParams { - return &PatchCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* PatchCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the patch current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type PatchCurrentIdentityAuthenticatorParams struct { - - /* Authenticator. - - An authenticator patch object - */ - Authenticator *rest_model.AuthenticatorPatchWithCurrent - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchCurrentIdentityAuthenticatorParams) WithDefaults() *PatchCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *PatchCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *PatchCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *PatchCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorPatchWithCurrent) *PatchCurrentIdentityAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorPatchWithCurrent) { - o.Authenticator = authenticator -} - -// WithID adds the id to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) WithID(id string) *PatchCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch current identity authenticator params -func (o *PatchCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/patch_current_identity_authenticator_responses.go b/rest_management_api_client/current_api_session/patch_current_identity_authenticator_responses.go deleted file mode 100644 index 2032cb5ce..000000000 --- a/rest_management_api_client/current_api_session/patch_current_identity_authenticator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchCurrentIdentityAuthenticatorReader is a Reader for the PatchCurrentIdentityAuthenticator structure. -type PatchCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchCurrentIdentityAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchCurrentIdentityAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchCurrentIdentityAuthenticatorOK creates a PatchCurrentIdentityAuthenticatorOK with default headers values -func NewPatchCurrentIdentityAuthenticatorOK() *PatchCurrentIdentityAuthenticatorOK { - return &PatchCurrentIdentityAuthenticatorOK{} -} - -/* PatchCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *PatchCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCurrentIdentityAuthenticatorBadRequest creates a PatchCurrentIdentityAuthenticatorBadRequest with default headers values -func NewPatchCurrentIdentityAuthenticatorBadRequest() *PatchCurrentIdentityAuthenticatorBadRequest { - return &PatchCurrentIdentityAuthenticatorBadRequest{} -} - -/* PatchCurrentIdentityAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchCurrentIdentityAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCurrentIdentityAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCurrentIdentityAuthenticatorUnauthorized creates a PatchCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewPatchCurrentIdentityAuthenticatorUnauthorized() *PatchCurrentIdentityAuthenticatorUnauthorized { - return &PatchCurrentIdentityAuthenticatorUnauthorized{} -} - -/* PatchCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchCurrentIdentityAuthenticatorNotFound creates a PatchCurrentIdentityAuthenticatorNotFound with default headers values -func NewPatchCurrentIdentityAuthenticatorNotFound() *PatchCurrentIdentityAuthenticatorNotFound { - return &PatchCurrentIdentityAuthenticatorNotFound{} -} - -/* PatchCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchCurrentIdentityAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchCurrentIdentityAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[PATCH /current-identity/authenticators/{id}][%d] patchCurrentIdentityAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *PatchCurrentIdentityAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchCurrentIdentityAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_api_session/update_current_identity_authenticator_parameters.go b/rest_management_api_client/current_api_session/update_current_identity_authenticator_parameters.go deleted file mode 100644 index 98fee8670..000000000 --- a/rest_management_api_client/current_api_session/update_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateCurrentIdentityAuthenticatorParams creates a new UpdateCurrentIdentityAuthenticatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateCurrentIdentityAuthenticatorParams() *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateCurrentIdentityAuthenticatorParamsWithTimeout creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the ability to set a timeout on a request. -func NewUpdateCurrentIdentityAuthenticatorParamsWithTimeout(timeout time.Duration) *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - timeout: timeout, - } -} - -// NewUpdateCurrentIdentityAuthenticatorParamsWithContext creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the ability to set a context for a request. -func NewUpdateCurrentIdentityAuthenticatorParamsWithContext(ctx context.Context) *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - Context: ctx, - } -} - -// NewUpdateCurrentIdentityAuthenticatorParamsWithHTTPClient creates a new UpdateCurrentIdentityAuthenticatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateCurrentIdentityAuthenticatorParamsWithHTTPClient(client *http.Client) *UpdateCurrentIdentityAuthenticatorParams { - return &UpdateCurrentIdentityAuthenticatorParams{ - HTTPClient: client, - } -} - -/* UpdateCurrentIdentityAuthenticatorParams contains all the parameters to send to the API endpoint - for the update current identity authenticator operation. - - Typically these are written to a http.Request. -*/ -type UpdateCurrentIdentityAuthenticatorParams struct { - - /* Authenticator. - - An authenticator put object - */ - Authenticator *rest_model.AuthenticatorUpdateWithCurrent - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCurrentIdentityAuthenticatorParams) WithDefaults() *UpdateCurrentIdentityAuthenticatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update current identity authenticator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateCurrentIdentityAuthenticatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithTimeout(timeout time.Duration) *UpdateCurrentIdentityAuthenticatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithContext(ctx context.Context) *UpdateCurrentIdentityAuthenticatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithHTTPClient(client *http.Client) *UpdateCurrentIdentityAuthenticatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithAuthenticator adds the authenticator to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithAuthenticator(authenticator *rest_model.AuthenticatorUpdateWithCurrent) *UpdateCurrentIdentityAuthenticatorParams { - o.SetAuthenticator(authenticator) - return o -} - -// SetAuthenticator adds the authenticator to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetAuthenticator(authenticator *rest_model.AuthenticatorUpdateWithCurrent) { - o.Authenticator = authenticator -} - -// WithID adds the id to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) WithID(id string) *UpdateCurrentIdentityAuthenticatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update current identity authenticator params -func (o *UpdateCurrentIdentityAuthenticatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateCurrentIdentityAuthenticatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Authenticator != nil { - if err := r.SetBodyParam(o.Authenticator); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_api_session/update_current_identity_authenticator_responses.go b/rest_management_api_client/current_api_session/update_current_identity_authenticator_responses.go deleted file mode 100644 index 015697666..000000000 --- a/rest_management_api_client/current_api_session/update_current_identity_authenticator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateCurrentIdentityAuthenticatorReader is a Reader for the UpdateCurrentIdentityAuthenticator structure. -type UpdateCurrentIdentityAuthenticatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateCurrentIdentityAuthenticatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateCurrentIdentityAuthenticatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateCurrentIdentityAuthenticatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateCurrentIdentityAuthenticatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateCurrentIdentityAuthenticatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateCurrentIdentityAuthenticatorOK creates a UpdateCurrentIdentityAuthenticatorOK with default headers values -func NewUpdateCurrentIdentityAuthenticatorOK() *UpdateCurrentIdentityAuthenticatorOK { - return &UpdateCurrentIdentityAuthenticatorOK{} -} - -/* UpdateCurrentIdentityAuthenticatorOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateCurrentIdentityAuthenticatorOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateCurrentIdentityAuthenticatorOK) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorOK %+v", 200, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCurrentIdentityAuthenticatorBadRequest creates a UpdateCurrentIdentityAuthenticatorBadRequest with default headers values -func NewUpdateCurrentIdentityAuthenticatorBadRequest() *UpdateCurrentIdentityAuthenticatorBadRequest { - return &UpdateCurrentIdentityAuthenticatorBadRequest{} -} - -/* UpdateCurrentIdentityAuthenticatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateCurrentIdentityAuthenticatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorBadRequest %+v", 400, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCurrentIdentityAuthenticatorUnauthorized creates a UpdateCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewUpdateCurrentIdentityAuthenticatorUnauthorized() *UpdateCurrentIdentityAuthenticatorUnauthorized { - return &UpdateCurrentIdentityAuthenticatorUnauthorized{} -} - -/* UpdateCurrentIdentityAuthenticatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateCurrentIdentityAuthenticatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateCurrentIdentityAuthenticatorNotFound creates a UpdateCurrentIdentityAuthenticatorNotFound with default headers values -func NewUpdateCurrentIdentityAuthenticatorNotFound() *UpdateCurrentIdentityAuthenticatorNotFound { - return &UpdateCurrentIdentityAuthenticatorNotFound{} -} - -/* UpdateCurrentIdentityAuthenticatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateCurrentIdentityAuthenticatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateCurrentIdentityAuthenticatorNotFound) Error() string { - return fmt.Sprintf("[PUT /current-identity/authenticators/{id}][%d] updateCurrentIdentityAuthenticatorNotFound %+v", 404, o.Payload) -} -func (o *UpdateCurrentIdentityAuthenticatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateCurrentIdentityAuthenticatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/create_mfa_recovery_codes_parameters.go b/rest_management_api_client/current_identity/create_mfa_recovery_codes_parameters.go deleted file mode 100644 index dfe1c5554..000000000 --- a/rest_management_api_client/current_identity/create_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateMfaRecoveryCodesParams creates a new CreateMfaRecoveryCodesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMfaRecoveryCodesParams() *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMfaRecoveryCodesParamsWithTimeout creates a new CreateMfaRecoveryCodesParams object -// with the ability to set a timeout on a request. -func NewCreateMfaRecoveryCodesParamsWithTimeout(timeout time.Duration) *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - timeout: timeout, - } -} - -// NewCreateMfaRecoveryCodesParamsWithContext creates a new CreateMfaRecoveryCodesParams object -// with the ability to set a context for a request. -func NewCreateMfaRecoveryCodesParamsWithContext(ctx context.Context) *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - Context: ctx, - } -} - -// NewCreateMfaRecoveryCodesParamsWithHTTPClient creates a new CreateMfaRecoveryCodesParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMfaRecoveryCodesParamsWithHTTPClient(client *http.Client) *CreateMfaRecoveryCodesParams { - return &CreateMfaRecoveryCodesParams{ - HTTPClient: client, - } -} - -/* CreateMfaRecoveryCodesParams contains all the parameters to send to the API endpoint - for the create mfa recovery codes operation. - - Typically these are written to a http.Request. -*/ -type CreateMfaRecoveryCodesParams struct { - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMfaRecoveryCodesParams) WithDefaults() *CreateMfaRecoveryCodesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMfaRecoveryCodesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithTimeout(timeout time.Duration) *CreateMfaRecoveryCodesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithContext(ctx context.Context) *CreateMfaRecoveryCodesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithHTTPClient(client *http.Client) *CreateMfaRecoveryCodesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidation adds the mfaValidation to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *CreateMfaRecoveryCodesParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the create mfa recovery codes params -func (o *CreateMfaRecoveryCodesParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMfaRecoveryCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/create_mfa_recovery_codes_responses.go b/rest_management_api_client/current_identity/create_mfa_recovery_codes_responses.go deleted file mode 100644 index 7f0d20f88..000000000 --- a/rest_management_api_client/current_identity/create_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateMfaRecoveryCodesReader is a Reader for the CreateMfaRecoveryCodes structure. -type CreateMfaRecoveryCodesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMfaRecoveryCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateMfaRecoveryCodesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCreateMfaRecoveryCodesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMfaRecoveryCodesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateMfaRecoveryCodesOK creates a CreateMfaRecoveryCodesOK with default headers values -func NewCreateMfaRecoveryCodesOK() *CreateMfaRecoveryCodesOK { - return &CreateMfaRecoveryCodesOK{} -} - -/* CreateMfaRecoveryCodesOK describes a response with status code 200, with default header values. - -The recovery codes of an MFA enrollment -*/ -type CreateMfaRecoveryCodesOK struct { - Payload *rest_model.DetailMfaRecoveryCodesEnvelope -} - -func (o *CreateMfaRecoveryCodesOK) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/recovery-codes][%d] createMfaRecoveryCodesOK %+v", 200, o.Payload) -} -func (o *CreateMfaRecoveryCodesOK) GetPayload() *rest_model.DetailMfaRecoveryCodesEnvelope { - return o.Payload -} - -func (o *CreateMfaRecoveryCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailMfaRecoveryCodesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMfaRecoveryCodesUnauthorized creates a CreateMfaRecoveryCodesUnauthorized with default headers values -func NewCreateMfaRecoveryCodesUnauthorized() *CreateMfaRecoveryCodesUnauthorized { - return &CreateMfaRecoveryCodesUnauthorized{} -} - -/* CreateMfaRecoveryCodesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateMfaRecoveryCodesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateMfaRecoveryCodesUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/recovery-codes][%d] createMfaRecoveryCodesUnauthorized %+v", 401, o.Payload) -} -func (o *CreateMfaRecoveryCodesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateMfaRecoveryCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMfaRecoveryCodesNotFound creates a CreateMfaRecoveryCodesNotFound with default headers values -func NewCreateMfaRecoveryCodesNotFound() *CreateMfaRecoveryCodesNotFound { - return &CreateMfaRecoveryCodesNotFound{} -} - -/* CreateMfaRecoveryCodesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type CreateMfaRecoveryCodesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateMfaRecoveryCodesNotFound) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/recovery-codes][%d] createMfaRecoveryCodesNotFound %+v", 404, o.Payload) -} -func (o *CreateMfaRecoveryCodesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateMfaRecoveryCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/current_identity_client.go b/rest_management_api_client/current_identity/current_identity_client.go deleted file mode 100644 index 126279c90..000000000 --- a/rest_management_api_client/current_identity/current_identity_client.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new current identity API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for current identity API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateMfaRecoveryCodesOK, error) - - DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteMfaOK, error) - - DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaOK, error) - - DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaQrCodeOK, error) - - DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaRecoveryCodesOK, error) - - EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnrollMfaCreated, error) - - GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityOK, error) - - VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyMfaOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMfaRecoveryCodes fors a completed m f a enrollment regenerate the recovery codes - - Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes. - -*/ -func (a *Client) CreateMfaRecoveryCodes(params *CreateMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateMfaRecoveryCodesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMfaRecoveryCodesParams() - } - op := &runtime.ClientOperation{ - ID: "createMfaRecoveryCodes", - Method: "POST", - PathPattern: "/current-identity/mfa/recovery-codes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateMfaRecoveryCodesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMfaRecoveryCodesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMfaRecoveryCodes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteMfa disables m f a for the current identity - - Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via `DELETE /identities//mfa`. - -*/ -func (a *Client) DeleteMfa(params *DeleteMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteMfaParams() - } - op := &runtime.ClientOperation{ - ID: "deleteMfa", - Method: "DELETE", - PathPattern: "/current-identity/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailMfa returns the current status of m f a enrollment - - Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a `POST /current-identity/mfa/verify`. - -*/ -func (a *Client) DetailMfa(params *DetailMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailMfaParams() - } - op := &runtime.ClientOperation{ - ID: "detailMfa", - Method: "GET", - PathPattern: "/current-identity/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailMfaQrCode shows a q r code for unverified m f a enrollments - - Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started. - -*/ -func (a *Client) DetailMfaQrCode(params *DetailMfaQrCodeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaQrCodeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailMfaQrCodeParams() - } - op := &runtime.ClientOperation{ - ID: "detailMfaQrCode", - Method: "GET", - PathPattern: "/current-identity/mfa/qr-code", - ProducesMediaTypes: []string{"application/json", "image/png"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailMfaQrCodeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailMfaQrCodeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailMfaQrCode: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailMfaRecoveryCodes fors a completed m f a enrollment view the current recovery codes - - Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. - -*/ -func (a *Client) DetailMfaRecoveryCodes(params *DetailMfaRecoveryCodesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailMfaRecoveryCodesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailMfaRecoveryCodesParams() - } - op := &runtime.ClientOperation{ - ID: "detailMfaRecoveryCodes", - Method: "GET", - PathPattern: "/current-identity/mfa/recovery-codes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailMfaRecoveryCodesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailMfaRecoveryCodesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailMfaRecoveryCodes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnrollMfa initiates m f a enrollment - - Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via `POST /current-identity/mfa/verify` - -*/ -func (a *Client) EnrollMfa(params *EnrollMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnrollMfaCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnrollMfaParams() - } - op := &runtime.ClientOperation{ - ID: "enrollMfa", - Method: "POST", - PathPattern: "/current-identity/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnrollMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnrollMfaCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enrollMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetCurrentIdentity returns the current identity - - Returns the identity associated with the API sessions used to issue the current request -*/ -func (a *Client) GetCurrentIdentity(params *GetCurrentIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCurrentIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetCurrentIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "getCurrentIdentity", - Method: "GET", - PathPattern: "/current-identity", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetCurrentIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetCurrentIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getCurrentIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - VerifyMfa completes m f a enrollment by verifying a time based one time token - - Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via `POST /current-identity/mfa`. - -*/ -func (a *Client) VerifyMfa(params *VerifyMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*VerifyMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewVerifyMfaParams() - } - op := &runtime.ClientOperation{ - ID: "verifyMfa", - Method: "POST", - PathPattern: "/current-identity/mfa/verify", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &VerifyMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*VerifyMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for verifyMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/current_identity/delete_mfa_parameters.go b/rest_management_api_client/current_identity/delete_mfa_parameters.go deleted file mode 100644 index 1aca8d4a3..000000000 --- a/rest_management_api_client/current_identity/delete_mfa_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewDeleteMfaParams creates a new DeleteMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteMfaParams() *DeleteMfaParams { - return &DeleteMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteMfaParamsWithTimeout creates a new DeleteMfaParams object -// with the ability to set a timeout on a request. -func NewDeleteMfaParamsWithTimeout(timeout time.Duration) *DeleteMfaParams { - return &DeleteMfaParams{ - timeout: timeout, - } -} - -// NewDeleteMfaParamsWithContext creates a new DeleteMfaParams object -// with the ability to set a context for a request. -func NewDeleteMfaParamsWithContext(ctx context.Context) *DeleteMfaParams { - return &DeleteMfaParams{ - Context: ctx, - } -} - -// NewDeleteMfaParamsWithHTTPClient creates a new DeleteMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteMfaParamsWithHTTPClient(client *http.Client) *DeleteMfaParams { - return &DeleteMfaParams{ - HTTPClient: client, - } -} - -/* DeleteMfaParams contains all the parameters to send to the API endpoint - for the delete mfa operation. - - Typically these are written to a http.Request. -*/ -type DeleteMfaParams struct { - - // MfaValidationCode. - MfaValidationCode *string - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteMfaParams) WithDefaults() *DeleteMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete mfa params -func (o *DeleteMfaParams) WithTimeout(timeout time.Duration) *DeleteMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete mfa params -func (o *DeleteMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete mfa params -func (o *DeleteMfaParams) WithContext(ctx context.Context) *DeleteMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete mfa params -func (o *DeleteMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete mfa params -func (o *DeleteMfaParams) WithHTTPClient(client *http.Client) *DeleteMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete mfa params -func (o *DeleteMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidationCode adds the mfaValidationCode to the delete mfa params -func (o *DeleteMfaParams) WithMfaValidationCode(mfaValidationCode *string) *DeleteMfaParams { - o.SetMfaValidationCode(mfaValidationCode) - return o -} - -// SetMfaValidationCode adds the mfaValidationCode to the delete mfa params -func (o *DeleteMfaParams) SetMfaValidationCode(mfaValidationCode *string) { - o.MfaValidationCode = mfaValidationCode -} - -// WithMfaValidation adds the mfaValidation to the delete mfa params -func (o *DeleteMfaParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *DeleteMfaParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the delete mfa params -func (o *DeleteMfaParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.MfaValidationCode != nil { - - // header param mfa-validation-code - if err := r.SetHeaderParam("mfa-validation-code", *o.MfaValidationCode); err != nil { - return err - } - } - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/delete_mfa_responses.go b/rest_management_api_client/current_identity/delete_mfa_responses.go deleted file mode 100644 index 078ac1ee1..000000000 --- a/rest_management_api_client/current_identity/delete_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteMfaReader is a Reader for the DeleteMfa structure. -type DeleteMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDeleteMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteMfaOK creates a DeleteMfaOK with default headers values -func NewDeleteMfaOK() *DeleteMfaOK { - return &DeleteMfaOK{} -} - -/* DeleteMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DeleteMfaOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteMfaOK) Error() string { - return fmt.Sprintf("[DELETE /current-identity/mfa][%d] deleteMfaOK %+v", 200, o.Payload) -} -func (o *DeleteMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMfaUnauthorized creates a DeleteMfaUnauthorized with default headers values -func NewDeleteMfaUnauthorized() *DeleteMfaUnauthorized { - return &DeleteMfaUnauthorized{} -} - -/* DeleteMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteMfaUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /current-identity/mfa][%d] deleteMfaUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMfaNotFound creates a DeleteMfaNotFound with default headers values -func NewDeleteMfaNotFound() *DeleteMfaNotFound { - return &DeleteMfaNotFound{} -} - -/* DeleteMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DeleteMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteMfaNotFound) Error() string { - return fmt.Sprintf("[DELETE /current-identity/mfa][%d] deleteMfaNotFound %+v", 404, o.Payload) -} -func (o *DeleteMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/detail_mfa_parameters.go b/rest_management_api_client/current_identity/detail_mfa_parameters.go deleted file mode 100644 index 0a33ee409..000000000 --- a/rest_management_api_client/current_identity/detail_mfa_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailMfaParams creates a new DetailMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailMfaParams() *DetailMfaParams { - return &DetailMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailMfaParamsWithTimeout creates a new DetailMfaParams object -// with the ability to set a timeout on a request. -func NewDetailMfaParamsWithTimeout(timeout time.Duration) *DetailMfaParams { - return &DetailMfaParams{ - timeout: timeout, - } -} - -// NewDetailMfaParamsWithContext creates a new DetailMfaParams object -// with the ability to set a context for a request. -func NewDetailMfaParamsWithContext(ctx context.Context) *DetailMfaParams { - return &DetailMfaParams{ - Context: ctx, - } -} - -// NewDetailMfaParamsWithHTTPClient creates a new DetailMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailMfaParamsWithHTTPClient(client *http.Client) *DetailMfaParams { - return &DetailMfaParams{ - HTTPClient: client, - } -} - -/* DetailMfaParams contains all the parameters to send to the API endpoint - for the detail mfa operation. - - Typically these are written to a http.Request. -*/ -type DetailMfaParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaParams) WithDefaults() *DetailMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail mfa params -func (o *DetailMfaParams) WithTimeout(timeout time.Duration) *DetailMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail mfa params -func (o *DetailMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail mfa params -func (o *DetailMfaParams) WithContext(ctx context.Context) *DetailMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail mfa params -func (o *DetailMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail mfa params -func (o *DetailMfaParams) WithHTTPClient(client *http.Client) *DetailMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail mfa params -func (o *DetailMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/detail_mfa_qr_code_parameters.go b/rest_management_api_client/current_identity/detail_mfa_qr_code_parameters.go deleted file mode 100644 index 633dc56ec..000000000 --- a/rest_management_api_client/current_identity/detail_mfa_qr_code_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailMfaQrCodeParams creates a new DetailMfaQrCodeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailMfaQrCodeParams() *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailMfaQrCodeParamsWithTimeout creates a new DetailMfaQrCodeParams object -// with the ability to set a timeout on a request. -func NewDetailMfaQrCodeParamsWithTimeout(timeout time.Duration) *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - timeout: timeout, - } -} - -// NewDetailMfaQrCodeParamsWithContext creates a new DetailMfaQrCodeParams object -// with the ability to set a context for a request. -func NewDetailMfaQrCodeParamsWithContext(ctx context.Context) *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - Context: ctx, - } -} - -// NewDetailMfaQrCodeParamsWithHTTPClient creates a new DetailMfaQrCodeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailMfaQrCodeParamsWithHTTPClient(client *http.Client) *DetailMfaQrCodeParams { - return &DetailMfaQrCodeParams{ - HTTPClient: client, - } -} - -/* DetailMfaQrCodeParams contains all the parameters to send to the API endpoint - for the detail mfa qr code operation. - - Typically these are written to a http.Request. -*/ -type DetailMfaQrCodeParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail mfa qr code params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaQrCodeParams) WithDefaults() *DetailMfaQrCodeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail mfa qr code params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaQrCodeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) WithTimeout(timeout time.Duration) *DetailMfaQrCodeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) WithContext(ctx context.Context) *DetailMfaQrCodeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) WithHTTPClient(client *http.Client) *DetailMfaQrCodeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail mfa qr code params -func (o *DetailMfaQrCodeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailMfaQrCodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/detail_mfa_qr_code_responses.go b/rest_management_api_client/current_identity/detail_mfa_qr_code_responses.go deleted file mode 100644 index f88ac0469..000000000 --- a/rest_management_api_client/current_identity/detail_mfa_qr_code_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// DetailMfaQrCodeReader is a Reader for the DetailMfaQrCode structure. -type DetailMfaQrCodeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailMfaQrCodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailMfaQrCodeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 404: - result := NewDetailMfaQrCodeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailMfaQrCodeOK creates a DetailMfaQrCodeOK with default headers values -func NewDetailMfaQrCodeOK() *DetailMfaQrCodeOK { - return &DetailMfaQrCodeOK{} -} - -/* DetailMfaQrCodeOK describes a response with status code 200, with default header values. - -OK -*/ -type DetailMfaQrCodeOK struct { -} - -func (o *DetailMfaQrCodeOK) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/qr-code][%d] detailMfaQrCodeOK ", 200) -} - -func (o *DetailMfaQrCodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDetailMfaQrCodeNotFound creates a DetailMfaQrCodeNotFound with default headers values -func NewDetailMfaQrCodeNotFound() *DetailMfaQrCodeNotFound { - return &DetailMfaQrCodeNotFound{} -} - -/* DetailMfaQrCodeNotFound describes a response with status code 404, with default header values. - -No MFA enrollment or MFA enrollment is completed -*/ -type DetailMfaQrCodeNotFound struct { -} - -func (o *DetailMfaQrCodeNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/qr-code][%d] detailMfaQrCodeNotFound ", 404) -} - -func (o *DetailMfaQrCodeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/rest_management_api_client/current_identity/detail_mfa_recovery_codes_parameters.go b/rest_management_api_client/current_identity/detail_mfa_recovery_codes_parameters.go deleted file mode 100644 index 6960b0abc..000000000 --- a/rest_management_api_client/current_identity/detail_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewDetailMfaRecoveryCodesParams creates a new DetailMfaRecoveryCodesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailMfaRecoveryCodesParams() *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailMfaRecoveryCodesParamsWithTimeout creates a new DetailMfaRecoveryCodesParams object -// with the ability to set a timeout on a request. -func NewDetailMfaRecoveryCodesParamsWithTimeout(timeout time.Duration) *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - timeout: timeout, - } -} - -// NewDetailMfaRecoveryCodesParamsWithContext creates a new DetailMfaRecoveryCodesParams object -// with the ability to set a context for a request. -func NewDetailMfaRecoveryCodesParamsWithContext(ctx context.Context) *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - Context: ctx, - } -} - -// NewDetailMfaRecoveryCodesParamsWithHTTPClient creates a new DetailMfaRecoveryCodesParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailMfaRecoveryCodesParamsWithHTTPClient(client *http.Client) *DetailMfaRecoveryCodesParams { - return &DetailMfaRecoveryCodesParams{ - HTTPClient: client, - } -} - -/* DetailMfaRecoveryCodesParams contains all the parameters to send to the API endpoint - for the detail mfa recovery codes operation. - - Typically these are written to a http.Request. -*/ -type DetailMfaRecoveryCodesParams struct { - - // MfaValidationCode. - MfaValidationCode *string - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaRecoveryCodesParams) WithDefaults() *DetailMfaRecoveryCodesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail mfa recovery codes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailMfaRecoveryCodesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithTimeout(timeout time.Duration) *DetailMfaRecoveryCodesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithContext(ctx context.Context) *DetailMfaRecoveryCodesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithHTTPClient(client *http.Client) *DetailMfaRecoveryCodesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidationCode adds the mfaValidationCode to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithMfaValidationCode(mfaValidationCode *string) *DetailMfaRecoveryCodesParams { - o.SetMfaValidationCode(mfaValidationCode) - return o -} - -// SetMfaValidationCode adds the mfaValidationCode to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetMfaValidationCode(mfaValidationCode *string) { - o.MfaValidationCode = mfaValidationCode -} - -// WithMfaValidation adds the mfaValidation to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *DetailMfaRecoveryCodesParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the detail mfa recovery codes params -func (o *DetailMfaRecoveryCodesParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailMfaRecoveryCodesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.MfaValidationCode != nil { - - // header param mfa-validation-code - if err := r.SetHeaderParam("mfa-validation-code", *o.MfaValidationCode); err != nil { - return err - } - } - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/detail_mfa_recovery_codes_responses.go b/rest_management_api_client/current_identity/detail_mfa_recovery_codes_responses.go deleted file mode 100644 index 4526d215e..000000000 --- a/rest_management_api_client/current_identity/detail_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaRecoveryCodesReader is a Reader for the DetailMfaRecoveryCodes structure. -type DetailMfaRecoveryCodesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailMfaRecoveryCodesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailMfaRecoveryCodesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailMfaRecoveryCodesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailMfaRecoveryCodesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailMfaRecoveryCodesOK creates a DetailMfaRecoveryCodesOK with default headers values -func NewDetailMfaRecoveryCodesOK() *DetailMfaRecoveryCodesOK { - return &DetailMfaRecoveryCodesOK{} -} - -/* DetailMfaRecoveryCodesOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DetailMfaRecoveryCodesOK struct { - Payload *rest_model.Empty -} - -func (o *DetailMfaRecoveryCodesOK) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/recovery-codes][%d] detailMfaRecoveryCodesOK %+v", 200, o.Payload) -} -func (o *DetailMfaRecoveryCodesOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DetailMfaRecoveryCodesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaRecoveryCodesUnauthorized creates a DetailMfaRecoveryCodesUnauthorized with default headers values -func NewDetailMfaRecoveryCodesUnauthorized() *DetailMfaRecoveryCodesUnauthorized { - return &DetailMfaRecoveryCodesUnauthorized{} -} - -/* DetailMfaRecoveryCodesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailMfaRecoveryCodesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaRecoveryCodesUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/recovery-codes][%d] detailMfaRecoveryCodesUnauthorized %+v", 401, o.Payload) -} -func (o *DetailMfaRecoveryCodesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaRecoveryCodesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaRecoveryCodesNotFound creates a DetailMfaRecoveryCodesNotFound with default headers values -func NewDetailMfaRecoveryCodesNotFound() *DetailMfaRecoveryCodesNotFound { - return &DetailMfaRecoveryCodesNotFound{} -} - -/* DetailMfaRecoveryCodesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailMfaRecoveryCodesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaRecoveryCodesNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa/recovery-codes][%d] detailMfaRecoveryCodesNotFound %+v", 404, o.Payload) -} -func (o *DetailMfaRecoveryCodesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaRecoveryCodesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/detail_mfa_responses.go b/rest_management_api_client/current_identity/detail_mfa_responses.go deleted file mode 100644 index d94a0c1c0..000000000 --- a/rest_management_api_client/current_identity/detail_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaReader is a Reader for the DetailMfa structure. -type DetailMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailMfaOK creates a DetailMfaOK with default headers values -func NewDetailMfaOK() *DetailMfaOK { - return &DetailMfaOK{} -} - -/* DetailMfaOK describes a response with status code 200, with default header values. - -The details of an MFA enrollment -*/ -type DetailMfaOK struct { - Payload *rest_model.DetailMfaEnvelope -} - -func (o *DetailMfaOK) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa][%d] detailMfaOK %+v", 200, o.Payload) -} -func (o *DetailMfaOK) GetPayload() *rest_model.DetailMfaEnvelope { - return o.Payload -} - -func (o *DetailMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailMfaEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaUnauthorized creates a DetailMfaUnauthorized with default headers values -func NewDetailMfaUnauthorized() *DetailMfaUnauthorized { - return &DetailMfaUnauthorized{} -} - -/* DetailMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa][%d] detailMfaUnauthorized %+v", 401, o.Payload) -} -func (o *DetailMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailMfaNotFound creates a DetailMfaNotFound with default headers values -func NewDetailMfaNotFound() *DetailMfaNotFound { - return &DetailMfaNotFound{} -} - -/* DetailMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailMfaNotFound) Error() string { - return fmt.Sprintf("[GET /current-identity/mfa][%d] detailMfaNotFound %+v", 404, o.Payload) -} -func (o *DetailMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/enroll_mfa_parameters.go b/rest_management_api_client/current_identity/enroll_mfa_parameters.go deleted file mode 100644 index 3dc390b80..000000000 --- a/rest_management_api_client/current_identity/enroll_mfa_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnrollMfaParams creates a new EnrollMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnrollMfaParams() *EnrollMfaParams { - return &EnrollMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnrollMfaParamsWithTimeout creates a new EnrollMfaParams object -// with the ability to set a timeout on a request. -func NewEnrollMfaParamsWithTimeout(timeout time.Duration) *EnrollMfaParams { - return &EnrollMfaParams{ - timeout: timeout, - } -} - -// NewEnrollMfaParamsWithContext creates a new EnrollMfaParams object -// with the ability to set a context for a request. -func NewEnrollMfaParamsWithContext(ctx context.Context) *EnrollMfaParams { - return &EnrollMfaParams{ - Context: ctx, - } -} - -// NewEnrollMfaParamsWithHTTPClient creates a new EnrollMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnrollMfaParamsWithHTTPClient(client *http.Client) *EnrollMfaParams { - return &EnrollMfaParams{ - HTTPClient: client, - } -} - -/* EnrollMfaParams contains all the parameters to send to the API endpoint - for the enroll mfa operation. - - Typically these are written to a http.Request. -*/ -type EnrollMfaParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enroll mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollMfaParams) WithDefaults() *EnrollMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enroll mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnrollMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enroll mfa params -func (o *EnrollMfaParams) WithTimeout(timeout time.Duration) *EnrollMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enroll mfa params -func (o *EnrollMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enroll mfa params -func (o *EnrollMfaParams) WithContext(ctx context.Context) *EnrollMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enroll mfa params -func (o *EnrollMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enroll mfa params -func (o *EnrollMfaParams) WithHTTPClient(client *http.Client) *EnrollMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enroll mfa params -func (o *EnrollMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *EnrollMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/enroll_mfa_responses.go b/rest_management_api_client/current_identity/enroll_mfa_responses.go deleted file mode 100644 index 5467e2587..000000000 --- a/rest_management_api_client/current_identity/enroll_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnrollMfaReader is a Reader for the EnrollMfa structure. -type EnrollMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnrollMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewEnrollMfaCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewEnrollMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewEnrollMfaConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnrollMfaCreated creates a EnrollMfaCreated with default headers values -func NewEnrollMfaCreated() *EnrollMfaCreated { - return &EnrollMfaCreated{} -} - -/* EnrollMfaCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type EnrollMfaCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *EnrollMfaCreated) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa][%d] enrollMfaCreated %+v", 201, o.Payload) -} -func (o *EnrollMfaCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *EnrollMfaCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollMfaUnauthorized creates a EnrollMfaUnauthorized with default headers values -func NewEnrollMfaUnauthorized() *EnrollMfaUnauthorized { - return &EnrollMfaUnauthorized{} -} - -/* EnrollMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type EnrollMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollMfaUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa][%d] enrollMfaUnauthorized %+v", 401, o.Payload) -} -func (o *EnrollMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnrollMfaConflict creates a EnrollMfaConflict with default headers values -func NewEnrollMfaConflict() *EnrollMfaConflict { - return &EnrollMfaConflict{} -} - -/* EnrollMfaConflict describes a response with status code 409, with default header values. - -The identity is already enrolled in MFA -*/ -type EnrollMfaConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnrollMfaConflict) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa][%d] enrollMfaConflict %+v", 409, o.Payload) -} -func (o *EnrollMfaConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnrollMfaConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/get_current_identity_parameters.go b/rest_management_api_client/current_identity/get_current_identity_parameters.go deleted file mode 100644 index a602b28cb..000000000 --- a/rest_management_api_client/current_identity/get_current_identity_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetCurrentIdentityParams creates a new GetCurrentIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetCurrentIdentityParams() *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetCurrentIdentityParamsWithTimeout creates a new GetCurrentIdentityParams object -// with the ability to set a timeout on a request. -func NewGetCurrentIdentityParamsWithTimeout(timeout time.Duration) *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - timeout: timeout, - } -} - -// NewGetCurrentIdentityParamsWithContext creates a new GetCurrentIdentityParams object -// with the ability to set a context for a request. -func NewGetCurrentIdentityParamsWithContext(ctx context.Context) *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - Context: ctx, - } -} - -// NewGetCurrentIdentityParamsWithHTTPClient creates a new GetCurrentIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetCurrentIdentityParamsWithHTTPClient(client *http.Client) *GetCurrentIdentityParams { - return &GetCurrentIdentityParams{ - HTTPClient: client, - } -} - -/* GetCurrentIdentityParams contains all the parameters to send to the API endpoint - for the get current identity operation. - - Typically these are written to a http.Request. -*/ -type GetCurrentIdentityParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get current identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentIdentityParams) WithDefaults() *GetCurrentIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get current identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetCurrentIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get current identity params -func (o *GetCurrentIdentityParams) WithTimeout(timeout time.Duration) *GetCurrentIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get current identity params -func (o *GetCurrentIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get current identity params -func (o *GetCurrentIdentityParams) WithContext(ctx context.Context) *GetCurrentIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get current identity params -func (o *GetCurrentIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get current identity params -func (o *GetCurrentIdentityParams) WithHTTPClient(client *http.Client) *GetCurrentIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get current identity params -func (o *GetCurrentIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *GetCurrentIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/get_current_identity_responses.go b/rest_management_api_client/current_identity/get_current_identity_responses.go deleted file mode 100644 index e028c28d7..000000000 --- a/rest_management_api_client/current_identity/get_current_identity_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentIdentityReader is a Reader for the GetCurrentIdentity structure. -type GetCurrentIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetCurrentIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetCurrentIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetCurrentIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetCurrentIdentityOK creates a GetCurrentIdentityOK with default headers values -func NewGetCurrentIdentityOK() *GetCurrentIdentityOK { - return &GetCurrentIdentityOK{} -} - -/* GetCurrentIdentityOK describes a response with status code 200, with default header values. - -The identity associated with the API Session used to issue the request -*/ -type GetCurrentIdentityOK struct { - Payload *rest_model.CurrentIdentityDetailEnvelope -} - -func (o *GetCurrentIdentityOK) Error() string { - return fmt.Sprintf("[GET /current-identity][%d] getCurrentIdentityOK %+v", 200, o.Payload) -} -func (o *GetCurrentIdentityOK) GetPayload() *rest_model.CurrentIdentityDetailEnvelope { - return o.Payload -} - -func (o *GetCurrentIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CurrentIdentityDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetCurrentIdentityUnauthorized creates a GetCurrentIdentityUnauthorized with default headers values -func NewGetCurrentIdentityUnauthorized() *GetCurrentIdentityUnauthorized { - return &GetCurrentIdentityUnauthorized{} -} - -/* GetCurrentIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetCurrentIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetCurrentIdentityUnauthorized) Error() string { - return fmt.Sprintf("[GET /current-identity][%d] getCurrentIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *GetCurrentIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetCurrentIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/current_identity/verify_mfa_parameters.go b/rest_management_api_client/current_identity/verify_mfa_parameters.go deleted file mode 100644 index e2fafc4c3..000000000 --- a/rest_management_api_client/current_identity/verify_mfa_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewVerifyMfaParams creates a new VerifyMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewVerifyMfaParams() *VerifyMfaParams { - return &VerifyMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewVerifyMfaParamsWithTimeout creates a new VerifyMfaParams object -// with the ability to set a timeout on a request. -func NewVerifyMfaParamsWithTimeout(timeout time.Duration) *VerifyMfaParams { - return &VerifyMfaParams{ - timeout: timeout, - } -} - -// NewVerifyMfaParamsWithContext creates a new VerifyMfaParams object -// with the ability to set a context for a request. -func NewVerifyMfaParamsWithContext(ctx context.Context) *VerifyMfaParams { - return &VerifyMfaParams{ - Context: ctx, - } -} - -// NewVerifyMfaParamsWithHTTPClient creates a new VerifyMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewVerifyMfaParamsWithHTTPClient(client *http.Client) *VerifyMfaParams { - return &VerifyMfaParams{ - HTTPClient: client, - } -} - -/* VerifyMfaParams contains all the parameters to send to the API endpoint - for the verify mfa operation. - - Typically these are written to a http.Request. -*/ -type VerifyMfaParams struct { - - /* MfaValidation. - - An MFA validation request - */ - MfaValidation *rest_model.MfaCode - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the verify mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VerifyMfaParams) WithDefaults() *VerifyMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the verify mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *VerifyMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the verify mfa params -func (o *VerifyMfaParams) WithTimeout(timeout time.Duration) *VerifyMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the verify mfa params -func (o *VerifyMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the verify mfa params -func (o *VerifyMfaParams) WithContext(ctx context.Context) *VerifyMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the verify mfa params -func (o *VerifyMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the verify mfa params -func (o *VerifyMfaParams) WithHTTPClient(client *http.Client) *VerifyMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the verify mfa params -func (o *VerifyMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMfaValidation adds the mfaValidation to the verify mfa params -func (o *VerifyMfaParams) WithMfaValidation(mfaValidation *rest_model.MfaCode) *VerifyMfaParams { - o.SetMfaValidation(mfaValidation) - return o -} - -// SetMfaValidation adds the mfaValidation to the verify mfa params -func (o *VerifyMfaParams) SetMfaValidation(mfaValidation *rest_model.MfaCode) { - o.MfaValidation = mfaValidation -} - -// WriteToRequest writes these params to a swagger request -func (o *VerifyMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.MfaValidation != nil { - if err := r.SetBodyParam(o.MfaValidation); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/current_identity/verify_mfa_responses.go b/rest_management_api_client/current_identity/verify_mfa_responses.go deleted file mode 100644 index b2774952f..000000000 --- a/rest_management_api_client/current_identity/verify_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// VerifyMfaReader is a Reader for the VerifyMfa structure. -type VerifyMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *VerifyMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewVerifyMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewVerifyMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewVerifyMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewVerifyMfaOK creates a VerifyMfaOK with default headers values -func NewVerifyMfaOK() *VerifyMfaOK { - return &VerifyMfaOK{} -} - -/* VerifyMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type VerifyMfaOK struct { - Payload *rest_model.Empty -} - -func (o *VerifyMfaOK) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/verify][%d] verifyMfaOK %+v", 200, o.Payload) -} -func (o *VerifyMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *VerifyMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyMfaUnauthorized creates a VerifyMfaUnauthorized with default headers values -func NewVerifyMfaUnauthorized() *VerifyMfaUnauthorized { - return &VerifyMfaUnauthorized{} -} - -/* VerifyMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type VerifyMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyMfaUnauthorized) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/verify][%d] verifyMfaUnauthorized %+v", 401, o.Payload) -} -func (o *VerifyMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewVerifyMfaNotFound creates a VerifyMfaNotFound with default headers values -func NewVerifyMfaNotFound() *VerifyMfaNotFound { - return &VerifyMfaNotFound{} -} - -/* VerifyMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type VerifyMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *VerifyMfaNotFound) Error() string { - return fmt.Sprintf("[POST /current-identity/mfa/verify][%d] verifyMfaNotFound %+v", 404, o.Payload) -} -func (o *VerifyMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *VerifyMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/database/check_data_integrity_parameters.go b/rest_management_api_client/database/check_data_integrity_parameters.go deleted file mode 100644 index 0709fa74a..000000000 --- a/rest_management_api_client/database/check_data_integrity_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCheckDataIntegrityParams creates a new CheckDataIntegrityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCheckDataIntegrityParams() *CheckDataIntegrityParams { - return &CheckDataIntegrityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCheckDataIntegrityParamsWithTimeout creates a new CheckDataIntegrityParams object -// with the ability to set a timeout on a request. -func NewCheckDataIntegrityParamsWithTimeout(timeout time.Duration) *CheckDataIntegrityParams { - return &CheckDataIntegrityParams{ - timeout: timeout, - } -} - -// NewCheckDataIntegrityParamsWithContext creates a new CheckDataIntegrityParams object -// with the ability to set a context for a request. -func NewCheckDataIntegrityParamsWithContext(ctx context.Context) *CheckDataIntegrityParams { - return &CheckDataIntegrityParams{ - Context: ctx, - } -} - -// NewCheckDataIntegrityParamsWithHTTPClient creates a new CheckDataIntegrityParams object -// with the ability to set a custom HTTPClient for a request. -func NewCheckDataIntegrityParamsWithHTTPClient(client *http.Client) *CheckDataIntegrityParams { - return &CheckDataIntegrityParams{ - HTTPClient: client, - } -} - -/* CheckDataIntegrityParams contains all the parameters to send to the API endpoint - for the check data integrity operation. - - Typically these are written to a http.Request. -*/ -type CheckDataIntegrityParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the check data integrity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CheckDataIntegrityParams) WithDefaults() *CheckDataIntegrityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the check data integrity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CheckDataIntegrityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the check data integrity params -func (o *CheckDataIntegrityParams) WithTimeout(timeout time.Duration) *CheckDataIntegrityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the check data integrity params -func (o *CheckDataIntegrityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the check data integrity params -func (o *CheckDataIntegrityParams) WithContext(ctx context.Context) *CheckDataIntegrityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the check data integrity params -func (o *CheckDataIntegrityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the check data integrity params -func (o *CheckDataIntegrityParams) WithHTTPClient(client *http.Client) *CheckDataIntegrityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the check data integrity params -func (o *CheckDataIntegrityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *CheckDataIntegrityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/database/check_data_integrity_responses.go b/rest_management_api_client/database/check_data_integrity_responses.go deleted file mode 100644 index 9fa03499f..000000000 --- a/rest_management_api_client/database/check_data_integrity_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CheckDataIntegrityReader is a Reader for the CheckDataIntegrity structure. -type CheckDataIntegrityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CheckDataIntegrityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewCheckDataIntegrityAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCheckDataIntegrityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewCheckDataIntegrityTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCheckDataIntegrityAccepted creates a CheckDataIntegrityAccepted with default headers values -func NewCheckDataIntegrityAccepted() *CheckDataIntegrityAccepted { - return &CheckDataIntegrityAccepted{} -} - -/* CheckDataIntegrityAccepted describes a response with status code 202, with default header values. - -Base empty response -*/ -type CheckDataIntegrityAccepted struct { - Payload *rest_model.Empty -} - -func (o *CheckDataIntegrityAccepted) Error() string { - return fmt.Sprintf("[POST /database/check-data-integrity][%d] checkDataIntegrityAccepted %+v", 202, o.Payload) -} -func (o *CheckDataIntegrityAccepted) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *CheckDataIntegrityAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCheckDataIntegrityUnauthorized creates a CheckDataIntegrityUnauthorized with default headers values -func NewCheckDataIntegrityUnauthorized() *CheckDataIntegrityUnauthorized { - return &CheckDataIntegrityUnauthorized{} -} - -/* CheckDataIntegrityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CheckDataIntegrityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CheckDataIntegrityUnauthorized) Error() string { - return fmt.Sprintf("[POST /database/check-data-integrity][%d] checkDataIntegrityUnauthorized %+v", 401, o.Payload) -} -func (o *CheckDataIntegrityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CheckDataIntegrityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCheckDataIntegrityTooManyRequests creates a CheckDataIntegrityTooManyRequests with default headers values -func NewCheckDataIntegrityTooManyRequests() *CheckDataIntegrityTooManyRequests { - return &CheckDataIntegrityTooManyRequests{} -} - -/* CheckDataIntegrityTooManyRequests describes a response with status code 429, with default header values. - -The resource requested is rate limited and the rate limit has been exceeded -*/ -type CheckDataIntegrityTooManyRequests struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CheckDataIntegrityTooManyRequests) Error() string { - return fmt.Sprintf("[POST /database/check-data-integrity][%d] checkDataIntegrityTooManyRequests %+v", 429, o.Payload) -} -func (o *CheckDataIntegrityTooManyRequests) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CheckDataIntegrityTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/database/create_database_snapshot_parameters.go b/rest_management_api_client/database/create_database_snapshot_parameters.go deleted file mode 100644 index 88526af8f..000000000 --- a/rest_management_api_client/database/create_database_snapshot_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateDatabaseSnapshotParams creates a new CreateDatabaseSnapshotParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateDatabaseSnapshotParams() *CreateDatabaseSnapshotParams { - return &CreateDatabaseSnapshotParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateDatabaseSnapshotParamsWithTimeout creates a new CreateDatabaseSnapshotParams object -// with the ability to set a timeout on a request. -func NewCreateDatabaseSnapshotParamsWithTimeout(timeout time.Duration) *CreateDatabaseSnapshotParams { - return &CreateDatabaseSnapshotParams{ - timeout: timeout, - } -} - -// NewCreateDatabaseSnapshotParamsWithContext creates a new CreateDatabaseSnapshotParams object -// with the ability to set a context for a request. -func NewCreateDatabaseSnapshotParamsWithContext(ctx context.Context) *CreateDatabaseSnapshotParams { - return &CreateDatabaseSnapshotParams{ - Context: ctx, - } -} - -// NewCreateDatabaseSnapshotParamsWithHTTPClient creates a new CreateDatabaseSnapshotParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateDatabaseSnapshotParamsWithHTTPClient(client *http.Client) *CreateDatabaseSnapshotParams { - return &CreateDatabaseSnapshotParams{ - HTTPClient: client, - } -} - -/* CreateDatabaseSnapshotParams contains all the parameters to send to the API endpoint - for the create database snapshot operation. - - Typically these are written to a http.Request. -*/ -type CreateDatabaseSnapshotParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create database snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateDatabaseSnapshotParams) WithDefaults() *CreateDatabaseSnapshotParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create database snapshot params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateDatabaseSnapshotParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create database snapshot params -func (o *CreateDatabaseSnapshotParams) WithTimeout(timeout time.Duration) *CreateDatabaseSnapshotParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create database snapshot params -func (o *CreateDatabaseSnapshotParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create database snapshot params -func (o *CreateDatabaseSnapshotParams) WithContext(ctx context.Context) *CreateDatabaseSnapshotParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create database snapshot params -func (o *CreateDatabaseSnapshotParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create database snapshot params -func (o *CreateDatabaseSnapshotParams) WithHTTPClient(client *http.Client) *CreateDatabaseSnapshotParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create database snapshot params -func (o *CreateDatabaseSnapshotParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateDatabaseSnapshotParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/database/create_database_snapshot_responses.go b/rest_management_api_client/database/create_database_snapshot_responses.go deleted file mode 100644 index 5ebba90f8..000000000 --- a/rest_management_api_client/database/create_database_snapshot_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateDatabaseSnapshotReader is a Reader for the CreateDatabaseSnapshot structure. -type CreateDatabaseSnapshotReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateDatabaseSnapshotReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateDatabaseSnapshotOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCreateDatabaseSnapshotUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewCreateDatabaseSnapshotTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateDatabaseSnapshotOK creates a CreateDatabaseSnapshotOK with default headers values -func NewCreateDatabaseSnapshotOK() *CreateDatabaseSnapshotOK { - return &CreateDatabaseSnapshotOK{} -} - -/* CreateDatabaseSnapshotOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type CreateDatabaseSnapshotOK struct { - Payload *rest_model.Empty -} - -func (o *CreateDatabaseSnapshotOK) Error() string { - return fmt.Sprintf("[POST /database/snapshot][%d] createDatabaseSnapshotOK %+v", 200, o.Payload) -} -func (o *CreateDatabaseSnapshotOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *CreateDatabaseSnapshotOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateDatabaseSnapshotUnauthorized creates a CreateDatabaseSnapshotUnauthorized with default headers values -func NewCreateDatabaseSnapshotUnauthorized() *CreateDatabaseSnapshotUnauthorized { - return &CreateDatabaseSnapshotUnauthorized{} -} - -/* CreateDatabaseSnapshotUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateDatabaseSnapshotUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateDatabaseSnapshotUnauthorized) Error() string { - return fmt.Sprintf("[POST /database/snapshot][%d] createDatabaseSnapshotUnauthorized %+v", 401, o.Payload) -} -func (o *CreateDatabaseSnapshotUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateDatabaseSnapshotUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateDatabaseSnapshotTooManyRequests creates a CreateDatabaseSnapshotTooManyRequests with default headers values -func NewCreateDatabaseSnapshotTooManyRequests() *CreateDatabaseSnapshotTooManyRequests { - return &CreateDatabaseSnapshotTooManyRequests{} -} - -/* CreateDatabaseSnapshotTooManyRequests describes a response with status code 429, with default header values. - -The resource requested is rate limited and the rate limit has been exceeded -*/ -type CreateDatabaseSnapshotTooManyRequests struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateDatabaseSnapshotTooManyRequests) Error() string { - return fmt.Sprintf("[POST /database/snapshot][%d] createDatabaseSnapshotTooManyRequests %+v", 429, o.Payload) -} -func (o *CreateDatabaseSnapshotTooManyRequests) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateDatabaseSnapshotTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/database/data_integrity_results_parameters.go b/rest_management_api_client/database/data_integrity_results_parameters.go deleted file mode 100644 index 801fdffc9..000000000 --- a/rest_management_api_client/database/data_integrity_results_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDataIntegrityResultsParams creates a new DataIntegrityResultsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDataIntegrityResultsParams() *DataIntegrityResultsParams { - return &DataIntegrityResultsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDataIntegrityResultsParamsWithTimeout creates a new DataIntegrityResultsParams object -// with the ability to set a timeout on a request. -func NewDataIntegrityResultsParamsWithTimeout(timeout time.Duration) *DataIntegrityResultsParams { - return &DataIntegrityResultsParams{ - timeout: timeout, - } -} - -// NewDataIntegrityResultsParamsWithContext creates a new DataIntegrityResultsParams object -// with the ability to set a context for a request. -func NewDataIntegrityResultsParamsWithContext(ctx context.Context) *DataIntegrityResultsParams { - return &DataIntegrityResultsParams{ - Context: ctx, - } -} - -// NewDataIntegrityResultsParamsWithHTTPClient creates a new DataIntegrityResultsParams object -// with the ability to set a custom HTTPClient for a request. -func NewDataIntegrityResultsParamsWithHTTPClient(client *http.Client) *DataIntegrityResultsParams { - return &DataIntegrityResultsParams{ - HTTPClient: client, - } -} - -/* DataIntegrityResultsParams contains all the parameters to send to the API endpoint - for the data integrity results operation. - - Typically these are written to a http.Request. -*/ -type DataIntegrityResultsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the data integrity results params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DataIntegrityResultsParams) WithDefaults() *DataIntegrityResultsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the data integrity results params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DataIntegrityResultsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the data integrity results params -func (o *DataIntegrityResultsParams) WithTimeout(timeout time.Duration) *DataIntegrityResultsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the data integrity results params -func (o *DataIntegrityResultsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the data integrity results params -func (o *DataIntegrityResultsParams) WithContext(ctx context.Context) *DataIntegrityResultsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the data integrity results params -func (o *DataIntegrityResultsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the data integrity results params -func (o *DataIntegrityResultsParams) WithHTTPClient(client *http.Client) *DataIntegrityResultsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the data integrity results params -func (o *DataIntegrityResultsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *DataIntegrityResultsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/database/data_integrity_results_responses.go b/rest_management_api_client/database/data_integrity_results_responses.go deleted file mode 100644 index 599756f88..000000000 --- a/rest_management_api_client/database/data_integrity_results_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DataIntegrityResultsReader is a Reader for the DataIntegrityResults structure. -type DataIntegrityResultsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DataIntegrityResultsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDataIntegrityResultsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDataIntegrityResultsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDataIntegrityResultsOK creates a DataIntegrityResultsOK with default headers values -func NewDataIntegrityResultsOK() *DataIntegrityResultsOK { - return &DataIntegrityResultsOK{} -} - -/* DataIntegrityResultsOK describes a response with status code 200, with default header values. - -A list of data integrity issues found -*/ -type DataIntegrityResultsOK struct { - Payload *rest_model.DataIntegrityCheckResultEnvelope -} - -func (o *DataIntegrityResultsOK) Error() string { - return fmt.Sprintf("[GET /database/data-integrity-results][%d] dataIntegrityResultsOK %+v", 200, o.Payload) -} -func (o *DataIntegrityResultsOK) GetPayload() *rest_model.DataIntegrityCheckResultEnvelope { - return o.Payload -} - -func (o *DataIntegrityResultsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DataIntegrityCheckResultEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDataIntegrityResultsUnauthorized creates a DataIntegrityResultsUnauthorized with default headers values -func NewDataIntegrityResultsUnauthorized() *DataIntegrityResultsUnauthorized { - return &DataIntegrityResultsUnauthorized{} -} - -/* DataIntegrityResultsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DataIntegrityResultsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DataIntegrityResultsUnauthorized) Error() string { - return fmt.Sprintf("[GET /database/data-integrity-results][%d] dataIntegrityResultsUnauthorized %+v", 401, o.Payload) -} -func (o *DataIntegrityResultsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DataIntegrityResultsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/database/database_client.go b/rest_management_api_client/database/database_client.go deleted file mode 100644 index 609a948d4..000000000 --- a/rest_management_api_client/database/database_client.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new database API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for database API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CheckDataIntegrity(params *CheckDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckDataIntegrityAccepted, error) - - CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateDatabaseSnapshotOK, error) - - DataIntegrityResults(params *DataIntegrityResultsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DataIntegrityResultsOK, error) - - FixDataIntegrity(params *FixDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*FixDataIntegrityAccepted, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CheckDataIntegrity starts a data integrity scan on the datastore - - Starts a data integrity scan on the datastore. Requires admin access. Only once instance may run at a time, including runs of fixDataIntegrity. -*/ -func (a *Client) CheckDataIntegrity(params *CheckDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CheckDataIntegrityAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCheckDataIntegrityParams() - } - op := &runtime.ClientOperation{ - ID: "checkDataIntegrity", - Method: "POST", - PathPattern: "/database/check-data-integrity", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CheckDataIntegrityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CheckDataIntegrityAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for checkDataIntegrity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateDatabaseSnapshot creates a new database snapshot - - Create a new database snapshot. Requires admin access. -*/ -func (a *Client) CreateDatabaseSnapshot(params *CreateDatabaseSnapshotParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateDatabaseSnapshotOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateDatabaseSnapshotParams() - } - op := &runtime.ClientOperation{ - ID: "createDatabaseSnapshot", - Method: "POST", - PathPattern: "/database/snapshot", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateDatabaseSnapshotReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateDatabaseSnapshotOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createDatabaseSnapshot: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DataIntegrityResults returns any results found from in progress integrity checks - - Returns any results found from in-progress integrity checks. Requires admin access. -*/ -func (a *Client) DataIntegrityResults(params *DataIntegrityResultsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DataIntegrityResultsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDataIntegrityResultsParams() - } - op := &runtime.ClientOperation{ - ID: "dataIntegrityResults", - Method: "GET", - PathPattern: "/database/data-integrity-results", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DataIntegrityResultsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DataIntegrityResultsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for dataIntegrityResults: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - FixDataIntegrity runs a data integrity scan on the datastore attempts to fix any issues it can and returns any found issues - - Runs a data integrity scan on the datastore, attempts to fix any issues it can, and returns any found issues. Requires admin access. Only once instance may run at a time, including runs of checkDataIntegrity. -*/ -func (a *Client) FixDataIntegrity(params *FixDataIntegrityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*FixDataIntegrityAccepted, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewFixDataIntegrityParams() - } - op := &runtime.ClientOperation{ - ID: "fixDataIntegrity", - Method: "POST", - PathPattern: "/database/fix-data-integrity", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &FixDataIntegrityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*FixDataIntegrityAccepted) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for fixDataIntegrity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/database/fix_data_integrity_parameters.go b/rest_management_api_client/database/fix_data_integrity_parameters.go deleted file mode 100644 index 2adbd1228..000000000 --- a/rest_management_api_client/database/fix_data_integrity_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewFixDataIntegrityParams creates a new FixDataIntegrityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewFixDataIntegrityParams() *FixDataIntegrityParams { - return &FixDataIntegrityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewFixDataIntegrityParamsWithTimeout creates a new FixDataIntegrityParams object -// with the ability to set a timeout on a request. -func NewFixDataIntegrityParamsWithTimeout(timeout time.Duration) *FixDataIntegrityParams { - return &FixDataIntegrityParams{ - timeout: timeout, - } -} - -// NewFixDataIntegrityParamsWithContext creates a new FixDataIntegrityParams object -// with the ability to set a context for a request. -func NewFixDataIntegrityParamsWithContext(ctx context.Context) *FixDataIntegrityParams { - return &FixDataIntegrityParams{ - Context: ctx, - } -} - -// NewFixDataIntegrityParamsWithHTTPClient creates a new FixDataIntegrityParams object -// with the ability to set a custom HTTPClient for a request. -func NewFixDataIntegrityParamsWithHTTPClient(client *http.Client) *FixDataIntegrityParams { - return &FixDataIntegrityParams{ - HTTPClient: client, - } -} - -/* FixDataIntegrityParams contains all the parameters to send to the API endpoint - for the fix data integrity operation. - - Typically these are written to a http.Request. -*/ -type FixDataIntegrityParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the fix data integrity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *FixDataIntegrityParams) WithDefaults() *FixDataIntegrityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the fix data integrity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *FixDataIntegrityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the fix data integrity params -func (o *FixDataIntegrityParams) WithTimeout(timeout time.Duration) *FixDataIntegrityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the fix data integrity params -func (o *FixDataIntegrityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the fix data integrity params -func (o *FixDataIntegrityParams) WithContext(ctx context.Context) *FixDataIntegrityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the fix data integrity params -func (o *FixDataIntegrityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the fix data integrity params -func (o *FixDataIntegrityParams) WithHTTPClient(client *http.Client) *FixDataIntegrityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the fix data integrity params -func (o *FixDataIntegrityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *FixDataIntegrityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/database/fix_data_integrity_responses.go b/rest_management_api_client/database/fix_data_integrity_responses.go deleted file mode 100644 index 8d1857ee3..000000000 --- a/rest_management_api_client/database/fix_data_integrity_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// FixDataIntegrityReader is a Reader for the FixDataIntegrity structure. -type FixDataIntegrityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *FixDataIntegrityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 202: - result := NewFixDataIntegrityAccepted() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewFixDataIntegrityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 429: - result := NewFixDataIntegrityTooManyRequests() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewFixDataIntegrityAccepted creates a FixDataIntegrityAccepted with default headers values -func NewFixDataIntegrityAccepted() *FixDataIntegrityAccepted { - return &FixDataIntegrityAccepted{} -} - -/* FixDataIntegrityAccepted describes a response with status code 202, with default header values. - -Base empty response -*/ -type FixDataIntegrityAccepted struct { - Payload *rest_model.Empty -} - -func (o *FixDataIntegrityAccepted) Error() string { - return fmt.Sprintf("[POST /database/fix-data-integrity][%d] fixDataIntegrityAccepted %+v", 202, o.Payload) -} -func (o *FixDataIntegrityAccepted) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *FixDataIntegrityAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewFixDataIntegrityUnauthorized creates a FixDataIntegrityUnauthorized with default headers values -func NewFixDataIntegrityUnauthorized() *FixDataIntegrityUnauthorized { - return &FixDataIntegrityUnauthorized{} -} - -/* FixDataIntegrityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type FixDataIntegrityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *FixDataIntegrityUnauthorized) Error() string { - return fmt.Sprintf("[POST /database/fix-data-integrity][%d] fixDataIntegrityUnauthorized %+v", 401, o.Payload) -} -func (o *FixDataIntegrityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *FixDataIntegrityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewFixDataIntegrityTooManyRequests creates a FixDataIntegrityTooManyRequests with default headers values -func NewFixDataIntegrityTooManyRequests() *FixDataIntegrityTooManyRequests { - return &FixDataIntegrityTooManyRequests{} -} - -/* FixDataIntegrityTooManyRequests describes a response with status code 429, with default header values. - -The resource requested is rate limited and the rate limit has been exceeded -*/ -type FixDataIntegrityTooManyRequests struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *FixDataIntegrityTooManyRequests) Error() string { - return fmt.Sprintf("[POST /database/fix-data-integrity][%d] fixDataIntegrityTooManyRequests %+v", 429, o.Payload) -} -func (o *FixDataIntegrityTooManyRequests) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *FixDataIntegrityTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/create_edge_router_parameters.go b/rest_management_api_client/edge_router/create_edge_router_parameters.go deleted file mode 100644 index 4d2ad1cb2..000000000 --- a/rest_management_api_client/edge_router/create_edge_router_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateEdgeRouterParams creates a new CreateEdgeRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateEdgeRouterParams() *CreateEdgeRouterParams { - return &CreateEdgeRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateEdgeRouterParamsWithTimeout creates a new CreateEdgeRouterParams object -// with the ability to set a timeout on a request. -func NewCreateEdgeRouterParamsWithTimeout(timeout time.Duration) *CreateEdgeRouterParams { - return &CreateEdgeRouterParams{ - timeout: timeout, - } -} - -// NewCreateEdgeRouterParamsWithContext creates a new CreateEdgeRouterParams object -// with the ability to set a context for a request. -func NewCreateEdgeRouterParamsWithContext(ctx context.Context) *CreateEdgeRouterParams { - return &CreateEdgeRouterParams{ - Context: ctx, - } -} - -// NewCreateEdgeRouterParamsWithHTTPClient creates a new CreateEdgeRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateEdgeRouterParamsWithHTTPClient(client *http.Client) *CreateEdgeRouterParams { - return &CreateEdgeRouterParams{ - HTTPClient: client, - } -} - -/* CreateEdgeRouterParams contains all the parameters to send to the API endpoint - for the create edge router operation. - - Typically these are written to a http.Request. -*/ -type CreateEdgeRouterParams struct { - - /* EdgeRouter. - - A edge router to create - */ - EdgeRouter *rest_model.EdgeRouterCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEdgeRouterParams) WithDefaults() *CreateEdgeRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEdgeRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create edge router params -func (o *CreateEdgeRouterParams) WithTimeout(timeout time.Duration) *CreateEdgeRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create edge router params -func (o *CreateEdgeRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create edge router params -func (o *CreateEdgeRouterParams) WithContext(ctx context.Context) *CreateEdgeRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create edge router params -func (o *CreateEdgeRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create edge router params -func (o *CreateEdgeRouterParams) WithHTTPClient(client *http.Client) *CreateEdgeRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create edge router params -func (o *CreateEdgeRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithEdgeRouter adds the edgeRouter to the create edge router params -func (o *CreateEdgeRouterParams) WithEdgeRouter(edgeRouter *rest_model.EdgeRouterCreate) *CreateEdgeRouterParams { - o.SetEdgeRouter(edgeRouter) - return o -} - -// SetEdgeRouter adds the edgeRouter to the create edge router params -func (o *CreateEdgeRouterParams) SetEdgeRouter(edgeRouter *rest_model.EdgeRouterCreate) { - o.EdgeRouter = edgeRouter -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.EdgeRouter != nil { - if err := r.SetBodyParam(o.EdgeRouter); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/create_edge_router_responses.go b/rest_management_api_client/edge_router/create_edge_router_responses.go deleted file mode 100644 index e148309cf..000000000 --- a/rest_management_api_client/edge_router/create_edge_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateEdgeRouterReader is a Reader for the CreateEdgeRouter structure. -type CreateEdgeRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateEdgeRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateEdgeRouterCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateEdgeRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateEdgeRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateEdgeRouterCreated creates a CreateEdgeRouterCreated with default headers values -func NewCreateEdgeRouterCreated() *CreateEdgeRouterCreated { - return &CreateEdgeRouterCreated{} -} - -/* CreateEdgeRouterCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateEdgeRouterCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateEdgeRouterCreated) Error() string { - return fmt.Sprintf("[POST /edge-routers][%d] createEdgeRouterCreated %+v", 201, o.Payload) -} -func (o *CreateEdgeRouterCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateEdgeRouterCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEdgeRouterBadRequest creates a CreateEdgeRouterBadRequest with default headers values -func NewCreateEdgeRouterBadRequest() *CreateEdgeRouterBadRequest { - return &CreateEdgeRouterBadRequest{} -} - -/* CreateEdgeRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateEdgeRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEdgeRouterBadRequest) Error() string { - return fmt.Sprintf("[POST /edge-routers][%d] createEdgeRouterBadRequest %+v", 400, o.Payload) -} -func (o *CreateEdgeRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEdgeRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEdgeRouterUnauthorized creates a CreateEdgeRouterUnauthorized with default headers values -func NewCreateEdgeRouterUnauthorized() *CreateEdgeRouterUnauthorized { - return &CreateEdgeRouterUnauthorized{} -} - -/* CreateEdgeRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateEdgeRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEdgeRouterUnauthorized) Error() string { - return fmt.Sprintf("[POST /edge-routers][%d] createEdgeRouterUnauthorized %+v", 401, o.Payload) -} -func (o *CreateEdgeRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEdgeRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/delete_edge_router_parameters.go b/rest_management_api_client/edge_router/delete_edge_router_parameters.go deleted file mode 100644 index da2166597..000000000 --- a/rest_management_api_client/edge_router/delete_edge_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEdgeRouterParams creates a new DeleteEdgeRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteEdgeRouterParams() *DeleteEdgeRouterParams { - return &DeleteEdgeRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteEdgeRouterParamsWithTimeout creates a new DeleteEdgeRouterParams object -// with the ability to set a timeout on a request. -func NewDeleteEdgeRouterParamsWithTimeout(timeout time.Duration) *DeleteEdgeRouterParams { - return &DeleteEdgeRouterParams{ - timeout: timeout, - } -} - -// NewDeleteEdgeRouterParamsWithContext creates a new DeleteEdgeRouterParams object -// with the ability to set a context for a request. -func NewDeleteEdgeRouterParamsWithContext(ctx context.Context) *DeleteEdgeRouterParams { - return &DeleteEdgeRouterParams{ - Context: ctx, - } -} - -// NewDeleteEdgeRouterParamsWithHTTPClient creates a new DeleteEdgeRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteEdgeRouterParamsWithHTTPClient(client *http.Client) *DeleteEdgeRouterParams { - return &DeleteEdgeRouterParams{ - HTTPClient: client, - } -} - -/* DeleteEdgeRouterParams contains all the parameters to send to the API endpoint - for the delete edge router operation. - - Typically these are written to a http.Request. -*/ -type DeleteEdgeRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEdgeRouterParams) WithDefaults() *DeleteEdgeRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEdgeRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete edge router params -func (o *DeleteEdgeRouterParams) WithTimeout(timeout time.Duration) *DeleteEdgeRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete edge router params -func (o *DeleteEdgeRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete edge router params -func (o *DeleteEdgeRouterParams) WithContext(ctx context.Context) *DeleteEdgeRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete edge router params -func (o *DeleteEdgeRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete edge router params -func (o *DeleteEdgeRouterParams) WithHTTPClient(client *http.Client) *DeleteEdgeRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete edge router params -func (o *DeleteEdgeRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete edge router params -func (o *DeleteEdgeRouterParams) WithID(id string) *DeleteEdgeRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete edge router params -func (o *DeleteEdgeRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/delete_edge_router_responses.go b/rest_management_api_client/edge_router/delete_edge_router_responses.go deleted file mode 100644 index 763006329..000000000 --- a/rest_management_api_client/edge_router/delete_edge_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteEdgeRouterReader is a Reader for the DeleteEdgeRouter structure. -type DeleteEdgeRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteEdgeRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteEdgeRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteEdgeRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteEdgeRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteEdgeRouterConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteEdgeRouterOK creates a DeleteEdgeRouterOK with default headers values -func NewDeleteEdgeRouterOK() *DeleteEdgeRouterOK { - return &DeleteEdgeRouterOK{} -} - -/* DeleteEdgeRouterOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteEdgeRouterOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteEdgeRouterOK) Error() string { - return fmt.Sprintf("[DELETE /edge-routers/{id}][%d] deleteEdgeRouterOK %+v", 200, o.Payload) -} -func (o *DeleteEdgeRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteEdgeRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEdgeRouterBadRequest creates a DeleteEdgeRouterBadRequest with default headers values -func NewDeleteEdgeRouterBadRequest() *DeleteEdgeRouterBadRequest { - return &DeleteEdgeRouterBadRequest{} -} - -/* DeleteEdgeRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteEdgeRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEdgeRouterBadRequest) Error() string { - return fmt.Sprintf("[DELETE /edge-routers/{id}][%d] deleteEdgeRouterBadRequest %+v", 400, o.Payload) -} -func (o *DeleteEdgeRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEdgeRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEdgeRouterUnauthorized creates a DeleteEdgeRouterUnauthorized with default headers values -func NewDeleteEdgeRouterUnauthorized() *DeleteEdgeRouterUnauthorized { - return &DeleteEdgeRouterUnauthorized{} -} - -/* DeleteEdgeRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteEdgeRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEdgeRouterUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /edge-routers/{id}][%d] deleteEdgeRouterUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteEdgeRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEdgeRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEdgeRouterConflict creates a DeleteEdgeRouterConflict with default headers values -func NewDeleteEdgeRouterConflict() *DeleteEdgeRouterConflict { - return &DeleteEdgeRouterConflict{} -} - -/* DeleteEdgeRouterConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteEdgeRouterConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEdgeRouterConflict) Error() string { - return fmt.Sprintf("[DELETE /edge-routers/{id}][%d] deleteEdgeRouterConflict %+v", 409, o.Payload) -} -func (o *DeleteEdgeRouterConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEdgeRouterConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/detail_edge_router_parameters.go b/rest_management_api_client/edge_router/detail_edge_router_parameters.go deleted file mode 100644 index 240306b46..000000000 --- a/rest_management_api_client/edge_router/detail_edge_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailEdgeRouterParams creates a new DetailEdgeRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailEdgeRouterParams() *DetailEdgeRouterParams { - return &DetailEdgeRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailEdgeRouterParamsWithTimeout creates a new DetailEdgeRouterParams object -// with the ability to set a timeout on a request. -func NewDetailEdgeRouterParamsWithTimeout(timeout time.Duration) *DetailEdgeRouterParams { - return &DetailEdgeRouterParams{ - timeout: timeout, - } -} - -// NewDetailEdgeRouterParamsWithContext creates a new DetailEdgeRouterParams object -// with the ability to set a context for a request. -func NewDetailEdgeRouterParamsWithContext(ctx context.Context) *DetailEdgeRouterParams { - return &DetailEdgeRouterParams{ - Context: ctx, - } -} - -// NewDetailEdgeRouterParamsWithHTTPClient creates a new DetailEdgeRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailEdgeRouterParamsWithHTTPClient(client *http.Client) *DetailEdgeRouterParams { - return &DetailEdgeRouterParams{ - HTTPClient: client, - } -} - -/* DetailEdgeRouterParams contains all the parameters to send to the API endpoint - for the detail edge router operation. - - Typically these are written to a http.Request. -*/ -type DetailEdgeRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailEdgeRouterParams) WithDefaults() *DetailEdgeRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailEdgeRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail edge router params -func (o *DetailEdgeRouterParams) WithTimeout(timeout time.Duration) *DetailEdgeRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail edge router params -func (o *DetailEdgeRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail edge router params -func (o *DetailEdgeRouterParams) WithContext(ctx context.Context) *DetailEdgeRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail edge router params -func (o *DetailEdgeRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail edge router params -func (o *DetailEdgeRouterParams) WithHTTPClient(client *http.Client) *DetailEdgeRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail edge router params -func (o *DetailEdgeRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail edge router params -func (o *DetailEdgeRouterParams) WithID(id string) *DetailEdgeRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail edge router params -func (o *DetailEdgeRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/detail_edge_router_responses.go b/rest_management_api_client/edge_router/detail_edge_router_responses.go deleted file mode 100644 index ef08b0db9..000000000 --- a/rest_management_api_client/edge_router/detail_edge_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailEdgeRouterReader is a Reader for the DetailEdgeRouter structure. -type DetailEdgeRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailEdgeRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailEdgeRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailEdgeRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailEdgeRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailEdgeRouterOK creates a DetailEdgeRouterOK with default headers values -func NewDetailEdgeRouterOK() *DetailEdgeRouterOK { - return &DetailEdgeRouterOK{} -} - -/* DetailEdgeRouterOK describes a response with status code 200, with default header values. - -A singular edge router resource -*/ -type DetailEdgeRouterOK struct { - Payload *rest_model.DetailedEdgeRouterEnvelope -} - -func (o *DetailEdgeRouterOK) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}][%d] detailEdgeRouterOK %+v", 200, o.Payload) -} -func (o *DetailEdgeRouterOK) GetPayload() *rest_model.DetailedEdgeRouterEnvelope { - return o.Payload -} - -func (o *DetailEdgeRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailedEdgeRouterEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailEdgeRouterUnauthorized creates a DetailEdgeRouterUnauthorized with default headers values -func NewDetailEdgeRouterUnauthorized() *DetailEdgeRouterUnauthorized { - return &DetailEdgeRouterUnauthorized{} -} - -/* DetailEdgeRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailEdgeRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailEdgeRouterUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}][%d] detailEdgeRouterUnauthorized %+v", 401, o.Payload) -} -func (o *DetailEdgeRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailEdgeRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailEdgeRouterNotFound creates a DetailEdgeRouterNotFound with default headers values -func NewDetailEdgeRouterNotFound() *DetailEdgeRouterNotFound { - return &DetailEdgeRouterNotFound{} -} - -/* DetailEdgeRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailEdgeRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailEdgeRouterNotFound) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}][%d] detailEdgeRouterNotFound %+v", 404, o.Payload) -} -func (o *DetailEdgeRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailEdgeRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/edge_router_client.go b/rest_management_api_client/edge_router/edge_router_client.go deleted file mode 100644 index b9636e94f..000000000 --- a/rest_management_api_client/edge_router/edge_router_client.go +++ /dev/null @@ -1,545 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new edge router API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for edge router API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterCreated, error) - - DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterOK, error) - - DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterOK, error) - - ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterEdgeRouterPoliciesOK, error) - - ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterIdentitiesOK, error) - - ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) - - ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServicesOK, error) - - ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRoutersOK, error) - - PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterOK, error) - - ReEnrollEdgeRouter(params *ReEnrollEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollEdgeRouterOK, error) - - UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateEdgeRouter creates an edge router - - Create a edge router resource. Requires admin access. -*/ -func (a *Client) CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateEdgeRouterParams() - } - op := &runtime.ClientOperation{ - ID: "createEdgeRouter", - Method: "POST", - PathPattern: "/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateEdgeRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateEdgeRouterCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteEdgeRouter deletes an edge router - - Delete an edge router by id. Requires admin access. -*/ -func (a *Client) DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteEdgeRouterParams() - } - op := &runtime.ClientOperation{ - ID: "deleteEdgeRouter", - Method: "DELETE", - PathPattern: "/edge-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteEdgeRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteEdgeRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailEdgeRouter retrieves a single edge router - - Retrieves a single edge router by id. Requires admin access. -*/ -func (a *Client) DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailEdgeRouterParams() - } - op := &runtime.ClientOperation{ - ID: "detailEdgeRouter", - Method: "GET", - PathPattern: "/edge-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailEdgeRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailEdgeRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterEdgeRouterPolicies lists the edge router policies that affect an edge router - - Retrieves a list of edge router policies that apply to the specified edge router. -*/ -func (a *Client) ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterEdgeRouterPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterEdgeRouterPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterEdgeRouterPolicies", - Method: "GET", - PathPattern: "/edge-routers/{id}/edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterEdgeRouterPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterEdgeRouterPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterIdentities lists associated identities - - Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterIdentitiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterIdentitiesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterIdentities", - Method: "GET", - PathPattern: "/edge-routers/{id}/identities", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterIdentitiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterIdentitiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterServiceEdgeRouterPolicies lists the service policies that affect an edge router - - Retrieves a list of service policies policies that apply to the specified edge router. -*/ -func (a *Client) ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterServiceEdgeRouterPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterServiceEdgeRouterPolicies", - Method: "GET", - PathPattern: "/edge-routers/{id}/service-edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterServiceEdgeRouterPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterServiceEdgeRouterPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterServiceEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterServices lists associated services - - Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterServicesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterServices", - Method: "GET", - PathPattern: "/edge-routers/{id}/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouters lists edge routers - - Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouters", - Method: "GET", - PathPattern: "/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchEdgeRouter updates the supplied fields on an edge router - - Update the supplied fields on an edge router. Requires admin access. -*/ -func (a *Client) PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchEdgeRouterParams() - } - op := &runtime.ClientOperation{ - ID: "patchEdgeRouter", - Method: "PATCH", - PathPattern: "/edge-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchEdgeRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchEdgeRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ReEnrollEdgeRouter res enroll an edge router - - Removes current certificate based authentication mechanisms and reverts the edge router into a state where enrollment must be performed. -The router retains all other properties and associations. If the router is currently connected, it will be disconnected and any -attemps to reconnect will fail until the enrollment process is completed with the newly generated JWT. - -If the edge router has an existing outstanding enrollment JWT it will be replaced. The previous JWT will no longer be usable to -complete the enrollment process. - -*/ -func (a *Client) ReEnrollEdgeRouter(params *ReEnrollEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollEdgeRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewReEnrollEdgeRouterParams() - } - op := &runtime.ClientOperation{ - ID: "reEnrollEdgeRouter", - Method: "POST", - PathPattern: "/edge-routers/{id}/re-enroll", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ReEnrollEdgeRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ReEnrollEdgeRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for reEnrollEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateEdgeRouter updates all fields on an edge router - - Update all fields on an edge router by id. Requires admin access. -*/ -func (a *Client) UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateEdgeRouterParams() - } - op := &runtime.ClientOperation{ - ID: "updateEdgeRouter", - Method: "PUT", - PathPattern: "/edge-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateEdgeRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateEdgeRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/edge_router/list_edge_router_edge_router_policies_parameters.go b/rest_management_api_client/edge_router/list_edge_router_edge_router_policies_parameters.go deleted file mode 100644 index 91691680e..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_edge_router_policies_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterEdgeRouterPoliciesParams creates a new ListEdgeRouterEdgeRouterPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterEdgeRouterPoliciesParams() *ListEdgeRouterEdgeRouterPoliciesParams { - return &ListEdgeRouterEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterEdgeRouterPoliciesParamsWithTimeout creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterEdgeRouterPoliciesParams { - return &ListEdgeRouterEdgeRouterPoliciesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterEdgeRouterPoliciesParamsWithContext creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListEdgeRouterEdgeRouterPoliciesParams { - return &ListEdgeRouterEdgeRouterPoliciesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterEdgeRouterPoliciesParamsWithHTTPClient creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterEdgeRouterPoliciesParams { - return &ListEdgeRouterEdgeRouterPoliciesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterEdgeRouterPoliciesParams contains all the parameters to send to the API endpoint - for the list edge router edge router policies operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterEdgeRouterPoliciesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterEdgeRouterPoliciesParams) WithDefaults() *ListEdgeRouterEdgeRouterPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterEdgeRouterPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterEdgeRouterPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) WithContext(ctx context.Context) *ListEdgeRouterEdgeRouterPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterEdgeRouterPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) WithID(id string) *ListEdgeRouterEdgeRouterPoliciesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list edge router edge router policies params -func (o *ListEdgeRouterEdgeRouterPoliciesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_edge_router_policies_responses.go b/rest_management_api_client/edge_router/list_edge_router_edge_router_policies_responses.go deleted file mode 100644 index 5a8e974c3..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_edge_router_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterEdgeRouterPoliciesReader is a Reader for the ListEdgeRouterEdgeRouterPolicies structure. -type ListEdgeRouterEdgeRouterPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterEdgeRouterPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListEdgeRouterEdgeRouterPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListEdgeRouterEdgeRouterPoliciesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterEdgeRouterPoliciesOK creates a ListEdgeRouterEdgeRouterPoliciesOK with default headers values -func NewListEdgeRouterEdgeRouterPoliciesOK() *ListEdgeRouterEdgeRouterPoliciesOK { - return &ListEdgeRouterEdgeRouterPoliciesOK{} -} - -/* ListEdgeRouterEdgeRouterPoliciesOK describes a response with status code 200, with default header values. - -A list of edge router policies -*/ -type ListEdgeRouterEdgeRouterPoliciesOK struct { - Payload *rest_model.ListEdgeRouterPoliciesEnvelope -} - -func (o *ListEdgeRouterEdgeRouterPoliciesOK) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/edge-router-policies][%d] listEdgeRouterEdgeRouterPoliciesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterEdgeRouterPoliciesOK) GetPayload() *rest_model.ListEdgeRouterPoliciesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterEdgeRouterPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRouterPoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterEdgeRouterPoliciesUnauthorized creates a ListEdgeRouterEdgeRouterPoliciesUnauthorized with default headers values -func NewListEdgeRouterEdgeRouterPoliciesUnauthorized() *ListEdgeRouterEdgeRouterPoliciesUnauthorized { - return &ListEdgeRouterEdgeRouterPoliciesUnauthorized{} -} - -/* ListEdgeRouterEdgeRouterPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterEdgeRouterPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterEdgeRouterPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/edge-router-policies][%d] listEdgeRouterEdgeRouterPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterEdgeRouterPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterEdgeRouterPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterEdgeRouterPoliciesNotFound creates a ListEdgeRouterEdgeRouterPoliciesNotFound with default headers values -func NewListEdgeRouterEdgeRouterPoliciesNotFound() *ListEdgeRouterEdgeRouterPoliciesNotFound { - return &ListEdgeRouterEdgeRouterPoliciesNotFound{} -} - -/* ListEdgeRouterEdgeRouterPoliciesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListEdgeRouterEdgeRouterPoliciesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterEdgeRouterPoliciesNotFound) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/edge-router-policies][%d] listEdgeRouterEdgeRouterPoliciesNotFound %+v", 404, o.Payload) -} -func (o *ListEdgeRouterEdgeRouterPoliciesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterEdgeRouterPoliciesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_identities_parameters.go b/rest_management_api_client/edge_router/list_edge_router_identities_parameters.go deleted file mode 100644 index d1cf9ba78..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_identities_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterIdentitiesParams creates a new ListEdgeRouterIdentitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterIdentitiesParams() *ListEdgeRouterIdentitiesParams { - return &ListEdgeRouterIdentitiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterIdentitiesParamsWithTimeout creates a new ListEdgeRouterIdentitiesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterIdentitiesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterIdentitiesParams { - return &ListEdgeRouterIdentitiesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterIdentitiesParamsWithContext creates a new ListEdgeRouterIdentitiesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterIdentitiesParamsWithContext(ctx context.Context) *ListEdgeRouterIdentitiesParams { - return &ListEdgeRouterIdentitiesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterIdentitiesParamsWithHTTPClient creates a new ListEdgeRouterIdentitiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterIdentitiesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterIdentitiesParams { - return &ListEdgeRouterIdentitiesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterIdentitiesParams contains all the parameters to send to the API endpoint - for the list edge router identities operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterIdentitiesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterIdentitiesParams) WithDefaults() *ListEdgeRouterIdentitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterIdentitiesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterIdentitiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) WithContext(ctx context.Context) *ListEdgeRouterIdentitiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterIdentitiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) WithID(id string) *ListEdgeRouterIdentitiesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list edge router identities params -func (o *ListEdgeRouterIdentitiesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_identities_responses.go b/rest_management_api_client/edge_router/list_edge_router_identities_responses.go deleted file mode 100644 index cb2bbc1a0..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_identities_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterIdentitiesReader is a Reader for the ListEdgeRouterIdentities structure. -type ListEdgeRouterIdentitiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterIdentitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterIdentitiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListEdgeRouterIdentitiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListEdgeRouterIdentitiesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterIdentitiesOK creates a ListEdgeRouterIdentitiesOK with default headers values -func NewListEdgeRouterIdentitiesOK() *ListEdgeRouterIdentitiesOK { - return &ListEdgeRouterIdentitiesOK{} -} - -/* ListEdgeRouterIdentitiesOK describes a response with status code 200, with default header values. - -A list of identities -*/ -type ListEdgeRouterIdentitiesOK struct { - Payload *rest_model.ListIdentitiesEnvelope -} - -func (o *ListEdgeRouterIdentitiesOK) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/identities][%d] listEdgeRouterIdentitiesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterIdentitiesOK) GetPayload() *rest_model.ListIdentitiesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterIdentitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListIdentitiesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterIdentitiesUnauthorized creates a ListEdgeRouterIdentitiesUnauthorized with default headers values -func NewListEdgeRouterIdentitiesUnauthorized() *ListEdgeRouterIdentitiesUnauthorized { - return &ListEdgeRouterIdentitiesUnauthorized{} -} - -/* ListEdgeRouterIdentitiesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterIdentitiesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterIdentitiesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/identities][%d] listEdgeRouterIdentitiesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterIdentitiesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterIdentitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterIdentitiesNotFound creates a ListEdgeRouterIdentitiesNotFound with default headers values -func NewListEdgeRouterIdentitiesNotFound() *ListEdgeRouterIdentitiesNotFound { - return &ListEdgeRouterIdentitiesNotFound{} -} - -/* ListEdgeRouterIdentitiesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListEdgeRouterIdentitiesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterIdentitiesNotFound) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/identities][%d] listEdgeRouterIdentitiesNotFound %+v", 404, o.Payload) -} -func (o *ListEdgeRouterIdentitiesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterIdentitiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_parameters.go b/rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_parameters.go deleted file mode 100644 index f177fbf72..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterServiceEdgeRouterPoliciesParams creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterServiceEdgeRouterPoliciesParams() *ListEdgeRouterServiceEdgeRouterPoliciesParams { - return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithTimeout creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithContext creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithHTTPClient creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterServiceEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - return &ListEdgeRouterServiceEdgeRouterPoliciesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterServiceEdgeRouterPoliciesParams contains all the parameters to send to the API endpoint - for the list edge router service edge router policies operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router service edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) WithDefaults() *ListEdgeRouterServiceEdgeRouterPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router service edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) WithContext(ctx context.Context) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) WithID(id string) *ListEdgeRouterServiceEdgeRouterPoliciesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list edge router service edge router policies params -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_responses.go b/rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_responses.go deleted file mode 100644 index 250928755..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_service_edge_router_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterServiceEdgeRouterPoliciesReader is a Reader for the ListEdgeRouterServiceEdgeRouterPolicies structure. -type ListEdgeRouterServiceEdgeRouterPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterServiceEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterServiceEdgeRouterPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListEdgeRouterServiceEdgeRouterPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListEdgeRouterServiceEdgeRouterPoliciesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesOK creates a ListEdgeRouterServiceEdgeRouterPoliciesOK with default headers values -func NewListEdgeRouterServiceEdgeRouterPoliciesOK() *ListEdgeRouterServiceEdgeRouterPoliciesOK { - return &ListEdgeRouterServiceEdgeRouterPoliciesOK{} -} - -/* ListEdgeRouterServiceEdgeRouterPoliciesOK describes a response with status code 200, with default header values. - -A list of service policies -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesOK struct { - Payload *rest_model.ListServicePoliciesEnvelope -} - -func (o *ListEdgeRouterServiceEdgeRouterPoliciesOK) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/service-edge-router-policies][%d] listEdgeRouterServiceEdgeRouterPoliciesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterServiceEdgeRouterPoliciesOK) GetPayload() *rest_model.ListServicePoliciesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterServiceEdgeRouterPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicePoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesUnauthorized creates a ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized with default headers values -func NewListEdgeRouterServiceEdgeRouterPoliciesUnauthorized() *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized { - return &ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized{} -} - -/* ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/service-edge-router-policies][%d] listEdgeRouterServiceEdgeRouterPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesNotFound creates a ListEdgeRouterServiceEdgeRouterPoliciesNotFound with default headers values -func NewListEdgeRouterServiceEdgeRouterPoliciesNotFound() *ListEdgeRouterServiceEdgeRouterPoliciesNotFound { - return &ListEdgeRouterServiceEdgeRouterPoliciesNotFound{} -} - -/* ListEdgeRouterServiceEdgeRouterPoliciesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterServiceEdgeRouterPoliciesNotFound) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/service-edge-router-policies][%d] listEdgeRouterServiceEdgeRouterPoliciesNotFound %+v", 404, o.Payload) -} -func (o *ListEdgeRouterServiceEdgeRouterPoliciesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterServiceEdgeRouterPoliciesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_services_parameters.go b/rest_management_api_client/edge_router/list_edge_router_services_parameters.go deleted file mode 100644 index 1117cb9ff..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_services_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterServicesParams creates a new ListEdgeRouterServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterServicesParams() *ListEdgeRouterServicesParams { - return &ListEdgeRouterServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterServicesParamsWithTimeout creates a new ListEdgeRouterServicesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterServicesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterServicesParams { - return &ListEdgeRouterServicesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterServicesParamsWithContext creates a new ListEdgeRouterServicesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterServicesParamsWithContext(ctx context.Context) *ListEdgeRouterServicesParams { - return &ListEdgeRouterServicesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterServicesParamsWithHTTPClient creates a new ListEdgeRouterServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterServicesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterServicesParams { - return &ListEdgeRouterServicesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterServicesParams contains all the parameters to send to the API endpoint - for the list edge router services operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterServicesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterServicesParams) WithDefaults() *ListEdgeRouterServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router services params -func (o *ListEdgeRouterServicesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router services params -func (o *ListEdgeRouterServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router services params -func (o *ListEdgeRouterServicesParams) WithContext(ctx context.Context) *ListEdgeRouterServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router services params -func (o *ListEdgeRouterServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router services params -func (o *ListEdgeRouterServicesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router services params -func (o *ListEdgeRouterServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list edge router services params -func (o *ListEdgeRouterServicesParams) WithID(id string) *ListEdgeRouterServicesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list edge router services params -func (o *ListEdgeRouterServicesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_router_services_responses.go b/rest_management_api_client/edge_router/list_edge_router_services_responses.go deleted file mode 100644 index ee9c32e67..000000000 --- a/rest_management_api_client/edge_router/list_edge_router_services_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterServicesReader is a Reader for the ListEdgeRouterServices structure. -type ListEdgeRouterServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListEdgeRouterServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListEdgeRouterServicesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterServicesOK creates a ListEdgeRouterServicesOK with default headers values -func NewListEdgeRouterServicesOK() *ListEdgeRouterServicesOK { - return &ListEdgeRouterServicesOK{} -} - -/* ListEdgeRouterServicesOK describes a response with status code 200, with default header values. - -A list of services -*/ -type ListEdgeRouterServicesOK struct { - Payload *rest_model.ListServicesEnvelope -} - -func (o *ListEdgeRouterServicesOK) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/services][%d] listEdgeRouterServicesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterServicesOK) GetPayload() *rest_model.ListServicesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterServicesUnauthorized creates a ListEdgeRouterServicesUnauthorized with default headers values -func NewListEdgeRouterServicesUnauthorized() *ListEdgeRouterServicesUnauthorized { - return &ListEdgeRouterServicesUnauthorized{} -} - -/* ListEdgeRouterServicesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterServicesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/services][%d] listEdgeRouterServicesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterServicesNotFound creates a ListEdgeRouterServicesNotFound with default headers values -func NewListEdgeRouterServicesNotFound() *ListEdgeRouterServicesNotFound { - return &ListEdgeRouterServicesNotFound{} -} - -/* ListEdgeRouterServicesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListEdgeRouterServicesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterServicesNotFound) Error() string { - return fmt.Sprintf("[GET /edge-routers/{id}/services][%d] listEdgeRouterServicesNotFound %+v", 404, o.Payload) -} -func (o *ListEdgeRouterServicesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/list_edge_routers_parameters.go b/rest_management_api_client/edge_router/list_edge_routers_parameters.go deleted file mode 100644 index 7de69923d..000000000 --- a/rest_management_api_client/edge_router/list_edge_routers_parameters.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEdgeRoutersParams creates a new ListEdgeRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRoutersParams() *ListEdgeRoutersParams { - return &ListEdgeRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRoutersParamsWithTimeout creates a new ListEdgeRoutersParams object -// with the ability to set a timeout on a request. -func NewListEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListEdgeRoutersParams { - return &ListEdgeRoutersParams{ - timeout: timeout, - } -} - -// NewListEdgeRoutersParamsWithContext creates a new ListEdgeRoutersParams object -// with the ability to set a context for a request. -func NewListEdgeRoutersParamsWithContext(ctx context.Context) *ListEdgeRoutersParams { - return &ListEdgeRoutersParams{ - Context: ctx, - } -} - -// NewListEdgeRoutersParamsWithHTTPClient creates a new ListEdgeRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListEdgeRoutersParams { - return &ListEdgeRoutersParams{ - HTTPClient: client, - } -} - -/* ListEdgeRoutersParams contains all the parameters to send to the API endpoint - for the list edge routers operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRoutersParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - // RoleFilter. - RoleFilter []string - - // RoleSemantic. - RoleSemantic *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRoutersParams) WithDefaults() *ListEdgeRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge routers params -func (o *ListEdgeRoutersParams) WithTimeout(timeout time.Duration) *ListEdgeRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge routers params -func (o *ListEdgeRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge routers params -func (o *ListEdgeRoutersParams) WithContext(ctx context.Context) *ListEdgeRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge routers params -func (o *ListEdgeRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge routers params -func (o *ListEdgeRoutersParams) WithHTTPClient(client *http.Client) *ListEdgeRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge routers params -func (o *ListEdgeRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list edge routers params -func (o *ListEdgeRoutersParams) WithFilter(filter *string) *ListEdgeRoutersParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list edge routers params -func (o *ListEdgeRoutersParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list edge routers params -func (o *ListEdgeRoutersParams) WithLimit(limit *int64) *ListEdgeRoutersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list edge routers params -func (o *ListEdgeRoutersParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list edge routers params -func (o *ListEdgeRoutersParams) WithOffset(offset *int64) *ListEdgeRoutersParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list edge routers params -func (o *ListEdgeRoutersParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithRoleFilter adds the roleFilter to the list edge routers params -func (o *ListEdgeRoutersParams) WithRoleFilter(roleFilter []string) *ListEdgeRoutersParams { - o.SetRoleFilter(roleFilter) - return o -} - -// SetRoleFilter adds the roleFilter to the list edge routers params -func (o *ListEdgeRoutersParams) SetRoleFilter(roleFilter []string) { - o.RoleFilter = roleFilter -} - -// WithRoleSemantic adds the roleSemantic to the list edge routers params -func (o *ListEdgeRoutersParams) WithRoleSemantic(roleSemantic *string) *ListEdgeRoutersParams { - o.SetRoleSemantic(roleSemantic) - return o -} - -// SetRoleSemantic adds the roleSemantic to the list edge routers params -func (o *ListEdgeRoutersParams) SetRoleSemantic(roleSemantic *string) { - o.RoleSemantic = roleSemantic -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if o.RoleFilter != nil { - - // binding items for roleFilter - joinedRoleFilter := o.bindParamRoleFilter(reg) - - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err - } - } - - if o.RoleSemantic != nil { - - // query param roleSemantic - var qrRoleSemantic string - - if o.RoleSemantic != nil { - qrRoleSemantic = *o.RoleSemantic - } - qRoleSemantic := qrRoleSemantic - if qRoleSemantic != "" { - - if err := r.SetQueryParam("roleSemantic", qRoleSemantic); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamListEdgeRouters binds the parameter roleFilter -func (o *ListEdgeRoutersParams) bindParamRoleFilter(formats strfmt.Registry) []string { - roleFilterIR := o.RoleFilter - - var roleFilterIC []string - for _, roleFilterIIR := range roleFilterIR { // explode []string - - roleFilterIIV := roleFilterIIR // string as string - roleFilterIC = append(roleFilterIC, roleFilterIIV) - } - - // items.CollectionFormat: "multi" - roleFilterIS := swag.JoinByFormat(roleFilterIC, "multi") - - return roleFilterIS -} diff --git a/rest_management_api_client/edge_router/list_edge_routers_responses.go b/rest_management_api_client/edge_router/list_edge_routers_responses.go deleted file mode 100644 index 631863bf6..000000000 --- a/rest_management_api_client/edge_router/list_edge_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRoutersReader is a Reader for the ListEdgeRouters structure. -type ListEdgeRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListEdgeRoutersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListEdgeRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRoutersOK creates a ListEdgeRoutersOK with default headers values -func NewListEdgeRoutersOK() *ListEdgeRoutersOK { - return &ListEdgeRoutersOK{} -} - -/* ListEdgeRoutersOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type ListEdgeRoutersOK struct { - Payload *rest_model.ListEdgeRoutersEnvelope -} - -func (o *ListEdgeRoutersOK) Error() string { - return fmt.Sprintf("[GET /edge-routers][%d] listEdgeRoutersOK %+v", 200, o.Payload) -} -func (o *ListEdgeRoutersOK) GetPayload() *rest_model.ListEdgeRoutersEnvelope { - return o.Payload -} - -func (o *ListEdgeRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRoutersBadRequest creates a ListEdgeRoutersBadRequest with default headers values -func NewListEdgeRoutersBadRequest() *ListEdgeRoutersBadRequest { - return &ListEdgeRoutersBadRequest{} -} - -/* ListEdgeRoutersBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListEdgeRoutersBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRoutersBadRequest) Error() string { - return fmt.Sprintf("[GET /edge-routers][%d] listEdgeRoutersBadRequest %+v", 400, o.Payload) -} -func (o *ListEdgeRoutersBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRoutersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRoutersUnauthorized creates a ListEdgeRoutersUnauthorized with default headers values -func NewListEdgeRoutersUnauthorized() *ListEdgeRoutersUnauthorized { - return &ListEdgeRoutersUnauthorized{} -} - -/* ListEdgeRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-routers][%d] listEdgeRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/patch_edge_router_parameters.go b/rest_management_api_client/edge_router/patch_edge_router_parameters.go deleted file mode 100644 index 38d3f9f66..000000000 --- a/rest_management_api_client/edge_router/patch_edge_router_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchEdgeRouterParams creates a new PatchEdgeRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchEdgeRouterParams() *PatchEdgeRouterParams { - return &PatchEdgeRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchEdgeRouterParamsWithTimeout creates a new PatchEdgeRouterParams object -// with the ability to set a timeout on a request. -func NewPatchEdgeRouterParamsWithTimeout(timeout time.Duration) *PatchEdgeRouterParams { - return &PatchEdgeRouterParams{ - timeout: timeout, - } -} - -// NewPatchEdgeRouterParamsWithContext creates a new PatchEdgeRouterParams object -// with the ability to set a context for a request. -func NewPatchEdgeRouterParamsWithContext(ctx context.Context) *PatchEdgeRouterParams { - return &PatchEdgeRouterParams{ - Context: ctx, - } -} - -// NewPatchEdgeRouterParamsWithHTTPClient creates a new PatchEdgeRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchEdgeRouterParamsWithHTTPClient(client *http.Client) *PatchEdgeRouterParams { - return &PatchEdgeRouterParams{ - HTTPClient: client, - } -} - -/* PatchEdgeRouterParams contains all the parameters to send to the API endpoint - for the patch edge router operation. - - Typically these are written to a http.Request. -*/ -type PatchEdgeRouterParams struct { - - /* EdgeRouter. - - An edge router patch object - */ - EdgeRouter *rest_model.EdgeRouterPatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchEdgeRouterParams) WithDefaults() *PatchEdgeRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchEdgeRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch edge router params -func (o *PatchEdgeRouterParams) WithTimeout(timeout time.Duration) *PatchEdgeRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch edge router params -func (o *PatchEdgeRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch edge router params -func (o *PatchEdgeRouterParams) WithContext(ctx context.Context) *PatchEdgeRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch edge router params -func (o *PatchEdgeRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch edge router params -func (o *PatchEdgeRouterParams) WithHTTPClient(client *http.Client) *PatchEdgeRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch edge router params -func (o *PatchEdgeRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithEdgeRouter adds the edgeRouter to the patch edge router params -func (o *PatchEdgeRouterParams) WithEdgeRouter(edgeRouter *rest_model.EdgeRouterPatch) *PatchEdgeRouterParams { - o.SetEdgeRouter(edgeRouter) - return o -} - -// SetEdgeRouter adds the edgeRouter to the patch edge router params -func (o *PatchEdgeRouterParams) SetEdgeRouter(edgeRouter *rest_model.EdgeRouterPatch) { - o.EdgeRouter = edgeRouter -} - -// WithID adds the id to the patch edge router params -func (o *PatchEdgeRouterParams) WithID(id string) *PatchEdgeRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch edge router params -func (o *PatchEdgeRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.EdgeRouter != nil { - if err := r.SetBodyParam(o.EdgeRouter); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/patch_edge_router_responses.go b/rest_management_api_client/edge_router/patch_edge_router_responses.go deleted file mode 100644 index 7dac6ff58..000000000 --- a/rest_management_api_client/edge_router/patch_edge_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchEdgeRouterReader is a Reader for the PatchEdgeRouter structure. -type PatchEdgeRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchEdgeRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchEdgeRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchEdgeRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchEdgeRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchEdgeRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchEdgeRouterOK creates a PatchEdgeRouterOK with default headers values -func NewPatchEdgeRouterOK() *PatchEdgeRouterOK { - return &PatchEdgeRouterOK{} -} - -/* PatchEdgeRouterOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchEdgeRouterOK struct { - Payload *rest_model.Empty -} - -func (o *PatchEdgeRouterOK) Error() string { - return fmt.Sprintf("[PATCH /edge-routers/{id}][%d] patchEdgeRouterOK %+v", 200, o.Payload) -} -func (o *PatchEdgeRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchEdgeRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchEdgeRouterBadRequest creates a PatchEdgeRouterBadRequest with default headers values -func NewPatchEdgeRouterBadRequest() *PatchEdgeRouterBadRequest { - return &PatchEdgeRouterBadRequest{} -} - -/* PatchEdgeRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchEdgeRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchEdgeRouterBadRequest) Error() string { - return fmt.Sprintf("[PATCH /edge-routers/{id}][%d] patchEdgeRouterBadRequest %+v", 400, o.Payload) -} -func (o *PatchEdgeRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchEdgeRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchEdgeRouterUnauthorized creates a PatchEdgeRouterUnauthorized with default headers values -func NewPatchEdgeRouterUnauthorized() *PatchEdgeRouterUnauthorized { - return &PatchEdgeRouterUnauthorized{} -} - -/* PatchEdgeRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchEdgeRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchEdgeRouterUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /edge-routers/{id}][%d] patchEdgeRouterUnauthorized %+v", 401, o.Payload) -} -func (o *PatchEdgeRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchEdgeRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchEdgeRouterNotFound creates a PatchEdgeRouterNotFound with default headers values -func NewPatchEdgeRouterNotFound() *PatchEdgeRouterNotFound { - return &PatchEdgeRouterNotFound{} -} - -/* PatchEdgeRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchEdgeRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchEdgeRouterNotFound) Error() string { - return fmt.Sprintf("[PATCH /edge-routers/{id}][%d] patchEdgeRouterNotFound %+v", 404, o.Payload) -} -func (o *PatchEdgeRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchEdgeRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/re_enroll_edge_router_parameters.go b/rest_management_api_client/edge_router/re_enroll_edge_router_parameters.go deleted file mode 100644 index a3bec3fe7..000000000 --- a/rest_management_api_client/edge_router/re_enroll_edge_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewReEnrollEdgeRouterParams creates a new ReEnrollEdgeRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewReEnrollEdgeRouterParams() *ReEnrollEdgeRouterParams { - return &ReEnrollEdgeRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewReEnrollEdgeRouterParamsWithTimeout creates a new ReEnrollEdgeRouterParams object -// with the ability to set a timeout on a request. -func NewReEnrollEdgeRouterParamsWithTimeout(timeout time.Duration) *ReEnrollEdgeRouterParams { - return &ReEnrollEdgeRouterParams{ - timeout: timeout, - } -} - -// NewReEnrollEdgeRouterParamsWithContext creates a new ReEnrollEdgeRouterParams object -// with the ability to set a context for a request. -func NewReEnrollEdgeRouterParamsWithContext(ctx context.Context) *ReEnrollEdgeRouterParams { - return &ReEnrollEdgeRouterParams{ - Context: ctx, - } -} - -// NewReEnrollEdgeRouterParamsWithHTTPClient creates a new ReEnrollEdgeRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewReEnrollEdgeRouterParamsWithHTTPClient(client *http.Client) *ReEnrollEdgeRouterParams { - return &ReEnrollEdgeRouterParams{ - HTTPClient: client, - } -} - -/* ReEnrollEdgeRouterParams contains all the parameters to send to the API endpoint - for the re enroll edge router operation. - - Typically these are written to a http.Request. -*/ -type ReEnrollEdgeRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the re enroll edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReEnrollEdgeRouterParams) WithDefaults() *ReEnrollEdgeRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the re enroll edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReEnrollEdgeRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) WithTimeout(timeout time.Duration) *ReEnrollEdgeRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) WithContext(ctx context.Context) *ReEnrollEdgeRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) WithHTTPClient(client *http.Client) *ReEnrollEdgeRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) WithID(id string) *ReEnrollEdgeRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the re enroll edge router params -func (o *ReEnrollEdgeRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ReEnrollEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/re_enroll_edge_router_responses.go b/rest_management_api_client/edge_router/re_enroll_edge_router_responses.go deleted file mode 100644 index ee7553456..000000000 --- a/rest_management_api_client/edge_router/re_enroll_edge_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ReEnrollEdgeRouterReader is a Reader for the ReEnrollEdgeRouter structure. -type ReEnrollEdgeRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ReEnrollEdgeRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewReEnrollEdgeRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewReEnrollEdgeRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewReEnrollEdgeRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewReEnrollEdgeRouterOK creates a ReEnrollEdgeRouterOK with default headers values -func NewReEnrollEdgeRouterOK() *ReEnrollEdgeRouterOK { - return &ReEnrollEdgeRouterOK{} -} - -/* ReEnrollEdgeRouterOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type ReEnrollEdgeRouterOK struct { - Payload *rest_model.Empty -} - -func (o *ReEnrollEdgeRouterOK) Error() string { - return fmt.Sprintf("[POST /edge-routers/{id}/re-enroll][%d] reEnrollEdgeRouterOK %+v", 200, o.Payload) -} -func (o *ReEnrollEdgeRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *ReEnrollEdgeRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReEnrollEdgeRouterUnauthorized creates a ReEnrollEdgeRouterUnauthorized with default headers values -func NewReEnrollEdgeRouterUnauthorized() *ReEnrollEdgeRouterUnauthorized { - return &ReEnrollEdgeRouterUnauthorized{} -} - -/* ReEnrollEdgeRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ReEnrollEdgeRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ReEnrollEdgeRouterUnauthorized) Error() string { - return fmt.Sprintf("[POST /edge-routers/{id}/re-enroll][%d] reEnrollEdgeRouterUnauthorized %+v", 401, o.Payload) -} -func (o *ReEnrollEdgeRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ReEnrollEdgeRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReEnrollEdgeRouterNotFound creates a ReEnrollEdgeRouterNotFound with default headers values -func NewReEnrollEdgeRouterNotFound() *ReEnrollEdgeRouterNotFound { - return &ReEnrollEdgeRouterNotFound{} -} - -/* ReEnrollEdgeRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ReEnrollEdgeRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ReEnrollEdgeRouterNotFound) Error() string { - return fmt.Sprintf("[POST /edge-routers/{id}/re-enroll][%d] reEnrollEdgeRouterNotFound %+v", 404, o.Payload) -} -func (o *ReEnrollEdgeRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ReEnrollEdgeRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router/update_edge_router_parameters.go b/rest_management_api_client/edge_router/update_edge_router_parameters.go deleted file mode 100644 index b906762f8..000000000 --- a/rest_management_api_client/edge_router/update_edge_router_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateEdgeRouterParams creates a new UpdateEdgeRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateEdgeRouterParams() *UpdateEdgeRouterParams { - return &UpdateEdgeRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateEdgeRouterParamsWithTimeout creates a new UpdateEdgeRouterParams object -// with the ability to set a timeout on a request. -func NewUpdateEdgeRouterParamsWithTimeout(timeout time.Duration) *UpdateEdgeRouterParams { - return &UpdateEdgeRouterParams{ - timeout: timeout, - } -} - -// NewUpdateEdgeRouterParamsWithContext creates a new UpdateEdgeRouterParams object -// with the ability to set a context for a request. -func NewUpdateEdgeRouterParamsWithContext(ctx context.Context) *UpdateEdgeRouterParams { - return &UpdateEdgeRouterParams{ - Context: ctx, - } -} - -// NewUpdateEdgeRouterParamsWithHTTPClient creates a new UpdateEdgeRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateEdgeRouterParamsWithHTTPClient(client *http.Client) *UpdateEdgeRouterParams { - return &UpdateEdgeRouterParams{ - HTTPClient: client, - } -} - -/* UpdateEdgeRouterParams contains all the parameters to send to the API endpoint - for the update edge router operation. - - Typically these are written to a http.Request. -*/ -type UpdateEdgeRouterParams struct { - - /* EdgeRouter. - - An edge router update object - */ - EdgeRouter *rest_model.EdgeRouterUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateEdgeRouterParams) WithDefaults() *UpdateEdgeRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update edge router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateEdgeRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update edge router params -func (o *UpdateEdgeRouterParams) WithTimeout(timeout time.Duration) *UpdateEdgeRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update edge router params -func (o *UpdateEdgeRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update edge router params -func (o *UpdateEdgeRouterParams) WithContext(ctx context.Context) *UpdateEdgeRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update edge router params -func (o *UpdateEdgeRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update edge router params -func (o *UpdateEdgeRouterParams) WithHTTPClient(client *http.Client) *UpdateEdgeRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update edge router params -func (o *UpdateEdgeRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithEdgeRouter adds the edgeRouter to the update edge router params -func (o *UpdateEdgeRouterParams) WithEdgeRouter(edgeRouter *rest_model.EdgeRouterUpdate) *UpdateEdgeRouterParams { - o.SetEdgeRouter(edgeRouter) - return o -} - -// SetEdgeRouter adds the edgeRouter to the update edge router params -func (o *UpdateEdgeRouterParams) SetEdgeRouter(edgeRouter *rest_model.EdgeRouterUpdate) { - o.EdgeRouter = edgeRouter -} - -// WithID adds the id to the update edge router params -func (o *UpdateEdgeRouterParams) WithID(id string) *UpdateEdgeRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update edge router params -func (o *UpdateEdgeRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateEdgeRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.EdgeRouter != nil { - if err := r.SetBodyParam(o.EdgeRouter); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router/update_edge_router_responses.go b/rest_management_api_client/edge_router/update_edge_router_responses.go deleted file mode 100644 index 25a80f55c..000000000 --- a/rest_management_api_client/edge_router/update_edge_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateEdgeRouterReader is a Reader for the UpdateEdgeRouter structure. -type UpdateEdgeRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateEdgeRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateEdgeRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateEdgeRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateEdgeRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateEdgeRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateEdgeRouterOK creates a UpdateEdgeRouterOK with default headers values -func NewUpdateEdgeRouterOK() *UpdateEdgeRouterOK { - return &UpdateEdgeRouterOK{} -} - -/* UpdateEdgeRouterOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateEdgeRouterOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateEdgeRouterOK) Error() string { - return fmt.Sprintf("[PUT /edge-routers/{id}][%d] updateEdgeRouterOK %+v", 200, o.Payload) -} -func (o *UpdateEdgeRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateEdgeRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEdgeRouterBadRequest creates a UpdateEdgeRouterBadRequest with default headers values -func NewUpdateEdgeRouterBadRequest() *UpdateEdgeRouterBadRequest { - return &UpdateEdgeRouterBadRequest{} -} - -/* UpdateEdgeRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateEdgeRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateEdgeRouterBadRequest) Error() string { - return fmt.Sprintf("[PUT /edge-routers/{id}][%d] updateEdgeRouterBadRequest %+v", 400, o.Payload) -} -func (o *UpdateEdgeRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateEdgeRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEdgeRouterUnauthorized creates a UpdateEdgeRouterUnauthorized with default headers values -func NewUpdateEdgeRouterUnauthorized() *UpdateEdgeRouterUnauthorized { - return &UpdateEdgeRouterUnauthorized{} -} - -/* UpdateEdgeRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateEdgeRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateEdgeRouterUnauthorized) Error() string { - return fmt.Sprintf("[PUT /edge-routers/{id}][%d] updateEdgeRouterUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateEdgeRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateEdgeRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEdgeRouterNotFound creates a UpdateEdgeRouterNotFound with default headers values -func NewUpdateEdgeRouterNotFound() *UpdateEdgeRouterNotFound { - return &UpdateEdgeRouterNotFound{} -} - -/* UpdateEdgeRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateEdgeRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateEdgeRouterNotFound) Error() string { - return fmt.Sprintf("[PUT /edge-routers/{id}][%d] updateEdgeRouterNotFound %+v", 404, o.Payload) -} -func (o *UpdateEdgeRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateEdgeRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/create_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/create_edge_router_policy_parameters.go deleted file mode 100644 index 97b6bcb38..000000000 --- a/rest_management_api_client/edge_router_policy/create_edge_router_policy_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateEdgeRouterPolicyParams creates a new CreateEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateEdgeRouterPolicyParams() *CreateEdgeRouterPolicyParams { - return &CreateEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateEdgeRouterPolicyParamsWithTimeout creates a new CreateEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewCreateEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *CreateEdgeRouterPolicyParams { - return &CreateEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewCreateEdgeRouterPolicyParamsWithContext creates a new CreateEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewCreateEdgeRouterPolicyParamsWithContext(ctx context.Context) *CreateEdgeRouterPolicyParams { - return &CreateEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewCreateEdgeRouterPolicyParamsWithHTTPClient creates a new CreateEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *CreateEdgeRouterPolicyParams { - return &CreateEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* CreateEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the create edge router policy operation. - - Typically these are written to a http.Request. -*/ -type CreateEdgeRouterPolicyParams struct { - - /* Policy. - - An edge router policy to create - */ - Policy *rest_model.EdgeRouterPolicyCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEdgeRouterPolicyParams) WithDefaults() *CreateEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *CreateEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) WithContext(ctx context.Context) *CreateEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *CreateEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPolicy adds the policy to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) WithPolicy(policy *rest_model.EdgeRouterPolicyCreate) *CreateEdgeRouterPolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the create edge router policy params -func (o *CreateEdgeRouterPolicyParams) SetPolicy(policy *rest_model.EdgeRouterPolicyCreate) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/create_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/create_edge_router_policy_responses.go deleted file mode 100644 index 0a363ad64..000000000 --- a/rest_management_api_client/edge_router_policy/create_edge_router_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateEdgeRouterPolicyReader is a Reader for the CreateEdgeRouterPolicy structure. -type CreateEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateEdgeRouterPolicyCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateEdgeRouterPolicyCreated creates a CreateEdgeRouterPolicyCreated with default headers values -func NewCreateEdgeRouterPolicyCreated() *CreateEdgeRouterPolicyCreated { - return &CreateEdgeRouterPolicyCreated{} -} - -/* CreateEdgeRouterPolicyCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateEdgeRouterPolicyCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateEdgeRouterPolicyCreated) Error() string { - return fmt.Sprintf("[POST /edge-router-policies][%d] createEdgeRouterPolicyCreated %+v", 201, o.Payload) -} -func (o *CreateEdgeRouterPolicyCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateEdgeRouterPolicyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEdgeRouterPolicyBadRequest creates a CreateEdgeRouterPolicyBadRequest with default headers values -func NewCreateEdgeRouterPolicyBadRequest() *CreateEdgeRouterPolicyBadRequest { - return &CreateEdgeRouterPolicyBadRequest{} -} - -/* CreateEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[POST /edge-router-policies][%d] createEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *CreateEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEdgeRouterPolicyUnauthorized creates a CreateEdgeRouterPolicyUnauthorized with default headers values -func NewCreateEdgeRouterPolicyUnauthorized() *CreateEdgeRouterPolicyUnauthorized { - return &CreateEdgeRouterPolicyUnauthorized{} -} - -/* CreateEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[POST /edge-router-policies][%d] createEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *CreateEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/delete_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/delete_edge_router_policy_parameters.go deleted file mode 100644 index 4dfc9803f..000000000 --- a/rest_management_api_client/edge_router_policy/delete_edge_router_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEdgeRouterPolicyParams creates a new DeleteEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteEdgeRouterPolicyParams() *DeleteEdgeRouterPolicyParams { - return &DeleteEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteEdgeRouterPolicyParamsWithTimeout creates a new DeleteEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewDeleteEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DeleteEdgeRouterPolicyParams { - return &DeleteEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewDeleteEdgeRouterPolicyParamsWithContext creates a new DeleteEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewDeleteEdgeRouterPolicyParamsWithContext(ctx context.Context) *DeleteEdgeRouterPolicyParams { - return &DeleteEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewDeleteEdgeRouterPolicyParamsWithHTTPClient creates a new DeleteEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DeleteEdgeRouterPolicyParams { - return &DeleteEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* DeleteEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the delete edge router policy operation. - - Typically these are written to a http.Request. -*/ -type DeleteEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEdgeRouterPolicyParams) WithDefaults() *DeleteEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *DeleteEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) WithContext(ctx context.Context) *DeleteEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *DeleteEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) WithID(id string) *DeleteEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete edge router policy params -func (o *DeleteEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/delete_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/delete_edge_router_policy_responses.go deleted file mode 100644 index 71f09bfcf..000000000 --- a/rest_management_api_client/edge_router_policy/delete_edge_router_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteEdgeRouterPolicyReader is a Reader for the DeleteEdgeRouterPolicy structure. -type DeleteEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteEdgeRouterPolicyConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteEdgeRouterPolicyOK creates a DeleteEdgeRouterPolicyOK with default headers values -func NewDeleteEdgeRouterPolicyOK() *DeleteEdgeRouterPolicyOK { - return &DeleteEdgeRouterPolicyOK{} -} - -/* DeleteEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteEdgeRouterPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[DELETE /edge-router-policies/{id}][%d] deleteEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *DeleteEdgeRouterPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEdgeRouterPolicyBadRequest creates a DeleteEdgeRouterPolicyBadRequest with default headers values -func NewDeleteEdgeRouterPolicyBadRequest() *DeleteEdgeRouterPolicyBadRequest { - return &DeleteEdgeRouterPolicyBadRequest{} -} - -/* DeleteEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[DELETE /edge-router-policies/{id}][%d] deleteEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *DeleteEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEdgeRouterPolicyUnauthorized creates a DeleteEdgeRouterPolicyUnauthorized with default headers values -func NewDeleteEdgeRouterPolicyUnauthorized() *DeleteEdgeRouterPolicyUnauthorized { - return &DeleteEdgeRouterPolicyUnauthorized{} -} - -/* DeleteEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /edge-router-policies/{id}][%d] deleteEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEdgeRouterPolicyConflict creates a DeleteEdgeRouterPolicyConflict with default headers values -func NewDeleteEdgeRouterPolicyConflict() *DeleteEdgeRouterPolicyConflict { - return &DeleteEdgeRouterPolicyConflict{} -} - -/* DeleteEdgeRouterPolicyConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteEdgeRouterPolicyConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEdgeRouterPolicyConflict) Error() string { - return fmt.Sprintf("[DELETE /edge-router-policies/{id}][%d] deleteEdgeRouterPolicyConflict %+v", 409, o.Payload) -} -func (o *DeleteEdgeRouterPolicyConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEdgeRouterPolicyConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/detail_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/detail_edge_router_policy_parameters.go deleted file mode 100644 index 27308e74f..000000000 --- a/rest_management_api_client/edge_router_policy/detail_edge_router_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailEdgeRouterPolicyParams creates a new DetailEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailEdgeRouterPolicyParams() *DetailEdgeRouterPolicyParams { - return &DetailEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailEdgeRouterPolicyParamsWithTimeout creates a new DetailEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewDetailEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DetailEdgeRouterPolicyParams { - return &DetailEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewDetailEdgeRouterPolicyParamsWithContext creates a new DetailEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewDetailEdgeRouterPolicyParamsWithContext(ctx context.Context) *DetailEdgeRouterPolicyParams { - return &DetailEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewDetailEdgeRouterPolicyParamsWithHTTPClient creates a new DetailEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DetailEdgeRouterPolicyParams { - return &DetailEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* DetailEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the detail edge router policy operation. - - Typically these are written to a http.Request. -*/ -type DetailEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailEdgeRouterPolicyParams) WithDefaults() *DetailEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *DetailEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) WithContext(ctx context.Context) *DetailEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *DetailEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) WithID(id string) *DetailEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail edge router policy params -func (o *DetailEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/detail_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/detail_edge_router_policy_responses.go deleted file mode 100644 index bb8f84a64..000000000 --- a/rest_management_api_client/edge_router_policy/detail_edge_router_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailEdgeRouterPolicyReader is a Reader for the DetailEdgeRouterPolicy structure. -type DetailEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailEdgeRouterPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailEdgeRouterPolicyOK creates a DetailEdgeRouterPolicyOK with default headers values -func NewDetailEdgeRouterPolicyOK() *DetailEdgeRouterPolicyOK { - return &DetailEdgeRouterPolicyOK{} -} - -/* DetailEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -A single edge router policy -*/ -type DetailEdgeRouterPolicyOK struct { - Payload *rest_model.DetailEdgeRouterPolicyEnvelope -} - -func (o *DetailEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}][%d] detailEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *DetailEdgeRouterPolicyOK) GetPayload() *rest_model.DetailEdgeRouterPolicyEnvelope { - return o.Payload -} - -func (o *DetailEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailEdgeRouterPolicyEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailEdgeRouterPolicyUnauthorized creates a DetailEdgeRouterPolicyUnauthorized with default headers values -func NewDetailEdgeRouterPolicyUnauthorized() *DetailEdgeRouterPolicyUnauthorized { - return &DetailEdgeRouterPolicyUnauthorized{} -} - -/* DetailEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}][%d] detailEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DetailEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailEdgeRouterPolicyNotFound creates a DetailEdgeRouterPolicyNotFound with default headers values -func NewDetailEdgeRouterPolicyNotFound() *DetailEdgeRouterPolicyNotFound { - return &DetailEdgeRouterPolicyNotFound{} -} - -/* DetailEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailEdgeRouterPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailEdgeRouterPolicyNotFound) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}][%d] detailEdgeRouterPolicyNotFound %+v", 404, o.Payload) -} -func (o *DetailEdgeRouterPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailEdgeRouterPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/edge_router_policy_client.go b/rest_management_api_client/edge_router_policy/edge_router_policy_client.go deleted file mode 100644 index 7556ea9d0..000000000 --- a/rest_management_api_client/edge_router_policy/edge_router_policy_client.go +++ /dev/null @@ -1,410 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new edge router policy API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for edge router policy API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterPolicyCreated, error) - - DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterPolicyOK, error) - - DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterPolicyOK, error) - - ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPoliciesOK, error) - - ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyEdgeRoutersOK, error) - - ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyIdentitiesOK, error) - - PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterPolicyOK, error) - - UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterPolicyOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateEdgeRouterPolicy creates an edge router policy resource - - Create an edge router policy resource. Requires admin access. -*/ -func (a *Client) CreateEdgeRouterPolicy(params *CreateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterPolicyCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "createEdgeRouterPolicy", - Method: "POST", - PathPattern: "/edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateEdgeRouterPolicyCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteEdgeRouterPolicy deletes an edge router policy - - Delete an edge router policy by id. Requires admin access. -*/ -func (a *Client) DeleteEdgeRouterPolicy(params *DeleteEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "deleteEdgeRouterPolicy", - Method: "DELETE", - PathPattern: "/edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailEdgeRouterPolicy retrieves a single edge router policy - - Retrieves a single edge router policy by id. Requires admin access. -*/ -func (a *Client) DetailEdgeRouterPolicy(params *DetailEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "detailEdgeRouterPolicy", - Method: "GET", - PathPattern: "/edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterPolicies lists edge router policies - - Retrieves a list of edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouterPolicies(params *ListEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterPolicies", - Method: "GET", - PathPattern: "/edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterPolicyEdgeRouters lists edge routers a policy affects - - Retrieves a list of edge routers an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouterPolicyEdgeRouters(params *ListEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyEdgeRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterPolicyEdgeRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterPolicyEdgeRouters", - Method: "GET", - PathPattern: "/edge-router-policies/{id}/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterPolicyEdgeRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterPolicyEdgeRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterPolicyEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEdgeRouterPolicyIdentities lists identities an edge router policy affects - - Retrieves a list of identities an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouterPolicyIdentities(params *ListEdgeRouterPolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterPolicyIdentitiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterPolicyIdentitiesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterPolicyIdentities", - Method: "GET", - PathPattern: "/edge-router-policies/{id}/identities", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterPolicyIdentitiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterPolicyIdentitiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterPolicyIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchEdgeRouterPolicy updates the supplied fields on an edge router policy - - Update the supplied fields on an edge router policy. Requires admin access. -*/ -func (a *Client) PatchEdgeRouterPolicy(params *PatchEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "patchEdgeRouterPolicy", - Method: "PATCH", - PathPattern: "/edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateEdgeRouterPolicy updates all fields on an edge router policy - - Update all fields on an edge router policy by id. Requires admin access. -*/ -func (a *Client) UpdateEdgeRouterPolicy(params *UpdateEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "updateEdgeRouterPolicy", - Method: "PUT", - PathPattern: "/edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/edge_router_policy/list_edge_router_policies_parameters.go b/rest_management_api_client/edge_router_policy/list_edge_router_policies_parameters.go deleted file mode 100644 index 3c68bce63..000000000 --- a/rest_management_api_client/edge_router_policy/list_edge_router_policies_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEdgeRouterPoliciesParams creates a new ListEdgeRouterPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterPoliciesParams() *ListEdgeRouterPoliciesParams { - return &ListEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterPoliciesParamsWithTimeout creates a new ListEdgeRouterPoliciesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterPoliciesParams { - return &ListEdgeRouterPoliciesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterPoliciesParamsWithContext creates a new ListEdgeRouterPoliciesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListEdgeRouterPoliciesParams { - return &ListEdgeRouterPoliciesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterPoliciesParamsWithHTTPClient creates a new ListEdgeRouterPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterPoliciesParams { - return &ListEdgeRouterPoliciesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterPoliciesParams contains all the parameters to send to the API endpoint - for the list edge router policies operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterPoliciesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterPoliciesParams) WithDefaults() *ListEdgeRouterPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) WithContext(ctx context.Context) *ListEdgeRouterPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) WithFilter(filter *string) *ListEdgeRouterPoliciesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) WithLimit(limit *int64) *ListEdgeRouterPoliciesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) WithOffset(offset *int64) *ListEdgeRouterPoliciesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list edge router policies params -func (o *ListEdgeRouterPoliciesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/list_edge_router_policies_responses.go b/rest_management_api_client/edge_router_policy/list_edge_router_policies_responses.go deleted file mode 100644 index 9b9545d6d..000000000 --- a/rest_management_api_client/edge_router_policy/list_edge_router_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterPoliciesReader is a Reader for the ListEdgeRouterPolicies structure. -type ListEdgeRouterPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListEdgeRouterPoliciesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListEdgeRouterPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterPoliciesOK creates a ListEdgeRouterPoliciesOK with default headers values -func NewListEdgeRouterPoliciesOK() *ListEdgeRouterPoliciesOK { - return &ListEdgeRouterPoliciesOK{} -} - -/* ListEdgeRouterPoliciesOK describes a response with status code 200, with default header values. - -A list of edge router policies -*/ -type ListEdgeRouterPoliciesOK struct { - Payload *rest_model.ListEdgeRouterPoliciesEnvelope -} - -func (o *ListEdgeRouterPoliciesOK) Error() string { - return fmt.Sprintf("[GET /edge-router-policies][%d] listEdgeRouterPoliciesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterPoliciesOK) GetPayload() *rest_model.ListEdgeRouterPoliciesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRouterPoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterPoliciesBadRequest creates a ListEdgeRouterPoliciesBadRequest with default headers values -func NewListEdgeRouterPoliciesBadRequest() *ListEdgeRouterPoliciesBadRequest { - return &ListEdgeRouterPoliciesBadRequest{} -} - -/* ListEdgeRouterPoliciesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListEdgeRouterPoliciesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterPoliciesBadRequest) Error() string { - return fmt.Sprintf("[GET /edge-router-policies][%d] listEdgeRouterPoliciesBadRequest %+v", 400, o.Payload) -} -func (o *ListEdgeRouterPoliciesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPoliciesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterPoliciesUnauthorized creates a ListEdgeRouterPoliciesUnauthorized with default headers values -func NewListEdgeRouterPoliciesUnauthorized() *ListEdgeRouterPoliciesUnauthorized { - return &ListEdgeRouterPoliciesUnauthorized{} -} - -/* ListEdgeRouterPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-router-policies][%d] listEdgeRouterPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go b/rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go deleted file mode 100644 index 31fd9c977..000000000 --- a/rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterPolicyEdgeRoutersParams creates a new ListEdgeRouterPolicyEdgeRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterPolicyEdgeRoutersParams() *ListEdgeRouterPolicyEdgeRoutersParams { - return &ListEdgeRouterPolicyEdgeRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterPolicyEdgeRoutersParamsWithTimeout creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterPolicyEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListEdgeRouterPolicyEdgeRoutersParams { - return &ListEdgeRouterPolicyEdgeRoutersParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterPolicyEdgeRoutersParamsWithContext creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the ability to set a context for a request. -func NewListEdgeRouterPolicyEdgeRoutersParamsWithContext(ctx context.Context) *ListEdgeRouterPolicyEdgeRoutersParams { - return &ListEdgeRouterPolicyEdgeRoutersParams{ - Context: ctx, - } -} - -// NewListEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListEdgeRouterPolicyEdgeRoutersParams { - return &ListEdgeRouterPolicyEdgeRoutersParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterPolicyEdgeRoutersParams contains all the parameters to send to the API endpoint - for the list edge router policy edge routers operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterPolicyEdgeRoutersParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router policy edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterPolicyEdgeRoutersParams) WithDefaults() *ListEdgeRouterPolicyEdgeRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router policy edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterPolicyEdgeRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) WithTimeout(timeout time.Duration) *ListEdgeRouterPolicyEdgeRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) WithContext(ctx context.Context) *ListEdgeRouterPolicyEdgeRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) WithHTTPClient(client *http.Client) *ListEdgeRouterPolicyEdgeRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) WithID(id string) *ListEdgeRouterPolicyEdgeRoutersParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list edge router policy edge routers params -func (o *ListEdgeRouterPolicyEdgeRoutersParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterPolicyEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_responses.go b/rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_responses.go deleted file mode 100644 index 8a42ce24b..000000000 --- a/rest_management_api_client/edge_router_policy/list_edge_router_policy_edge_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterPolicyEdgeRoutersReader is a Reader for the ListEdgeRouterPolicyEdgeRouters structure. -type ListEdgeRouterPolicyEdgeRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterPolicyEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterPolicyEdgeRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListEdgeRouterPolicyEdgeRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListEdgeRouterPolicyEdgeRoutersNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterPolicyEdgeRoutersOK creates a ListEdgeRouterPolicyEdgeRoutersOK with default headers values -func NewListEdgeRouterPolicyEdgeRoutersOK() *ListEdgeRouterPolicyEdgeRoutersOK { - return &ListEdgeRouterPolicyEdgeRoutersOK{} -} - -/* ListEdgeRouterPolicyEdgeRoutersOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type ListEdgeRouterPolicyEdgeRoutersOK struct { - Payload *rest_model.ListEdgeRoutersEnvelope -} - -func (o *ListEdgeRouterPolicyEdgeRoutersOK) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}/edge-routers][%d] listEdgeRouterPolicyEdgeRoutersOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterPolicyEdgeRoutersOK) GetPayload() *rest_model.ListEdgeRoutersEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPolicyEdgeRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterPolicyEdgeRoutersUnauthorized creates a ListEdgeRouterPolicyEdgeRoutersUnauthorized with default headers values -func NewListEdgeRouterPolicyEdgeRoutersUnauthorized() *ListEdgeRouterPolicyEdgeRoutersUnauthorized { - return &ListEdgeRouterPolicyEdgeRoutersUnauthorized{} -} - -/* ListEdgeRouterPolicyEdgeRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterPolicyEdgeRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterPolicyEdgeRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}/edge-routers][%d] listEdgeRouterPolicyEdgeRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterPolicyEdgeRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPolicyEdgeRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterPolicyEdgeRoutersNotFound creates a ListEdgeRouterPolicyEdgeRoutersNotFound with default headers values -func NewListEdgeRouterPolicyEdgeRoutersNotFound() *ListEdgeRouterPolicyEdgeRoutersNotFound { - return &ListEdgeRouterPolicyEdgeRoutersNotFound{} -} - -/* ListEdgeRouterPolicyEdgeRoutersNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListEdgeRouterPolicyEdgeRoutersNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterPolicyEdgeRoutersNotFound) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}/edge-routers][%d] listEdgeRouterPolicyEdgeRoutersNotFound %+v", 404, o.Payload) -} -func (o *ListEdgeRouterPolicyEdgeRoutersNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPolicyEdgeRoutersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_parameters.go b/rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_parameters.go deleted file mode 100644 index 8eba974ba..000000000 --- a/rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterPolicyIdentitiesParams creates a new ListEdgeRouterPolicyIdentitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterPolicyIdentitiesParams() *ListEdgeRouterPolicyIdentitiesParams { - return &ListEdgeRouterPolicyIdentitiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterPolicyIdentitiesParamsWithTimeout creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterPolicyIdentitiesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterPolicyIdentitiesParams { - return &ListEdgeRouterPolicyIdentitiesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterPolicyIdentitiesParamsWithContext creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterPolicyIdentitiesParamsWithContext(ctx context.Context) *ListEdgeRouterPolicyIdentitiesParams { - return &ListEdgeRouterPolicyIdentitiesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterPolicyIdentitiesParamsWithHTTPClient creates a new ListEdgeRouterPolicyIdentitiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterPolicyIdentitiesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterPolicyIdentitiesParams { - return &ListEdgeRouterPolicyIdentitiesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterPolicyIdentitiesParams contains all the parameters to send to the API endpoint - for the list edge router policy identities operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterPolicyIdentitiesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router policy identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterPolicyIdentitiesParams) WithDefaults() *ListEdgeRouterPolicyIdentitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router policy identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterPolicyIdentitiesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterPolicyIdentitiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) WithContext(ctx context.Context) *ListEdgeRouterPolicyIdentitiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterPolicyIdentitiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) WithID(id string) *ListEdgeRouterPolicyIdentitiesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list edge router policy identities params -func (o *ListEdgeRouterPolicyIdentitiesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterPolicyIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_responses.go b/rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_responses.go deleted file mode 100644 index 6b9021ae7..000000000 --- a/rest_management_api_client/edge_router_policy/list_edge_router_policy_identities_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterPolicyIdentitiesReader is a Reader for the ListEdgeRouterPolicyIdentities structure. -type ListEdgeRouterPolicyIdentitiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterPolicyIdentitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterPolicyIdentitiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListEdgeRouterPolicyIdentitiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListEdgeRouterPolicyIdentitiesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterPolicyIdentitiesOK creates a ListEdgeRouterPolicyIdentitiesOK with default headers values -func NewListEdgeRouterPolicyIdentitiesOK() *ListEdgeRouterPolicyIdentitiesOK { - return &ListEdgeRouterPolicyIdentitiesOK{} -} - -/* ListEdgeRouterPolicyIdentitiesOK describes a response with status code 200, with default header values. - -A list of identities -*/ -type ListEdgeRouterPolicyIdentitiesOK struct { - Payload *rest_model.ListIdentitiesEnvelope -} - -func (o *ListEdgeRouterPolicyIdentitiesOK) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}/identities][%d] listEdgeRouterPolicyIdentitiesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterPolicyIdentitiesOK) GetPayload() *rest_model.ListIdentitiesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPolicyIdentitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListIdentitiesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterPolicyIdentitiesUnauthorized creates a ListEdgeRouterPolicyIdentitiesUnauthorized with default headers values -func NewListEdgeRouterPolicyIdentitiesUnauthorized() *ListEdgeRouterPolicyIdentitiesUnauthorized { - return &ListEdgeRouterPolicyIdentitiesUnauthorized{} -} - -/* ListEdgeRouterPolicyIdentitiesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterPolicyIdentitiesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterPolicyIdentitiesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}/identities][%d] listEdgeRouterPolicyIdentitiesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterPolicyIdentitiesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPolicyIdentitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterPolicyIdentitiesNotFound creates a ListEdgeRouterPolicyIdentitiesNotFound with default headers values -func NewListEdgeRouterPolicyIdentitiesNotFound() *ListEdgeRouterPolicyIdentitiesNotFound { - return &ListEdgeRouterPolicyIdentitiesNotFound{} -} - -/* ListEdgeRouterPolicyIdentitiesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListEdgeRouterPolicyIdentitiesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterPolicyIdentitiesNotFound) Error() string { - return fmt.Sprintf("[GET /edge-router-policies/{id}/identities][%d] listEdgeRouterPolicyIdentitiesNotFound %+v", 404, o.Payload) -} -func (o *ListEdgeRouterPolicyIdentitiesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterPolicyIdentitiesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/patch_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/patch_edge_router_policy_parameters.go deleted file mode 100644 index eefa3c52d..000000000 --- a/rest_management_api_client/edge_router_policy/patch_edge_router_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchEdgeRouterPolicyParams creates a new PatchEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchEdgeRouterPolicyParams() *PatchEdgeRouterPolicyParams { - return &PatchEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchEdgeRouterPolicyParamsWithTimeout creates a new PatchEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewPatchEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *PatchEdgeRouterPolicyParams { - return &PatchEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewPatchEdgeRouterPolicyParamsWithContext creates a new PatchEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewPatchEdgeRouterPolicyParamsWithContext(ctx context.Context) *PatchEdgeRouterPolicyParams { - return &PatchEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewPatchEdgeRouterPolicyParamsWithHTTPClient creates a new PatchEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *PatchEdgeRouterPolicyParams { - return &PatchEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* PatchEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the patch edge router policy operation. - - Typically these are written to a http.Request. -*/ -type PatchEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Policy. - - An edge router policy patch object - */ - Policy *rest_model.EdgeRouterPolicyPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchEdgeRouterPolicyParams) WithDefaults() *PatchEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *PatchEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) WithContext(ctx context.Context) *PatchEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *PatchEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) WithID(id string) *PatchEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WithPolicy adds the policy to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) WithPolicy(policy *rest_model.EdgeRouterPolicyPatch) *PatchEdgeRouterPolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the patch edge router policy params -func (o *PatchEdgeRouterPolicyParams) SetPolicy(policy *rest_model.EdgeRouterPolicyPatch) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/patch_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/patch_edge_router_policy_responses.go deleted file mode 100644 index f05274951..000000000 --- a/rest_management_api_client/edge_router_policy/patch_edge_router_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchEdgeRouterPolicyReader is a Reader for the PatchEdgeRouterPolicy structure. -type PatchEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchEdgeRouterPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchEdgeRouterPolicyOK creates a PatchEdgeRouterPolicyOK with default headers values -func NewPatchEdgeRouterPolicyOK() *PatchEdgeRouterPolicyOK { - return &PatchEdgeRouterPolicyOK{} -} - -/* PatchEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchEdgeRouterPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *PatchEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[PATCH /edge-router-policies/{id}][%d] patchEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *PatchEdgeRouterPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchEdgeRouterPolicyBadRequest creates a PatchEdgeRouterPolicyBadRequest with default headers values -func NewPatchEdgeRouterPolicyBadRequest() *PatchEdgeRouterPolicyBadRequest { - return &PatchEdgeRouterPolicyBadRequest{} -} - -/* PatchEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[PATCH /edge-router-policies/{id}][%d] patchEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *PatchEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchEdgeRouterPolicyUnauthorized creates a PatchEdgeRouterPolicyUnauthorized with default headers values -func NewPatchEdgeRouterPolicyUnauthorized() *PatchEdgeRouterPolicyUnauthorized { - return &PatchEdgeRouterPolicyUnauthorized{} -} - -/* PatchEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /edge-router-policies/{id}][%d] patchEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *PatchEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchEdgeRouterPolicyNotFound creates a PatchEdgeRouterPolicyNotFound with default headers values -func NewPatchEdgeRouterPolicyNotFound() *PatchEdgeRouterPolicyNotFound { - return &PatchEdgeRouterPolicyNotFound{} -} - -/* PatchEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchEdgeRouterPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchEdgeRouterPolicyNotFound) Error() string { - return fmt.Sprintf("[PATCH /edge-router-policies/{id}][%d] patchEdgeRouterPolicyNotFound %+v", 404, o.Payload) -} -func (o *PatchEdgeRouterPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchEdgeRouterPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/edge_router_policy/update_edge_router_policy_parameters.go b/rest_management_api_client/edge_router_policy/update_edge_router_policy_parameters.go deleted file mode 100644 index 96f9e6b29..000000000 --- a/rest_management_api_client/edge_router_policy/update_edge_router_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateEdgeRouterPolicyParams creates a new UpdateEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateEdgeRouterPolicyParams() *UpdateEdgeRouterPolicyParams { - return &UpdateEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateEdgeRouterPolicyParamsWithTimeout creates a new UpdateEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewUpdateEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *UpdateEdgeRouterPolicyParams { - return &UpdateEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewUpdateEdgeRouterPolicyParamsWithContext creates a new UpdateEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewUpdateEdgeRouterPolicyParamsWithContext(ctx context.Context) *UpdateEdgeRouterPolicyParams { - return &UpdateEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewUpdateEdgeRouterPolicyParamsWithHTTPClient creates a new UpdateEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *UpdateEdgeRouterPolicyParams { - return &UpdateEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* UpdateEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the update edge router policy operation. - - Typically these are written to a http.Request. -*/ -type UpdateEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Policy. - - An edge router policy update object - */ - Policy *rest_model.EdgeRouterPolicyUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateEdgeRouterPolicyParams) WithDefaults() *UpdateEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *UpdateEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) WithContext(ctx context.Context) *UpdateEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *UpdateEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) WithID(id string) *UpdateEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WithPolicy adds the policy to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) WithPolicy(policy *rest_model.EdgeRouterPolicyUpdate) *UpdateEdgeRouterPolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the update edge router policy params -func (o *UpdateEdgeRouterPolicyParams) SetPolicy(policy *rest_model.EdgeRouterPolicyUpdate) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/edge_router_policy/update_edge_router_policy_responses.go b/rest_management_api_client/edge_router_policy/update_edge_router_policy_responses.go deleted file mode 100644 index ba574cc83..000000000 --- a/rest_management_api_client/edge_router_policy/update_edge_router_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateEdgeRouterPolicyReader is a Reader for the UpdateEdgeRouterPolicy structure. -type UpdateEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateEdgeRouterPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateEdgeRouterPolicyOK creates a UpdateEdgeRouterPolicyOK with default headers values -func NewUpdateEdgeRouterPolicyOK() *UpdateEdgeRouterPolicyOK { - return &UpdateEdgeRouterPolicyOK{} -} - -/* UpdateEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateEdgeRouterPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[PUT /edge-router-policies/{id}][%d] updateEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *UpdateEdgeRouterPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEdgeRouterPolicyBadRequest creates a UpdateEdgeRouterPolicyBadRequest with default headers values -func NewUpdateEdgeRouterPolicyBadRequest() *UpdateEdgeRouterPolicyBadRequest { - return &UpdateEdgeRouterPolicyBadRequest{} -} - -/* UpdateEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[PUT /edge-router-policies/{id}][%d] updateEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *UpdateEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEdgeRouterPolicyUnauthorized creates a UpdateEdgeRouterPolicyUnauthorized with default headers values -func NewUpdateEdgeRouterPolicyUnauthorized() *UpdateEdgeRouterPolicyUnauthorized { - return &UpdateEdgeRouterPolicyUnauthorized{} -} - -/* UpdateEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[PUT /edge-router-policies/{id}][%d] updateEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateEdgeRouterPolicyNotFound creates a UpdateEdgeRouterPolicyNotFound with default headers values -func NewUpdateEdgeRouterPolicyNotFound() *UpdateEdgeRouterPolicyNotFound { - return &UpdateEdgeRouterPolicyNotFound{} -} - -/* UpdateEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateEdgeRouterPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateEdgeRouterPolicyNotFound) Error() string { - return fmt.Sprintf("[PUT /edge-router-policies/{id}][%d] updateEdgeRouterPolicyNotFound %+v", 404, o.Payload) -} -func (o *UpdateEdgeRouterPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateEdgeRouterPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/enrollment/create_enrollment_parameters.go b/rest_management_api_client/enrollment/create_enrollment_parameters.go deleted file mode 100644 index a36a8caaf..000000000 --- a/rest_management_api_client/enrollment/create_enrollment_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateEnrollmentParams creates a new CreateEnrollmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateEnrollmentParams() *CreateEnrollmentParams { - return &CreateEnrollmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateEnrollmentParamsWithTimeout creates a new CreateEnrollmentParams object -// with the ability to set a timeout on a request. -func NewCreateEnrollmentParamsWithTimeout(timeout time.Duration) *CreateEnrollmentParams { - return &CreateEnrollmentParams{ - timeout: timeout, - } -} - -// NewCreateEnrollmentParamsWithContext creates a new CreateEnrollmentParams object -// with the ability to set a context for a request. -func NewCreateEnrollmentParamsWithContext(ctx context.Context) *CreateEnrollmentParams { - return &CreateEnrollmentParams{ - Context: ctx, - } -} - -// NewCreateEnrollmentParamsWithHTTPClient creates a new CreateEnrollmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateEnrollmentParamsWithHTTPClient(client *http.Client) *CreateEnrollmentParams { - return &CreateEnrollmentParams{ - HTTPClient: client, - } -} - -/* CreateEnrollmentParams contains all the parameters to send to the API endpoint - for the create enrollment operation. - - Typically these are written to a http.Request. -*/ -type CreateEnrollmentParams struct { - - /* Enrollment. - - An enrollment to create - */ - Enrollment *rest_model.EnrollmentCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEnrollmentParams) WithDefaults() *CreateEnrollmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateEnrollmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create enrollment params -func (o *CreateEnrollmentParams) WithTimeout(timeout time.Duration) *CreateEnrollmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create enrollment params -func (o *CreateEnrollmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create enrollment params -func (o *CreateEnrollmentParams) WithContext(ctx context.Context) *CreateEnrollmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create enrollment params -func (o *CreateEnrollmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create enrollment params -func (o *CreateEnrollmentParams) WithHTTPClient(client *http.Client) *CreateEnrollmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create enrollment params -func (o *CreateEnrollmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithEnrollment adds the enrollment to the create enrollment params -func (o *CreateEnrollmentParams) WithEnrollment(enrollment *rest_model.EnrollmentCreate) *CreateEnrollmentParams { - o.SetEnrollment(enrollment) - return o -} - -// SetEnrollment adds the enrollment to the create enrollment params -func (o *CreateEnrollmentParams) SetEnrollment(enrollment *rest_model.EnrollmentCreate) { - o.Enrollment = enrollment -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Enrollment != nil { - if err := r.SetBodyParam(o.Enrollment); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/enrollment/create_enrollment_responses.go b/rest_management_api_client/enrollment/create_enrollment_responses.go deleted file mode 100644 index 08dbc3e18..000000000 --- a/rest_management_api_client/enrollment/create_enrollment_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateEnrollmentReader is a Reader for the CreateEnrollment structure. -type CreateEnrollmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateEnrollmentCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateEnrollmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateEnrollmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateEnrollmentConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateEnrollmentCreated creates a CreateEnrollmentCreated with default headers values -func NewCreateEnrollmentCreated() *CreateEnrollmentCreated { - return &CreateEnrollmentCreated{} -} - -/* CreateEnrollmentCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateEnrollmentCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateEnrollmentCreated) Error() string { - return fmt.Sprintf("[POST /enrollments][%d] createEnrollmentCreated %+v", 201, o.Payload) -} -func (o *CreateEnrollmentCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateEnrollmentCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEnrollmentBadRequest creates a CreateEnrollmentBadRequest with default headers values -func NewCreateEnrollmentBadRequest() *CreateEnrollmentBadRequest { - return &CreateEnrollmentBadRequest{} -} - -/* CreateEnrollmentBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateEnrollmentBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEnrollmentBadRequest) Error() string { - return fmt.Sprintf("[POST /enrollments][%d] createEnrollmentBadRequest %+v", 400, o.Payload) -} -func (o *CreateEnrollmentBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEnrollmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEnrollmentUnauthorized creates a CreateEnrollmentUnauthorized with default headers values -func NewCreateEnrollmentUnauthorized() *CreateEnrollmentUnauthorized { - return &CreateEnrollmentUnauthorized{} -} - -/* CreateEnrollmentUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateEnrollmentUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEnrollmentUnauthorized) Error() string { - return fmt.Sprintf("[POST /enrollments][%d] createEnrollmentUnauthorized %+v", 401, o.Payload) -} -func (o *CreateEnrollmentUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEnrollmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateEnrollmentConflict creates a CreateEnrollmentConflict with default headers values -func NewCreateEnrollmentConflict() *CreateEnrollmentConflict { - return &CreateEnrollmentConflict{} -} - -/* CreateEnrollmentConflict describes a response with status code 409, with default header values. - -The request could not be completed due to a conflict of configuration or state -*/ -type CreateEnrollmentConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateEnrollmentConflict) Error() string { - return fmt.Sprintf("[POST /enrollments][%d] createEnrollmentConflict %+v", 409, o.Payload) -} -func (o *CreateEnrollmentConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateEnrollmentConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/enrollment/delete_enrollment_parameters.go b/rest_management_api_client/enrollment/delete_enrollment_parameters.go deleted file mode 100644 index c5b9cd2bb..000000000 --- a/rest_management_api_client/enrollment/delete_enrollment_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEnrollmentParams creates a new DeleteEnrollmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteEnrollmentParams() *DeleteEnrollmentParams { - return &DeleteEnrollmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteEnrollmentParamsWithTimeout creates a new DeleteEnrollmentParams object -// with the ability to set a timeout on a request. -func NewDeleteEnrollmentParamsWithTimeout(timeout time.Duration) *DeleteEnrollmentParams { - return &DeleteEnrollmentParams{ - timeout: timeout, - } -} - -// NewDeleteEnrollmentParamsWithContext creates a new DeleteEnrollmentParams object -// with the ability to set a context for a request. -func NewDeleteEnrollmentParamsWithContext(ctx context.Context) *DeleteEnrollmentParams { - return &DeleteEnrollmentParams{ - Context: ctx, - } -} - -// NewDeleteEnrollmentParamsWithHTTPClient creates a new DeleteEnrollmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteEnrollmentParamsWithHTTPClient(client *http.Client) *DeleteEnrollmentParams { - return &DeleteEnrollmentParams{ - HTTPClient: client, - } -} - -/* DeleteEnrollmentParams contains all the parameters to send to the API endpoint - for the delete enrollment operation. - - Typically these are written to a http.Request. -*/ -type DeleteEnrollmentParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEnrollmentParams) WithDefaults() *DeleteEnrollmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteEnrollmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete enrollment params -func (o *DeleteEnrollmentParams) WithTimeout(timeout time.Duration) *DeleteEnrollmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete enrollment params -func (o *DeleteEnrollmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete enrollment params -func (o *DeleteEnrollmentParams) WithContext(ctx context.Context) *DeleteEnrollmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete enrollment params -func (o *DeleteEnrollmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete enrollment params -func (o *DeleteEnrollmentParams) WithHTTPClient(client *http.Client) *DeleteEnrollmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete enrollment params -func (o *DeleteEnrollmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete enrollment params -func (o *DeleteEnrollmentParams) WithID(id string) *DeleteEnrollmentParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete enrollment params -func (o *DeleteEnrollmentParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/enrollment/delete_enrollment_responses.go b/rest_management_api_client/enrollment/delete_enrollment_responses.go deleted file mode 100644 index fa4764b23..000000000 --- a/rest_management_api_client/enrollment/delete_enrollment_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteEnrollmentReader is a Reader for the DeleteEnrollment structure. -type DeleteEnrollmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteEnrollmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteEnrollmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteEnrollmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteEnrollmentOK creates a DeleteEnrollmentOK with default headers values -func NewDeleteEnrollmentOK() *DeleteEnrollmentOK { - return &DeleteEnrollmentOK{} -} - -/* DeleteEnrollmentOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteEnrollmentOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteEnrollmentOK) Error() string { - return fmt.Sprintf("[DELETE /enrollments/{id}][%d] deleteEnrollmentOK %+v", 200, o.Payload) -} -func (o *DeleteEnrollmentOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteEnrollmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEnrollmentBadRequest creates a DeleteEnrollmentBadRequest with default headers values -func NewDeleteEnrollmentBadRequest() *DeleteEnrollmentBadRequest { - return &DeleteEnrollmentBadRequest{} -} - -/* DeleteEnrollmentBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteEnrollmentBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEnrollmentBadRequest) Error() string { - return fmt.Sprintf("[DELETE /enrollments/{id}][%d] deleteEnrollmentBadRequest %+v", 400, o.Payload) -} -func (o *DeleteEnrollmentBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEnrollmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteEnrollmentUnauthorized creates a DeleteEnrollmentUnauthorized with default headers values -func NewDeleteEnrollmentUnauthorized() *DeleteEnrollmentUnauthorized { - return &DeleteEnrollmentUnauthorized{} -} - -/* DeleteEnrollmentUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteEnrollmentUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteEnrollmentUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /enrollments/{id}][%d] deleteEnrollmentUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteEnrollmentUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteEnrollmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/enrollment/detail_enrollment_parameters.go b/rest_management_api_client/enrollment/detail_enrollment_parameters.go deleted file mode 100644 index 48a8e711a..000000000 --- a/rest_management_api_client/enrollment/detail_enrollment_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailEnrollmentParams creates a new DetailEnrollmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailEnrollmentParams() *DetailEnrollmentParams { - return &DetailEnrollmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailEnrollmentParamsWithTimeout creates a new DetailEnrollmentParams object -// with the ability to set a timeout on a request. -func NewDetailEnrollmentParamsWithTimeout(timeout time.Duration) *DetailEnrollmentParams { - return &DetailEnrollmentParams{ - timeout: timeout, - } -} - -// NewDetailEnrollmentParamsWithContext creates a new DetailEnrollmentParams object -// with the ability to set a context for a request. -func NewDetailEnrollmentParamsWithContext(ctx context.Context) *DetailEnrollmentParams { - return &DetailEnrollmentParams{ - Context: ctx, - } -} - -// NewDetailEnrollmentParamsWithHTTPClient creates a new DetailEnrollmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailEnrollmentParamsWithHTTPClient(client *http.Client) *DetailEnrollmentParams { - return &DetailEnrollmentParams{ - HTTPClient: client, - } -} - -/* DetailEnrollmentParams contains all the parameters to send to the API endpoint - for the detail enrollment operation. - - Typically these are written to a http.Request. -*/ -type DetailEnrollmentParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailEnrollmentParams) WithDefaults() *DetailEnrollmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailEnrollmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail enrollment params -func (o *DetailEnrollmentParams) WithTimeout(timeout time.Duration) *DetailEnrollmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail enrollment params -func (o *DetailEnrollmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail enrollment params -func (o *DetailEnrollmentParams) WithContext(ctx context.Context) *DetailEnrollmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail enrollment params -func (o *DetailEnrollmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail enrollment params -func (o *DetailEnrollmentParams) WithHTTPClient(client *http.Client) *DetailEnrollmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail enrollment params -func (o *DetailEnrollmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail enrollment params -func (o *DetailEnrollmentParams) WithID(id string) *DetailEnrollmentParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail enrollment params -func (o *DetailEnrollmentParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/enrollment/detail_enrollment_responses.go b/rest_management_api_client/enrollment/detail_enrollment_responses.go deleted file mode 100644 index e3d3f8721..000000000 --- a/rest_management_api_client/enrollment/detail_enrollment_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailEnrollmentReader is a Reader for the DetailEnrollment structure. -type DetailEnrollmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailEnrollmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailEnrollmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailEnrollmentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailEnrollmentOK creates a DetailEnrollmentOK with default headers values -func NewDetailEnrollmentOK() *DetailEnrollmentOK { - return &DetailEnrollmentOK{} -} - -/* DetailEnrollmentOK describes a response with status code 200, with default header values. - -A singular enrollment resource -*/ -type DetailEnrollmentOK struct { - Payload *rest_model.DetailEnrollmentEnvelope -} - -func (o *DetailEnrollmentOK) Error() string { - return fmt.Sprintf("[GET /enrollments/{id}][%d] detailEnrollmentOK %+v", 200, o.Payload) -} -func (o *DetailEnrollmentOK) GetPayload() *rest_model.DetailEnrollmentEnvelope { - return o.Payload -} - -func (o *DetailEnrollmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailEnrollmentEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailEnrollmentUnauthorized creates a DetailEnrollmentUnauthorized with default headers values -func NewDetailEnrollmentUnauthorized() *DetailEnrollmentUnauthorized { - return &DetailEnrollmentUnauthorized{} -} - -/* DetailEnrollmentUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailEnrollmentUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailEnrollmentUnauthorized) Error() string { - return fmt.Sprintf("[GET /enrollments/{id}][%d] detailEnrollmentUnauthorized %+v", 401, o.Payload) -} -func (o *DetailEnrollmentUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailEnrollmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailEnrollmentNotFound creates a DetailEnrollmentNotFound with default headers values -func NewDetailEnrollmentNotFound() *DetailEnrollmentNotFound { - return &DetailEnrollmentNotFound{} -} - -/* DetailEnrollmentNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailEnrollmentNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailEnrollmentNotFound) Error() string { - return fmt.Sprintf("[GET /enrollments/{id}][%d] detailEnrollmentNotFound %+v", 404, o.Payload) -} -func (o *DetailEnrollmentNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailEnrollmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/enrollment/enrollment_client.go b/rest_management_api_client/enrollment/enrollment_client.go deleted file mode 100644 index f9c057b14..000000000 --- a/rest_management_api_client/enrollment/enrollment_client.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new enrollment API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for enrollment API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateEnrollment(params *CreateEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEnrollmentCreated, error) - - DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnrollmentOK, error) - - DetailEnrollment(params *DetailEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEnrollmentOK, error) - - ListEnrollments(params *ListEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEnrollmentsOK, error) - - RefreshEnrollment(params *RefreshEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshEnrollmentOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateEnrollment creates an outstanding enrollment for an identity - - Creates a new OTT, OTTCA, or UPDB enrollment for a specific identity. If an enrollment of the same type is already outstanding the request will fail with a 409 conflict. If desired, an existing enrollment can be refreshed by `enrollments/:id/refresh` or deleted. -*/ -func (a *Client) CreateEnrollment(params *CreateEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEnrollmentCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateEnrollmentParams() - } - op := &runtime.ClientOperation{ - ID: "createEnrollment", - Method: "POST", - PathPattern: "/enrollments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateEnrollmentReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateEnrollmentCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteEnrollment deletes an outstanding enrollment - - Delete an outstanding enrollment by id. Requires admin access. -*/ -func (a *Client) DeleteEnrollment(params *DeleteEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEnrollmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteEnrollmentParams() - } - op := &runtime.ClientOperation{ - ID: "deleteEnrollment", - Method: "DELETE", - PathPattern: "/enrollments/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteEnrollmentReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteEnrollmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailEnrollment retrieves an outstanding enrollment - - Retrieves a single outstanding enrollment by id. Requires admin access. -*/ -func (a *Client) DetailEnrollment(params *DetailEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEnrollmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailEnrollmentParams() - } - op := &runtime.ClientOperation{ - ID: "detailEnrollment", - Method: "GET", - PathPattern: "/enrollments/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailEnrollmentReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailEnrollmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListEnrollments lists outstanding enrollments - - Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEnrollments(params *ListEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEnrollmentsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEnrollmentsParams() - } - op := &runtime.ClientOperation{ - ID: "listEnrollments", - Method: "GET", - PathPattern: "/enrollments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEnrollmentsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEnrollmentsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEnrollments: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - RefreshEnrollment refreshes an enrollment record s expiration window - - For expired or unexpired enrollments, reset the expiration window. A new JWT will be generated and must be used for the enrollment. -*/ -func (a *Client) RefreshEnrollment(params *RefreshEnrollmentParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RefreshEnrollmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRefreshEnrollmentParams() - } - op := &runtime.ClientOperation{ - ID: "refreshEnrollment", - Method: "POST", - PathPattern: "/enrollments/{id}/refresh", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &RefreshEnrollmentReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*RefreshEnrollmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for refreshEnrollment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/enrollment/list_enrollments_parameters.go b/rest_management_api_client/enrollment/list_enrollments_parameters.go deleted file mode 100644 index 8f5992ace..000000000 --- a/rest_management_api_client/enrollment/list_enrollments_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEnrollmentsParams creates a new ListEnrollmentsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEnrollmentsParams() *ListEnrollmentsParams { - return &ListEnrollmentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEnrollmentsParamsWithTimeout creates a new ListEnrollmentsParams object -// with the ability to set a timeout on a request. -func NewListEnrollmentsParamsWithTimeout(timeout time.Duration) *ListEnrollmentsParams { - return &ListEnrollmentsParams{ - timeout: timeout, - } -} - -// NewListEnrollmentsParamsWithContext creates a new ListEnrollmentsParams object -// with the ability to set a context for a request. -func NewListEnrollmentsParamsWithContext(ctx context.Context) *ListEnrollmentsParams { - return &ListEnrollmentsParams{ - Context: ctx, - } -} - -// NewListEnrollmentsParamsWithHTTPClient creates a new ListEnrollmentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEnrollmentsParamsWithHTTPClient(client *http.Client) *ListEnrollmentsParams { - return &ListEnrollmentsParams{ - HTTPClient: client, - } -} - -/* ListEnrollmentsParams contains all the parameters to send to the API endpoint - for the list enrollments operation. - - Typically these are written to a http.Request. -*/ -type ListEnrollmentsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list enrollments params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEnrollmentsParams) WithDefaults() *ListEnrollmentsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list enrollments params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEnrollmentsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list enrollments params -func (o *ListEnrollmentsParams) WithTimeout(timeout time.Duration) *ListEnrollmentsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list enrollments params -func (o *ListEnrollmentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list enrollments params -func (o *ListEnrollmentsParams) WithContext(ctx context.Context) *ListEnrollmentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list enrollments params -func (o *ListEnrollmentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list enrollments params -func (o *ListEnrollmentsParams) WithHTTPClient(client *http.Client) *ListEnrollmentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list enrollments params -func (o *ListEnrollmentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list enrollments params -func (o *ListEnrollmentsParams) WithFilter(filter *string) *ListEnrollmentsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list enrollments params -func (o *ListEnrollmentsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list enrollments params -func (o *ListEnrollmentsParams) WithLimit(limit *int64) *ListEnrollmentsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list enrollments params -func (o *ListEnrollmentsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list enrollments params -func (o *ListEnrollmentsParams) WithOffset(offset *int64) *ListEnrollmentsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list enrollments params -func (o *ListEnrollmentsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEnrollmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/enrollment/list_enrollments_responses.go b/rest_management_api_client/enrollment/list_enrollments_responses.go deleted file mode 100644 index 0997622f4..000000000 --- a/rest_management_api_client/enrollment/list_enrollments_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEnrollmentsReader is a Reader for the ListEnrollments structure. -type ListEnrollmentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEnrollmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEnrollmentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListEnrollmentsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListEnrollmentsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEnrollmentsOK creates a ListEnrollmentsOK with default headers values -func NewListEnrollmentsOK() *ListEnrollmentsOK { - return &ListEnrollmentsOK{} -} - -/* ListEnrollmentsOK describes a response with status code 200, with default header values. - -A list of enrollments -*/ -type ListEnrollmentsOK struct { - Payload *rest_model.ListEnrollmentsEnvelope -} - -func (o *ListEnrollmentsOK) Error() string { - return fmt.Sprintf("[GET /enrollments][%d] listEnrollmentsOK %+v", 200, o.Payload) -} -func (o *ListEnrollmentsOK) GetPayload() *rest_model.ListEnrollmentsEnvelope { - return o.Payload -} - -func (o *ListEnrollmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEnrollmentsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEnrollmentsBadRequest creates a ListEnrollmentsBadRequest with default headers values -func NewListEnrollmentsBadRequest() *ListEnrollmentsBadRequest { - return &ListEnrollmentsBadRequest{} -} - -/* ListEnrollmentsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListEnrollmentsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEnrollmentsBadRequest) Error() string { - return fmt.Sprintf("[GET /enrollments][%d] listEnrollmentsBadRequest %+v", 400, o.Payload) -} -func (o *ListEnrollmentsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEnrollmentsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEnrollmentsUnauthorized creates a ListEnrollmentsUnauthorized with default headers values -func NewListEnrollmentsUnauthorized() *ListEnrollmentsUnauthorized { - return &ListEnrollmentsUnauthorized{} -} - -/* ListEnrollmentsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEnrollmentsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEnrollmentsUnauthorized) Error() string { - return fmt.Sprintf("[GET /enrollments][%d] listEnrollmentsUnauthorized %+v", 401, o.Payload) -} -func (o *ListEnrollmentsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEnrollmentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/enrollment/refresh_enrollment_parameters.go b/rest_management_api_client/enrollment/refresh_enrollment_parameters.go deleted file mode 100644 index ef83982a5..000000000 --- a/rest_management_api_client/enrollment/refresh_enrollment_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewRefreshEnrollmentParams creates a new RefreshEnrollmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRefreshEnrollmentParams() *RefreshEnrollmentParams { - return &RefreshEnrollmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRefreshEnrollmentParamsWithTimeout creates a new RefreshEnrollmentParams object -// with the ability to set a timeout on a request. -func NewRefreshEnrollmentParamsWithTimeout(timeout time.Duration) *RefreshEnrollmentParams { - return &RefreshEnrollmentParams{ - timeout: timeout, - } -} - -// NewRefreshEnrollmentParamsWithContext creates a new RefreshEnrollmentParams object -// with the ability to set a context for a request. -func NewRefreshEnrollmentParamsWithContext(ctx context.Context) *RefreshEnrollmentParams { - return &RefreshEnrollmentParams{ - Context: ctx, - } -} - -// NewRefreshEnrollmentParamsWithHTTPClient creates a new RefreshEnrollmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewRefreshEnrollmentParamsWithHTTPClient(client *http.Client) *RefreshEnrollmentParams { - return &RefreshEnrollmentParams{ - HTTPClient: client, - } -} - -/* RefreshEnrollmentParams contains all the parameters to send to the API endpoint - for the refresh enrollment operation. - - Typically these are written to a http.Request. -*/ -type RefreshEnrollmentParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Refresh. - - An enrollment refresh request - */ - Refresh *rest_model.EnrollmentRefresh - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the refresh enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RefreshEnrollmentParams) WithDefaults() *RefreshEnrollmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the refresh enrollment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RefreshEnrollmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the refresh enrollment params -func (o *RefreshEnrollmentParams) WithTimeout(timeout time.Duration) *RefreshEnrollmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the refresh enrollment params -func (o *RefreshEnrollmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the refresh enrollment params -func (o *RefreshEnrollmentParams) WithContext(ctx context.Context) *RefreshEnrollmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the refresh enrollment params -func (o *RefreshEnrollmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the refresh enrollment params -func (o *RefreshEnrollmentParams) WithHTTPClient(client *http.Client) *RefreshEnrollmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the refresh enrollment params -func (o *RefreshEnrollmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the refresh enrollment params -func (o *RefreshEnrollmentParams) WithID(id string) *RefreshEnrollmentParams { - o.SetID(id) - return o -} - -// SetID adds the id to the refresh enrollment params -func (o *RefreshEnrollmentParams) SetID(id string) { - o.ID = id -} - -// WithRefresh adds the refresh to the refresh enrollment params -func (o *RefreshEnrollmentParams) WithRefresh(refresh *rest_model.EnrollmentRefresh) *RefreshEnrollmentParams { - o.SetRefresh(refresh) - return o -} - -// SetRefresh adds the refresh to the refresh enrollment params -func (o *RefreshEnrollmentParams) SetRefresh(refresh *rest_model.EnrollmentRefresh) { - o.Refresh = refresh -} - -// WriteToRequest writes these params to a swagger request -func (o *RefreshEnrollmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Refresh != nil { - if err := r.SetBodyParam(o.Refresh); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/enrollment/refresh_enrollment_responses.go b/rest_management_api_client/enrollment/refresh_enrollment_responses.go deleted file mode 100644 index e4376f06d..000000000 --- a/rest_management_api_client/enrollment/refresh_enrollment_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// RefreshEnrollmentReader is a Reader for the RefreshEnrollment structure. -type RefreshEnrollmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RefreshEnrollmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRefreshEnrollmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewRefreshEnrollmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewRefreshEnrollmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewRefreshEnrollmentOK creates a RefreshEnrollmentOK with default headers values -func NewRefreshEnrollmentOK() *RefreshEnrollmentOK { - return &RefreshEnrollmentOK{} -} - -/* RefreshEnrollmentOK describes a response with status code 200, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type RefreshEnrollmentOK struct { - Payload *rest_model.CreateEnvelope -} - -func (o *RefreshEnrollmentOK) Error() string { - return fmt.Sprintf("[POST /enrollments/{id}/refresh][%d] refreshEnrollmentOK %+v", 200, o.Payload) -} -func (o *RefreshEnrollmentOK) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *RefreshEnrollmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRefreshEnrollmentBadRequest creates a RefreshEnrollmentBadRequest with default headers values -func NewRefreshEnrollmentBadRequest() *RefreshEnrollmentBadRequest { - return &RefreshEnrollmentBadRequest{} -} - -/* RefreshEnrollmentBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type RefreshEnrollmentBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *RefreshEnrollmentBadRequest) Error() string { - return fmt.Sprintf("[POST /enrollments/{id}/refresh][%d] refreshEnrollmentBadRequest %+v", 400, o.Payload) -} -func (o *RefreshEnrollmentBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *RefreshEnrollmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRefreshEnrollmentUnauthorized creates a RefreshEnrollmentUnauthorized with default headers values -func NewRefreshEnrollmentUnauthorized() *RefreshEnrollmentUnauthorized { - return &RefreshEnrollmentUnauthorized{} -} - -/* RefreshEnrollmentUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type RefreshEnrollmentUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *RefreshEnrollmentUnauthorized) Error() string { - return fmt.Sprintf("[POST /enrollments/{id}/refresh][%d] refreshEnrollmentUnauthorized %+v", 401, o.Payload) -} -func (o *RefreshEnrollmentUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *RefreshEnrollmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/create_external_jwt_signer_parameters.go b/rest_management_api_client/external_jwt_signer/create_external_jwt_signer_parameters.go deleted file mode 100644 index 5aa119c25..000000000 --- a/rest_management_api_client/external_jwt_signer/create_external_jwt_signer_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateExternalJWTSignerParams creates a new CreateExternalJWTSignerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateExternalJWTSignerParams() *CreateExternalJWTSignerParams { - return &CreateExternalJWTSignerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateExternalJWTSignerParamsWithTimeout creates a new CreateExternalJWTSignerParams object -// with the ability to set a timeout on a request. -func NewCreateExternalJWTSignerParamsWithTimeout(timeout time.Duration) *CreateExternalJWTSignerParams { - return &CreateExternalJWTSignerParams{ - timeout: timeout, - } -} - -// NewCreateExternalJWTSignerParamsWithContext creates a new CreateExternalJWTSignerParams object -// with the ability to set a context for a request. -func NewCreateExternalJWTSignerParamsWithContext(ctx context.Context) *CreateExternalJWTSignerParams { - return &CreateExternalJWTSignerParams{ - Context: ctx, - } -} - -// NewCreateExternalJWTSignerParamsWithHTTPClient creates a new CreateExternalJWTSignerParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateExternalJWTSignerParamsWithHTTPClient(client *http.Client) *CreateExternalJWTSignerParams { - return &CreateExternalJWTSignerParams{ - HTTPClient: client, - } -} - -/* CreateExternalJWTSignerParams contains all the parameters to send to the API endpoint - for the create external Jwt signer operation. - - Typically these are written to a http.Request. -*/ -type CreateExternalJWTSignerParams struct { - - /* ExternalJWTSigner. - - An External JWT Signer to create - */ - ExternalJWTSigner *rest_model.ExternalJWTSignerCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateExternalJWTSignerParams) WithDefaults() *CreateExternalJWTSignerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateExternalJWTSignerParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) WithTimeout(timeout time.Duration) *CreateExternalJWTSignerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) WithContext(ctx context.Context) *CreateExternalJWTSignerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) WithHTTPClient(client *http.Client) *CreateExternalJWTSignerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExternalJWTSigner adds the externalJWTSigner to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) WithExternalJWTSigner(externalJWTSigner *rest_model.ExternalJWTSignerCreate) *CreateExternalJWTSignerParams { - o.SetExternalJWTSigner(externalJWTSigner) - return o -} - -// SetExternalJWTSigner adds the externalJwtSigner to the create external Jwt signer params -func (o *CreateExternalJWTSignerParams) SetExternalJWTSigner(externalJWTSigner *rest_model.ExternalJWTSignerCreate) { - o.ExternalJWTSigner = externalJWTSigner -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateExternalJWTSignerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.ExternalJWTSigner != nil { - if err := r.SetBodyParam(o.ExternalJWTSigner); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/create_external_jwt_signer_responses.go b/rest_management_api_client/external_jwt_signer/create_external_jwt_signer_responses.go deleted file mode 100644 index 2be4fb7ff..000000000 --- a/rest_management_api_client/external_jwt_signer/create_external_jwt_signer_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateExternalJWTSignerReader is a Reader for the CreateExternalJWTSigner structure. -type CreateExternalJWTSignerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateExternalJWTSignerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateExternalJWTSignerCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateExternalJWTSignerBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateExternalJWTSignerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateExternalJWTSignerCreated creates a CreateExternalJWTSignerCreated with default headers values -func NewCreateExternalJWTSignerCreated() *CreateExternalJWTSignerCreated { - return &CreateExternalJWTSignerCreated{} -} - -/* CreateExternalJWTSignerCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateExternalJWTSignerCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateExternalJWTSignerCreated) Error() string { - return fmt.Sprintf("[POST /external-jwt-signers][%d] createExternalJwtSignerCreated %+v", 201, o.Payload) -} -func (o *CreateExternalJWTSignerCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateExternalJWTSignerCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExternalJWTSignerBadRequest creates a CreateExternalJWTSignerBadRequest with default headers values -func NewCreateExternalJWTSignerBadRequest() *CreateExternalJWTSignerBadRequest { - return &CreateExternalJWTSignerBadRequest{} -} - -/* CreateExternalJWTSignerBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateExternalJWTSignerBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateExternalJWTSignerBadRequest) Error() string { - return fmt.Sprintf("[POST /external-jwt-signers][%d] createExternalJwtSignerBadRequest %+v", 400, o.Payload) -} -func (o *CreateExternalJWTSignerBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateExternalJWTSignerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExternalJWTSignerUnauthorized creates a CreateExternalJWTSignerUnauthorized with default headers values -func NewCreateExternalJWTSignerUnauthorized() *CreateExternalJWTSignerUnauthorized { - return &CreateExternalJWTSignerUnauthorized{} -} - -/* CreateExternalJWTSignerUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateExternalJWTSignerUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateExternalJWTSignerUnauthorized) Error() string { - return fmt.Sprintf("[POST /external-jwt-signers][%d] createExternalJwtSignerUnauthorized %+v", 401, o.Payload) -} -func (o *CreateExternalJWTSignerUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateExternalJWTSignerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/delete_external_jwt_signer_parameters.go b/rest_management_api_client/external_jwt_signer/delete_external_jwt_signer_parameters.go deleted file mode 100644 index 857d1df49..000000000 --- a/rest_management_api_client/external_jwt_signer/delete_external_jwt_signer_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteExternalJWTSignerParams creates a new DeleteExternalJWTSignerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteExternalJWTSignerParams() *DeleteExternalJWTSignerParams { - return &DeleteExternalJWTSignerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteExternalJWTSignerParamsWithTimeout creates a new DeleteExternalJWTSignerParams object -// with the ability to set a timeout on a request. -func NewDeleteExternalJWTSignerParamsWithTimeout(timeout time.Duration) *DeleteExternalJWTSignerParams { - return &DeleteExternalJWTSignerParams{ - timeout: timeout, - } -} - -// NewDeleteExternalJWTSignerParamsWithContext creates a new DeleteExternalJWTSignerParams object -// with the ability to set a context for a request. -func NewDeleteExternalJWTSignerParamsWithContext(ctx context.Context) *DeleteExternalJWTSignerParams { - return &DeleteExternalJWTSignerParams{ - Context: ctx, - } -} - -// NewDeleteExternalJWTSignerParamsWithHTTPClient creates a new DeleteExternalJWTSignerParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteExternalJWTSignerParamsWithHTTPClient(client *http.Client) *DeleteExternalJWTSignerParams { - return &DeleteExternalJWTSignerParams{ - HTTPClient: client, - } -} - -/* DeleteExternalJWTSignerParams contains all the parameters to send to the API endpoint - for the delete external Jwt signer operation. - - Typically these are written to a http.Request. -*/ -type DeleteExternalJWTSignerParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteExternalJWTSignerParams) WithDefaults() *DeleteExternalJWTSignerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteExternalJWTSignerParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) WithTimeout(timeout time.Duration) *DeleteExternalJWTSignerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) WithContext(ctx context.Context) *DeleteExternalJWTSignerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) WithHTTPClient(client *http.Client) *DeleteExternalJWTSignerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) WithID(id string) *DeleteExternalJWTSignerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete external Jwt signer params -func (o *DeleteExternalJWTSignerParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteExternalJWTSignerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/delete_external_jwt_signer_responses.go b/rest_management_api_client/external_jwt_signer/delete_external_jwt_signer_responses.go deleted file mode 100644 index 3c735770b..000000000 --- a/rest_management_api_client/external_jwt_signer/delete_external_jwt_signer_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteExternalJWTSignerReader is a Reader for the DeleteExternalJWTSigner structure. -type DeleteExternalJWTSignerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteExternalJWTSignerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteExternalJWTSignerOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteExternalJWTSignerBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteExternalJWTSignerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteExternalJWTSignerOK creates a DeleteExternalJWTSignerOK with default headers values -func NewDeleteExternalJWTSignerOK() *DeleteExternalJWTSignerOK { - return &DeleteExternalJWTSignerOK{} -} - -/* DeleteExternalJWTSignerOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteExternalJWTSignerOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteExternalJWTSignerOK) Error() string { - return fmt.Sprintf("[DELETE /external-jwt-signers/{id}][%d] deleteExternalJwtSignerOK %+v", 200, o.Payload) -} -func (o *DeleteExternalJWTSignerOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteExternalJWTSignerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteExternalJWTSignerBadRequest creates a DeleteExternalJWTSignerBadRequest with default headers values -func NewDeleteExternalJWTSignerBadRequest() *DeleteExternalJWTSignerBadRequest { - return &DeleteExternalJWTSignerBadRequest{} -} - -/* DeleteExternalJWTSignerBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteExternalJWTSignerBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteExternalJWTSignerBadRequest) Error() string { - return fmt.Sprintf("[DELETE /external-jwt-signers/{id}][%d] deleteExternalJwtSignerBadRequest %+v", 400, o.Payload) -} -func (o *DeleteExternalJWTSignerBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteExternalJWTSignerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteExternalJWTSignerUnauthorized creates a DeleteExternalJWTSignerUnauthorized with default headers values -func NewDeleteExternalJWTSignerUnauthorized() *DeleteExternalJWTSignerUnauthorized { - return &DeleteExternalJWTSignerUnauthorized{} -} - -/* DeleteExternalJWTSignerUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteExternalJWTSignerUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteExternalJWTSignerUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /external-jwt-signers/{id}][%d] deleteExternalJwtSignerUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteExternalJWTSignerUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteExternalJWTSignerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/detail_external_jwt_signer_parameters.go b/rest_management_api_client/external_jwt_signer/detail_external_jwt_signer_parameters.go deleted file mode 100644 index 8c5f4c1d5..000000000 --- a/rest_management_api_client/external_jwt_signer/detail_external_jwt_signer_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailExternalJWTSignerParams creates a new DetailExternalJWTSignerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailExternalJWTSignerParams() *DetailExternalJWTSignerParams { - return &DetailExternalJWTSignerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailExternalJWTSignerParamsWithTimeout creates a new DetailExternalJWTSignerParams object -// with the ability to set a timeout on a request. -func NewDetailExternalJWTSignerParamsWithTimeout(timeout time.Duration) *DetailExternalJWTSignerParams { - return &DetailExternalJWTSignerParams{ - timeout: timeout, - } -} - -// NewDetailExternalJWTSignerParamsWithContext creates a new DetailExternalJWTSignerParams object -// with the ability to set a context for a request. -func NewDetailExternalJWTSignerParamsWithContext(ctx context.Context) *DetailExternalJWTSignerParams { - return &DetailExternalJWTSignerParams{ - Context: ctx, - } -} - -// NewDetailExternalJWTSignerParamsWithHTTPClient creates a new DetailExternalJWTSignerParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailExternalJWTSignerParamsWithHTTPClient(client *http.Client) *DetailExternalJWTSignerParams { - return &DetailExternalJWTSignerParams{ - HTTPClient: client, - } -} - -/* DetailExternalJWTSignerParams contains all the parameters to send to the API endpoint - for the detail external Jwt signer operation. - - Typically these are written to a http.Request. -*/ -type DetailExternalJWTSignerParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailExternalJWTSignerParams) WithDefaults() *DetailExternalJWTSignerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailExternalJWTSignerParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) WithTimeout(timeout time.Duration) *DetailExternalJWTSignerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) WithContext(ctx context.Context) *DetailExternalJWTSignerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) WithHTTPClient(client *http.Client) *DetailExternalJWTSignerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) WithID(id string) *DetailExternalJWTSignerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail external Jwt signer params -func (o *DetailExternalJWTSignerParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailExternalJWTSignerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/detail_external_jwt_signer_responses.go b/rest_management_api_client/external_jwt_signer/detail_external_jwt_signer_responses.go deleted file mode 100644 index 11aaa6d85..000000000 --- a/rest_management_api_client/external_jwt_signer/detail_external_jwt_signer_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailExternalJWTSignerReader is a Reader for the DetailExternalJWTSigner structure. -type DetailExternalJWTSignerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailExternalJWTSignerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailExternalJWTSignerOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailExternalJWTSignerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailExternalJWTSignerNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailExternalJWTSignerOK creates a DetailExternalJWTSignerOK with default headers values -func NewDetailExternalJWTSignerOK() *DetailExternalJWTSignerOK { - return &DetailExternalJWTSignerOK{} -} - -/* DetailExternalJWTSignerOK describes a response with status code 200, with default header values. - -A singular External JWT Signer resource -*/ -type DetailExternalJWTSignerOK struct { - Payload *rest_model.DetailExternalJWTSignerEnvelope -} - -func (o *DetailExternalJWTSignerOK) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers/{id}][%d] detailExternalJwtSignerOK %+v", 200, o.Payload) -} -func (o *DetailExternalJWTSignerOK) GetPayload() *rest_model.DetailExternalJWTSignerEnvelope { - return o.Payload -} - -func (o *DetailExternalJWTSignerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailExternalJWTSignerEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailExternalJWTSignerUnauthorized creates a DetailExternalJWTSignerUnauthorized with default headers values -func NewDetailExternalJWTSignerUnauthorized() *DetailExternalJWTSignerUnauthorized { - return &DetailExternalJWTSignerUnauthorized{} -} - -/* DetailExternalJWTSignerUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailExternalJWTSignerUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailExternalJWTSignerUnauthorized) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers/{id}][%d] detailExternalJwtSignerUnauthorized %+v", 401, o.Payload) -} -func (o *DetailExternalJWTSignerUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailExternalJWTSignerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailExternalJWTSignerNotFound creates a DetailExternalJWTSignerNotFound with default headers values -func NewDetailExternalJWTSignerNotFound() *DetailExternalJWTSignerNotFound { - return &DetailExternalJWTSignerNotFound{} -} - -/* DetailExternalJWTSignerNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailExternalJWTSignerNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailExternalJWTSignerNotFound) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers/{id}][%d] detailExternalJwtSignerNotFound %+v", 404, o.Payload) -} -func (o *DetailExternalJWTSignerNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailExternalJWTSignerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/external_jwt_signer_client.go b/rest_management_api_client/external_jwt_signer/external_jwt_signer_client.go deleted file mode 100644 index 69efb47d0..000000000 --- a/rest_management_api_client/external_jwt_signer/external_jwt_signer_client.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new external jwt signer API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for external jwt signer API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateExternalJWTSigner(params *CreateExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateExternalJWTSignerCreated, error) - - DeleteExternalJWTSigner(params *DeleteExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteExternalJWTSignerOK, error) - - DetailExternalJWTSigner(params *DetailExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailExternalJWTSignerOK, error) - - ListExternalJWTSigners(params *ListExternalJWTSignersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListExternalJWTSignersOK, error) - - PatchExternalJWTSigner(params *PatchExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchExternalJWTSignerOK, error) - - UpdateExternalJWTSigner(params *UpdateExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateExternalJWTSignerOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateExternalJWTSigner creates an external JWT signer - - Creates an External JWT Signer. Requires admin access. -*/ -func (a *Client) CreateExternalJWTSigner(params *CreateExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateExternalJWTSignerCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateExternalJWTSignerParams() - } - op := &runtime.ClientOperation{ - ID: "createExternalJwtSigner", - Method: "POST", - PathPattern: "/external-jwt-signers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateExternalJWTSignerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateExternalJWTSignerCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createExternalJwtSigner: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteExternalJWTSigner deletes an external JWT signer - - Delete an External JWT Signer by id. Requires admin access. - -*/ -func (a *Client) DeleteExternalJWTSigner(params *DeleteExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteExternalJWTSignerOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteExternalJWTSignerParams() - } - op := &runtime.ClientOperation{ - ID: "deleteExternalJwtSigner", - Method: "DELETE", - PathPattern: "/external-jwt-signers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteExternalJWTSignerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteExternalJWTSignerOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteExternalJwtSigner: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailExternalJWTSigner retrieves a single external JWT signer - - Retrieves a single External JWT Signer by id. Requires admin access. -*/ -func (a *Client) DetailExternalJWTSigner(params *DetailExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailExternalJWTSignerOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailExternalJWTSignerParams() - } - op := &runtime.ClientOperation{ - ID: "detailExternalJwtSigner", - Method: "GET", - PathPattern: "/external-jwt-signers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailExternalJWTSignerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailExternalJWTSignerOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailExternalJwtSigner: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListExternalJWTSigners lists external JWT signers - - Retrieves a list of external JWT signers for authentication -*/ -func (a *Client) ListExternalJWTSigners(params *ListExternalJWTSignersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListExternalJWTSignersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListExternalJWTSignersParams() - } - op := &runtime.ClientOperation{ - ID: "listExternalJwtSigners", - Method: "GET", - PathPattern: "/external-jwt-signers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListExternalJWTSignersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListExternalJWTSignersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listExternalJwtSigners: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchExternalJWTSigner updates the supplied fields on an external JWT signer - - Update only the supplied fields on an External JWT Signer by id. Requires admin access. -*/ -func (a *Client) PatchExternalJWTSigner(params *PatchExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchExternalJWTSignerOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchExternalJWTSignerParams() - } - op := &runtime.ClientOperation{ - ID: "patchExternalJwtSigner", - Method: "PATCH", - PathPattern: "/external-jwt-signers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchExternalJWTSignerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchExternalJWTSignerOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchExternalJwtSigner: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateExternalJWTSigner updates all fields on an external JWT signer - - Update all fields on an External JWT Signer by id. Requires admin access. -*/ -func (a *Client) UpdateExternalJWTSigner(params *UpdateExternalJWTSignerParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateExternalJWTSignerOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateExternalJWTSignerParams() - } - op := &runtime.ClientOperation{ - ID: "updateExternalJwtSigner", - Method: "PUT", - PathPattern: "/external-jwt-signers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateExternalJWTSignerReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateExternalJWTSignerOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateExternalJwtSigner: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/external_jwt_signer/list_external_jwt_signers_parameters.go b/rest_management_api_client/external_jwt_signer/list_external_jwt_signers_parameters.go deleted file mode 100644 index 1db550815..000000000 --- a/rest_management_api_client/external_jwt_signer/list_external_jwt_signers_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListExternalJWTSignersParams creates a new ListExternalJWTSignersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListExternalJWTSignersParams() *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListExternalJWTSignersParamsWithTimeout creates a new ListExternalJWTSignersParams object -// with the ability to set a timeout on a request. -func NewListExternalJWTSignersParamsWithTimeout(timeout time.Duration) *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - timeout: timeout, - } -} - -// NewListExternalJWTSignersParamsWithContext creates a new ListExternalJWTSignersParams object -// with the ability to set a context for a request. -func NewListExternalJWTSignersParamsWithContext(ctx context.Context) *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - Context: ctx, - } -} - -// NewListExternalJWTSignersParamsWithHTTPClient creates a new ListExternalJWTSignersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListExternalJWTSignersParamsWithHTTPClient(client *http.Client) *ListExternalJWTSignersParams { - return &ListExternalJWTSignersParams{ - HTTPClient: client, - } -} - -/* ListExternalJWTSignersParams contains all the parameters to send to the API endpoint - for the list external Jwt signers operation. - - Typically these are written to a http.Request. -*/ -type ListExternalJWTSignersParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list external Jwt signers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListExternalJWTSignersParams) WithDefaults() *ListExternalJWTSignersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list external Jwt signers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListExternalJWTSignersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithTimeout(timeout time.Duration) *ListExternalJWTSignersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithContext(ctx context.Context) *ListExternalJWTSignersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithHTTPClient(client *http.Client) *ListExternalJWTSignersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithFilter(filter *string) *ListExternalJWTSignersParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithLimit(limit *int64) *ListExternalJWTSignersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) WithOffset(offset *int64) *ListExternalJWTSignersParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list external Jwt signers params -func (o *ListExternalJWTSignersParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListExternalJWTSignersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/list_external_jwt_signers_responses.go b/rest_management_api_client/external_jwt_signer/list_external_jwt_signers_responses.go deleted file mode 100644 index 40ed8112e..000000000 --- a/rest_management_api_client/external_jwt_signer/list_external_jwt_signers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListExternalJWTSignersReader is a Reader for the ListExternalJWTSigners structure. -type ListExternalJWTSignersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListExternalJWTSignersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListExternalJWTSignersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListExternalJWTSignersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListExternalJWTSignersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListExternalJWTSignersOK creates a ListExternalJWTSignersOK with default headers values -func NewListExternalJWTSignersOK() *ListExternalJWTSignersOK { - return &ListExternalJWTSignersOK{} -} - -/* ListExternalJWTSignersOK describes a response with status code 200, with default header values. - -A list of External JWT Signers -*/ -type ListExternalJWTSignersOK struct { - Payload *rest_model.ListExternalJWTSignersEnvelope -} - -func (o *ListExternalJWTSignersOK) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers][%d] listExternalJwtSignersOK %+v", 200, o.Payload) -} -func (o *ListExternalJWTSignersOK) GetPayload() *rest_model.ListExternalJWTSignersEnvelope { - return o.Payload -} - -func (o *ListExternalJWTSignersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListExternalJWTSignersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListExternalJWTSignersBadRequest creates a ListExternalJWTSignersBadRequest with default headers values -func NewListExternalJWTSignersBadRequest() *ListExternalJWTSignersBadRequest { - return &ListExternalJWTSignersBadRequest{} -} - -/* ListExternalJWTSignersBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListExternalJWTSignersBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListExternalJWTSignersBadRequest) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers][%d] listExternalJwtSignersBadRequest %+v", 400, o.Payload) -} -func (o *ListExternalJWTSignersBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListExternalJWTSignersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListExternalJWTSignersUnauthorized creates a ListExternalJWTSignersUnauthorized with default headers values -func NewListExternalJWTSignersUnauthorized() *ListExternalJWTSignersUnauthorized { - return &ListExternalJWTSignersUnauthorized{} -} - -/* ListExternalJWTSignersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListExternalJWTSignersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListExternalJWTSignersUnauthorized) Error() string { - return fmt.Sprintf("[GET /external-jwt-signers][%d] listExternalJwtSignersUnauthorized %+v", 401, o.Payload) -} -func (o *ListExternalJWTSignersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListExternalJWTSignersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/patch_external_jwt_signer_parameters.go b/rest_management_api_client/external_jwt_signer/patch_external_jwt_signer_parameters.go deleted file mode 100644 index b121f3702..000000000 --- a/rest_management_api_client/external_jwt_signer/patch_external_jwt_signer_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchExternalJWTSignerParams creates a new PatchExternalJWTSignerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchExternalJWTSignerParams() *PatchExternalJWTSignerParams { - return &PatchExternalJWTSignerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchExternalJWTSignerParamsWithTimeout creates a new PatchExternalJWTSignerParams object -// with the ability to set a timeout on a request. -func NewPatchExternalJWTSignerParamsWithTimeout(timeout time.Duration) *PatchExternalJWTSignerParams { - return &PatchExternalJWTSignerParams{ - timeout: timeout, - } -} - -// NewPatchExternalJWTSignerParamsWithContext creates a new PatchExternalJWTSignerParams object -// with the ability to set a context for a request. -func NewPatchExternalJWTSignerParamsWithContext(ctx context.Context) *PatchExternalJWTSignerParams { - return &PatchExternalJWTSignerParams{ - Context: ctx, - } -} - -// NewPatchExternalJWTSignerParamsWithHTTPClient creates a new PatchExternalJWTSignerParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchExternalJWTSignerParamsWithHTTPClient(client *http.Client) *PatchExternalJWTSignerParams { - return &PatchExternalJWTSignerParams{ - HTTPClient: client, - } -} - -/* PatchExternalJWTSignerParams contains all the parameters to send to the API endpoint - for the patch external Jwt signer operation. - - Typically these are written to a http.Request. -*/ -type PatchExternalJWTSignerParams struct { - - /* ExternalJWTSigner. - - An External JWT Signer patch object - */ - ExternalJWTSigner *rest_model.ExternalJWTSignerPatch - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchExternalJWTSignerParams) WithDefaults() *PatchExternalJWTSignerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchExternalJWTSignerParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) WithTimeout(timeout time.Duration) *PatchExternalJWTSignerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) WithContext(ctx context.Context) *PatchExternalJWTSignerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) WithHTTPClient(client *http.Client) *PatchExternalJWTSignerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExternalJWTSigner adds the externalJWTSigner to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) WithExternalJWTSigner(externalJWTSigner *rest_model.ExternalJWTSignerPatch) *PatchExternalJWTSignerParams { - o.SetExternalJWTSigner(externalJWTSigner) - return o -} - -// SetExternalJWTSigner adds the externalJwtSigner to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) SetExternalJWTSigner(externalJWTSigner *rest_model.ExternalJWTSignerPatch) { - o.ExternalJWTSigner = externalJWTSigner -} - -// WithID adds the id to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) WithID(id string) *PatchExternalJWTSignerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch external Jwt signer params -func (o *PatchExternalJWTSignerParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchExternalJWTSignerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.ExternalJWTSigner != nil { - if err := r.SetBodyParam(o.ExternalJWTSigner); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/patch_external_jwt_signer_responses.go b/rest_management_api_client/external_jwt_signer/patch_external_jwt_signer_responses.go deleted file mode 100644 index cc47ce4e4..000000000 --- a/rest_management_api_client/external_jwt_signer/patch_external_jwt_signer_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchExternalJWTSignerReader is a Reader for the PatchExternalJWTSigner structure. -type PatchExternalJWTSignerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchExternalJWTSignerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchExternalJWTSignerOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchExternalJWTSignerBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchExternalJWTSignerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchExternalJWTSignerNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchExternalJWTSignerOK creates a PatchExternalJWTSignerOK with default headers values -func NewPatchExternalJWTSignerOK() *PatchExternalJWTSignerOK { - return &PatchExternalJWTSignerOK{} -} - -/* PatchExternalJWTSignerOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchExternalJWTSignerOK struct { - Payload *rest_model.Empty -} - -func (o *PatchExternalJWTSignerOK) Error() string { - return fmt.Sprintf("[PATCH /external-jwt-signers/{id}][%d] patchExternalJwtSignerOK %+v", 200, o.Payload) -} -func (o *PatchExternalJWTSignerOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchExternalJWTSignerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchExternalJWTSignerBadRequest creates a PatchExternalJWTSignerBadRequest with default headers values -func NewPatchExternalJWTSignerBadRequest() *PatchExternalJWTSignerBadRequest { - return &PatchExternalJWTSignerBadRequest{} -} - -/* PatchExternalJWTSignerBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchExternalJWTSignerBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchExternalJWTSignerBadRequest) Error() string { - return fmt.Sprintf("[PATCH /external-jwt-signers/{id}][%d] patchExternalJwtSignerBadRequest %+v", 400, o.Payload) -} -func (o *PatchExternalJWTSignerBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchExternalJWTSignerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchExternalJWTSignerUnauthorized creates a PatchExternalJWTSignerUnauthorized with default headers values -func NewPatchExternalJWTSignerUnauthorized() *PatchExternalJWTSignerUnauthorized { - return &PatchExternalJWTSignerUnauthorized{} -} - -/* PatchExternalJWTSignerUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchExternalJWTSignerUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchExternalJWTSignerUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /external-jwt-signers/{id}][%d] patchExternalJwtSignerUnauthorized %+v", 401, o.Payload) -} -func (o *PatchExternalJWTSignerUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchExternalJWTSignerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchExternalJWTSignerNotFound creates a PatchExternalJWTSignerNotFound with default headers values -func NewPatchExternalJWTSignerNotFound() *PatchExternalJWTSignerNotFound { - return &PatchExternalJWTSignerNotFound{} -} - -/* PatchExternalJWTSignerNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchExternalJWTSignerNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchExternalJWTSignerNotFound) Error() string { - return fmt.Sprintf("[PATCH /external-jwt-signers/{id}][%d] patchExternalJwtSignerNotFound %+v", 404, o.Payload) -} -func (o *PatchExternalJWTSignerNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchExternalJWTSignerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/update_external_jwt_signer_parameters.go b/rest_management_api_client/external_jwt_signer/update_external_jwt_signer_parameters.go deleted file mode 100644 index a28f873d1..000000000 --- a/rest_management_api_client/external_jwt_signer/update_external_jwt_signer_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateExternalJWTSignerParams creates a new UpdateExternalJWTSignerParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateExternalJWTSignerParams() *UpdateExternalJWTSignerParams { - return &UpdateExternalJWTSignerParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateExternalJWTSignerParamsWithTimeout creates a new UpdateExternalJWTSignerParams object -// with the ability to set a timeout on a request. -func NewUpdateExternalJWTSignerParamsWithTimeout(timeout time.Duration) *UpdateExternalJWTSignerParams { - return &UpdateExternalJWTSignerParams{ - timeout: timeout, - } -} - -// NewUpdateExternalJWTSignerParamsWithContext creates a new UpdateExternalJWTSignerParams object -// with the ability to set a context for a request. -func NewUpdateExternalJWTSignerParamsWithContext(ctx context.Context) *UpdateExternalJWTSignerParams { - return &UpdateExternalJWTSignerParams{ - Context: ctx, - } -} - -// NewUpdateExternalJWTSignerParamsWithHTTPClient creates a new UpdateExternalJWTSignerParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateExternalJWTSignerParamsWithHTTPClient(client *http.Client) *UpdateExternalJWTSignerParams { - return &UpdateExternalJWTSignerParams{ - HTTPClient: client, - } -} - -/* UpdateExternalJWTSignerParams contains all the parameters to send to the API endpoint - for the update external Jwt signer operation. - - Typically these are written to a http.Request. -*/ -type UpdateExternalJWTSignerParams struct { - - /* ExternalJWTSigner. - - An External JWT Signer update object - */ - ExternalJWTSigner *rest_model.ExternalJWTSignerUpdate - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateExternalJWTSignerParams) WithDefaults() *UpdateExternalJWTSignerParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update external Jwt signer params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateExternalJWTSignerParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) WithTimeout(timeout time.Duration) *UpdateExternalJWTSignerParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) WithContext(ctx context.Context) *UpdateExternalJWTSignerParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) WithHTTPClient(client *http.Client) *UpdateExternalJWTSignerParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithExternalJWTSigner adds the externalJWTSigner to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) WithExternalJWTSigner(externalJWTSigner *rest_model.ExternalJWTSignerUpdate) *UpdateExternalJWTSignerParams { - o.SetExternalJWTSigner(externalJWTSigner) - return o -} - -// SetExternalJWTSigner adds the externalJwtSigner to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) SetExternalJWTSigner(externalJWTSigner *rest_model.ExternalJWTSignerUpdate) { - o.ExternalJWTSigner = externalJWTSigner -} - -// WithID adds the id to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) WithID(id string) *UpdateExternalJWTSignerParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update external Jwt signer params -func (o *UpdateExternalJWTSignerParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateExternalJWTSignerParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.ExternalJWTSigner != nil { - if err := r.SetBodyParam(o.ExternalJWTSigner); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/external_jwt_signer/update_external_jwt_signer_responses.go b/rest_management_api_client/external_jwt_signer/update_external_jwt_signer_responses.go deleted file mode 100644 index 992b821b0..000000000 --- a/rest_management_api_client/external_jwt_signer/update_external_jwt_signer_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateExternalJWTSignerReader is a Reader for the UpdateExternalJWTSigner structure. -type UpdateExternalJWTSignerReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateExternalJWTSignerReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateExternalJWTSignerOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateExternalJWTSignerBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateExternalJWTSignerUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateExternalJWTSignerNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateExternalJWTSignerOK creates a UpdateExternalJWTSignerOK with default headers values -func NewUpdateExternalJWTSignerOK() *UpdateExternalJWTSignerOK { - return &UpdateExternalJWTSignerOK{} -} - -/* UpdateExternalJWTSignerOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateExternalJWTSignerOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateExternalJWTSignerOK) Error() string { - return fmt.Sprintf("[PUT /external-jwt-signers/{id}][%d] updateExternalJwtSignerOK %+v", 200, o.Payload) -} -func (o *UpdateExternalJWTSignerOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateExternalJWTSignerOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateExternalJWTSignerBadRequest creates a UpdateExternalJWTSignerBadRequest with default headers values -func NewUpdateExternalJWTSignerBadRequest() *UpdateExternalJWTSignerBadRequest { - return &UpdateExternalJWTSignerBadRequest{} -} - -/* UpdateExternalJWTSignerBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateExternalJWTSignerBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateExternalJWTSignerBadRequest) Error() string { - return fmt.Sprintf("[PUT /external-jwt-signers/{id}][%d] updateExternalJwtSignerBadRequest %+v", 400, o.Payload) -} -func (o *UpdateExternalJWTSignerBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateExternalJWTSignerBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateExternalJWTSignerUnauthorized creates a UpdateExternalJWTSignerUnauthorized with default headers values -func NewUpdateExternalJWTSignerUnauthorized() *UpdateExternalJWTSignerUnauthorized { - return &UpdateExternalJWTSignerUnauthorized{} -} - -/* UpdateExternalJWTSignerUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateExternalJWTSignerUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateExternalJWTSignerUnauthorized) Error() string { - return fmt.Sprintf("[PUT /external-jwt-signers/{id}][%d] updateExternalJwtSignerUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateExternalJWTSignerUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateExternalJWTSignerUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateExternalJWTSignerNotFound creates a UpdateExternalJWTSignerNotFound with default headers values -func NewUpdateExternalJWTSignerNotFound() *UpdateExternalJWTSignerNotFound { - return &UpdateExternalJWTSignerNotFound{} -} - -/* UpdateExternalJWTSignerNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateExternalJWTSignerNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateExternalJWTSignerNotFound) Error() string { - return fmt.Sprintf("[PUT /external-jwt-signers/{id}][%d] updateExternalJwtSignerNotFound %+v", 404, o.Payload) -} -func (o *UpdateExternalJWTSignerNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateExternalJWTSignerNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/associate_identitys_service_configs_parameters.go b/rest_management_api_client/identity/associate_identitys_service_configs_parameters.go deleted file mode 100644 index 13ffb471e..000000000 --- a/rest_management_api_client/identity/associate_identitys_service_configs_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewAssociateIdentitysServiceConfigsParams creates a new AssociateIdentitysServiceConfigsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewAssociateIdentitysServiceConfigsParams() *AssociateIdentitysServiceConfigsParams { - return &AssociateIdentitysServiceConfigsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewAssociateIdentitysServiceConfigsParamsWithTimeout creates a new AssociateIdentitysServiceConfigsParams object -// with the ability to set a timeout on a request. -func NewAssociateIdentitysServiceConfigsParamsWithTimeout(timeout time.Duration) *AssociateIdentitysServiceConfigsParams { - return &AssociateIdentitysServiceConfigsParams{ - timeout: timeout, - } -} - -// NewAssociateIdentitysServiceConfigsParamsWithContext creates a new AssociateIdentitysServiceConfigsParams object -// with the ability to set a context for a request. -func NewAssociateIdentitysServiceConfigsParamsWithContext(ctx context.Context) *AssociateIdentitysServiceConfigsParams { - return &AssociateIdentitysServiceConfigsParams{ - Context: ctx, - } -} - -// NewAssociateIdentitysServiceConfigsParamsWithHTTPClient creates a new AssociateIdentitysServiceConfigsParams object -// with the ability to set a custom HTTPClient for a request. -func NewAssociateIdentitysServiceConfigsParamsWithHTTPClient(client *http.Client) *AssociateIdentitysServiceConfigsParams { - return &AssociateIdentitysServiceConfigsParams{ - HTTPClient: client, - } -} - -/* AssociateIdentitysServiceConfigsParams contains all the parameters to send to the API endpoint - for the associate identitys service configs operation. - - Typically these are written to a http.Request. -*/ -type AssociateIdentitysServiceConfigsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* ServiceConfigs. - - A service config patch object - */ - ServiceConfigs rest_model.ServiceConfigsAssignList - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the associate identitys service configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AssociateIdentitysServiceConfigsParams) WithDefaults() *AssociateIdentitysServiceConfigsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the associate identitys service configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *AssociateIdentitysServiceConfigsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) WithTimeout(timeout time.Duration) *AssociateIdentitysServiceConfigsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) WithContext(ctx context.Context) *AssociateIdentitysServiceConfigsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) WithHTTPClient(client *http.Client) *AssociateIdentitysServiceConfigsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) WithID(id string) *AssociateIdentitysServiceConfigsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) SetID(id string) { - o.ID = id -} - -// WithServiceConfigs adds the serviceConfigs to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) WithServiceConfigs(serviceConfigs rest_model.ServiceConfigsAssignList) *AssociateIdentitysServiceConfigsParams { - o.SetServiceConfigs(serviceConfigs) - return o -} - -// SetServiceConfigs adds the serviceConfigs to the associate identitys service configs params -func (o *AssociateIdentitysServiceConfigsParams) SetServiceConfigs(serviceConfigs rest_model.ServiceConfigsAssignList) { - o.ServiceConfigs = serviceConfigs -} - -// WriteToRequest writes these params to a swagger request -func (o *AssociateIdentitysServiceConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.ServiceConfigs != nil { - if err := r.SetBodyParam(o.ServiceConfigs); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/associate_identitys_service_configs_responses.go b/rest_management_api_client/identity/associate_identitys_service_configs_responses.go deleted file mode 100644 index ccffd7955..000000000 --- a/rest_management_api_client/identity/associate_identitys_service_configs_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// AssociateIdentitysServiceConfigsReader is a Reader for the AssociateIdentitysServiceConfigs structure. -type AssociateIdentitysServiceConfigsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *AssociateIdentitysServiceConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewAssociateIdentitysServiceConfigsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewAssociateIdentitysServiceConfigsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewAssociateIdentitysServiceConfigsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewAssociateIdentitysServiceConfigsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewAssociateIdentitysServiceConfigsOK creates a AssociateIdentitysServiceConfigsOK with default headers values -func NewAssociateIdentitysServiceConfigsOK() *AssociateIdentitysServiceConfigsOK { - return &AssociateIdentitysServiceConfigsOK{} -} - -/* AssociateIdentitysServiceConfigsOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type AssociateIdentitysServiceConfigsOK struct { - Payload *rest_model.Empty -} - -func (o *AssociateIdentitysServiceConfigsOK) Error() string { - return fmt.Sprintf("[POST /identities/{id}/service-configs][%d] associateIdentitysServiceConfigsOK %+v", 200, o.Payload) -} -func (o *AssociateIdentitysServiceConfigsOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *AssociateIdentitysServiceConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAssociateIdentitysServiceConfigsBadRequest creates a AssociateIdentitysServiceConfigsBadRequest with default headers values -func NewAssociateIdentitysServiceConfigsBadRequest() *AssociateIdentitysServiceConfigsBadRequest { - return &AssociateIdentitysServiceConfigsBadRequest{} -} - -/* AssociateIdentitysServiceConfigsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type AssociateIdentitysServiceConfigsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AssociateIdentitysServiceConfigsBadRequest) Error() string { - return fmt.Sprintf("[POST /identities/{id}/service-configs][%d] associateIdentitysServiceConfigsBadRequest %+v", 400, o.Payload) -} -func (o *AssociateIdentitysServiceConfigsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AssociateIdentitysServiceConfigsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAssociateIdentitysServiceConfigsUnauthorized creates a AssociateIdentitysServiceConfigsUnauthorized with default headers values -func NewAssociateIdentitysServiceConfigsUnauthorized() *AssociateIdentitysServiceConfigsUnauthorized { - return &AssociateIdentitysServiceConfigsUnauthorized{} -} - -/* AssociateIdentitysServiceConfigsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type AssociateIdentitysServiceConfigsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AssociateIdentitysServiceConfigsUnauthorized) Error() string { - return fmt.Sprintf("[POST /identities/{id}/service-configs][%d] associateIdentitysServiceConfigsUnauthorized %+v", 401, o.Payload) -} -func (o *AssociateIdentitysServiceConfigsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AssociateIdentitysServiceConfigsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewAssociateIdentitysServiceConfigsNotFound creates a AssociateIdentitysServiceConfigsNotFound with default headers values -func NewAssociateIdentitysServiceConfigsNotFound() *AssociateIdentitysServiceConfigsNotFound { - return &AssociateIdentitysServiceConfigsNotFound{} -} - -/* AssociateIdentitysServiceConfigsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type AssociateIdentitysServiceConfigsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *AssociateIdentitysServiceConfigsNotFound) Error() string { - return fmt.Sprintf("[POST /identities/{id}/service-configs][%d] associateIdentitysServiceConfigsNotFound %+v", 404, o.Payload) -} -func (o *AssociateIdentitysServiceConfigsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *AssociateIdentitysServiceConfigsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/create_identity_parameters.go b/rest_management_api_client/identity/create_identity_parameters.go deleted file mode 100644 index 58fb59bce..000000000 --- a/rest_management_api_client/identity/create_identity_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateIdentityParams creates a new CreateIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateIdentityParams() *CreateIdentityParams { - return &CreateIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateIdentityParamsWithTimeout creates a new CreateIdentityParams object -// with the ability to set a timeout on a request. -func NewCreateIdentityParamsWithTimeout(timeout time.Duration) *CreateIdentityParams { - return &CreateIdentityParams{ - timeout: timeout, - } -} - -// NewCreateIdentityParamsWithContext creates a new CreateIdentityParams object -// with the ability to set a context for a request. -func NewCreateIdentityParamsWithContext(ctx context.Context) *CreateIdentityParams { - return &CreateIdentityParams{ - Context: ctx, - } -} - -// NewCreateIdentityParamsWithHTTPClient creates a new CreateIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateIdentityParamsWithHTTPClient(client *http.Client) *CreateIdentityParams { - return &CreateIdentityParams{ - HTTPClient: client, - } -} - -/* CreateIdentityParams contains all the parameters to send to the API endpoint - for the create identity operation. - - Typically these are written to a http.Request. -*/ -type CreateIdentityParams struct { - - /* Identity. - - An identity to create - */ - Identity *rest_model.IdentityCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateIdentityParams) WithDefaults() *CreateIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create identity params -func (o *CreateIdentityParams) WithTimeout(timeout time.Duration) *CreateIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create identity params -func (o *CreateIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create identity params -func (o *CreateIdentityParams) WithContext(ctx context.Context) *CreateIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create identity params -func (o *CreateIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create identity params -func (o *CreateIdentityParams) WithHTTPClient(client *http.Client) *CreateIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create identity params -func (o *CreateIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIdentity adds the identity to the create identity params -func (o *CreateIdentityParams) WithIdentity(identity *rest_model.IdentityCreate) *CreateIdentityParams { - o.SetIdentity(identity) - return o -} - -// SetIdentity adds the identity to the create identity params -func (o *CreateIdentityParams) SetIdentity(identity *rest_model.IdentityCreate) { - o.Identity = identity -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Identity != nil { - if err := r.SetBodyParam(o.Identity); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/create_identity_responses.go b/rest_management_api_client/identity/create_identity_responses.go deleted file mode 100644 index 308b162db..000000000 --- a/rest_management_api_client/identity/create_identity_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateIdentityReader is a Reader for the CreateIdentity structure. -type CreateIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateIdentityCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateIdentityBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateIdentityCreated creates a CreateIdentityCreated with default headers values -func NewCreateIdentityCreated() *CreateIdentityCreated { - return &CreateIdentityCreated{} -} - -/* CreateIdentityCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateIdentityCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateIdentityCreated) Error() string { - return fmt.Sprintf("[POST /identities][%d] createIdentityCreated %+v", 201, o.Payload) -} -func (o *CreateIdentityCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateIdentityCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateIdentityBadRequest creates a CreateIdentityBadRequest with default headers values -func NewCreateIdentityBadRequest() *CreateIdentityBadRequest { - return &CreateIdentityBadRequest{} -} - -/* CreateIdentityBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateIdentityBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateIdentityBadRequest) Error() string { - return fmt.Sprintf("[POST /identities][%d] createIdentityBadRequest %+v", 400, o.Payload) -} -func (o *CreateIdentityBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateIdentityUnauthorized creates a CreateIdentityUnauthorized with default headers values -func NewCreateIdentityUnauthorized() *CreateIdentityUnauthorized { - return &CreateIdentityUnauthorized{} -} - -/* CreateIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateIdentityUnauthorized) Error() string { - return fmt.Sprintf("[POST /identities][%d] createIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *CreateIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/delete_identity_parameters.go b/rest_management_api_client/identity/delete_identity_parameters.go deleted file mode 100644 index a2ace3d58..000000000 --- a/rest_management_api_client/identity/delete_identity_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteIdentityParams creates a new DeleteIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteIdentityParams() *DeleteIdentityParams { - return &DeleteIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteIdentityParamsWithTimeout creates a new DeleteIdentityParams object -// with the ability to set a timeout on a request. -func NewDeleteIdentityParamsWithTimeout(timeout time.Duration) *DeleteIdentityParams { - return &DeleteIdentityParams{ - timeout: timeout, - } -} - -// NewDeleteIdentityParamsWithContext creates a new DeleteIdentityParams object -// with the ability to set a context for a request. -func NewDeleteIdentityParamsWithContext(ctx context.Context) *DeleteIdentityParams { - return &DeleteIdentityParams{ - Context: ctx, - } -} - -// NewDeleteIdentityParamsWithHTTPClient creates a new DeleteIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteIdentityParamsWithHTTPClient(client *http.Client) *DeleteIdentityParams { - return &DeleteIdentityParams{ - HTTPClient: client, - } -} - -/* DeleteIdentityParams contains all the parameters to send to the API endpoint - for the delete identity operation. - - Typically these are written to a http.Request. -*/ -type DeleteIdentityParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteIdentityParams) WithDefaults() *DeleteIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete identity params -func (o *DeleteIdentityParams) WithTimeout(timeout time.Duration) *DeleteIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete identity params -func (o *DeleteIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete identity params -func (o *DeleteIdentityParams) WithContext(ctx context.Context) *DeleteIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete identity params -func (o *DeleteIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete identity params -func (o *DeleteIdentityParams) WithHTTPClient(client *http.Client) *DeleteIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete identity params -func (o *DeleteIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete identity params -func (o *DeleteIdentityParams) WithID(id string) *DeleteIdentityParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete identity params -func (o *DeleteIdentityParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/delete_identity_responses.go b/rest_management_api_client/identity/delete_identity_responses.go deleted file mode 100644 index 8eedf9b10..000000000 --- a/rest_management_api_client/identity/delete_identity_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteIdentityReader is a Reader for the DeleteIdentity structure. -type DeleteIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteIdentityBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteIdentityConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteIdentityOK creates a DeleteIdentityOK with default headers values -func NewDeleteIdentityOK() *DeleteIdentityOK { - return &DeleteIdentityOK{} -} - -/* DeleteIdentityOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteIdentityOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteIdentityOK) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}][%d] deleteIdentityOK %+v", 200, o.Payload) -} -func (o *DeleteIdentityOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteIdentityBadRequest creates a DeleteIdentityBadRequest with default headers values -func NewDeleteIdentityBadRequest() *DeleteIdentityBadRequest { - return &DeleteIdentityBadRequest{} -} - -/* DeleteIdentityBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteIdentityBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteIdentityBadRequest) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}][%d] deleteIdentityBadRequest %+v", 400, o.Payload) -} -func (o *DeleteIdentityBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteIdentityUnauthorized creates a DeleteIdentityUnauthorized with default headers values -func NewDeleteIdentityUnauthorized() *DeleteIdentityUnauthorized { - return &DeleteIdentityUnauthorized{} -} - -/* DeleteIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteIdentityUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}][%d] deleteIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteIdentityConflict creates a DeleteIdentityConflict with default headers values -func NewDeleteIdentityConflict() *DeleteIdentityConflict { - return &DeleteIdentityConflict{} -} - -/* DeleteIdentityConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteIdentityConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteIdentityConflict) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}][%d] deleteIdentityConflict %+v", 409, o.Payload) -} -func (o *DeleteIdentityConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteIdentityConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/detail_identity_parameters.go b/rest_management_api_client/identity/detail_identity_parameters.go deleted file mode 100644 index f374abd02..000000000 --- a/rest_management_api_client/identity/detail_identity_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailIdentityParams creates a new DetailIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailIdentityParams() *DetailIdentityParams { - return &DetailIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailIdentityParamsWithTimeout creates a new DetailIdentityParams object -// with the ability to set a timeout on a request. -func NewDetailIdentityParamsWithTimeout(timeout time.Duration) *DetailIdentityParams { - return &DetailIdentityParams{ - timeout: timeout, - } -} - -// NewDetailIdentityParamsWithContext creates a new DetailIdentityParams object -// with the ability to set a context for a request. -func NewDetailIdentityParamsWithContext(ctx context.Context) *DetailIdentityParams { - return &DetailIdentityParams{ - Context: ctx, - } -} - -// NewDetailIdentityParamsWithHTTPClient creates a new DetailIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailIdentityParamsWithHTTPClient(client *http.Client) *DetailIdentityParams { - return &DetailIdentityParams{ - HTTPClient: client, - } -} - -/* DetailIdentityParams contains all the parameters to send to the API endpoint - for the detail identity operation. - - Typically these are written to a http.Request. -*/ -type DetailIdentityParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailIdentityParams) WithDefaults() *DetailIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail identity params -func (o *DetailIdentityParams) WithTimeout(timeout time.Duration) *DetailIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail identity params -func (o *DetailIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail identity params -func (o *DetailIdentityParams) WithContext(ctx context.Context) *DetailIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail identity params -func (o *DetailIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail identity params -func (o *DetailIdentityParams) WithHTTPClient(client *http.Client) *DetailIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail identity params -func (o *DetailIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail identity params -func (o *DetailIdentityParams) WithID(id string) *DetailIdentityParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail identity params -func (o *DetailIdentityParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/detail_identity_responses.go b/rest_management_api_client/identity/detail_identity_responses.go deleted file mode 100644 index cb2ef52f2..000000000 --- a/rest_management_api_client/identity/detail_identity_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailIdentityReader is a Reader for the DetailIdentity structure. -type DetailIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailIdentityNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailIdentityOK creates a DetailIdentityOK with default headers values -func NewDetailIdentityOK() *DetailIdentityOK { - return &DetailIdentityOK{} -} - -/* DetailIdentityOK describes a response with status code 200, with default header values. - -A single identity -*/ -type DetailIdentityOK struct { - Payload *rest_model.DetailIdentityEnvelope -} - -func (o *DetailIdentityOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}][%d] detailIdentityOK %+v", 200, o.Payload) -} -func (o *DetailIdentityOK) GetPayload() *rest_model.DetailIdentityEnvelope { - return o.Payload -} - -func (o *DetailIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailIdentityEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailIdentityUnauthorized creates a DetailIdentityUnauthorized with default headers values -func NewDetailIdentityUnauthorized() *DetailIdentityUnauthorized { - return &DetailIdentityUnauthorized{} -} - -/* DetailIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailIdentityUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}][%d] detailIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *DetailIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailIdentityNotFound creates a DetailIdentityNotFound with default headers values -func NewDetailIdentityNotFound() *DetailIdentityNotFound { - return &DetailIdentityNotFound{} -} - -/* DetailIdentityNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailIdentityNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailIdentityNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}][%d] detailIdentityNotFound %+v", 404, o.Payload) -} -func (o *DetailIdentityNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/detail_identity_type_parameters.go b/rest_management_api_client/identity/detail_identity_type_parameters.go deleted file mode 100644 index 5f306fcbb..000000000 --- a/rest_management_api_client/identity/detail_identity_type_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailIdentityTypeParams creates a new DetailIdentityTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailIdentityTypeParams() *DetailIdentityTypeParams { - return &DetailIdentityTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailIdentityTypeParamsWithTimeout creates a new DetailIdentityTypeParams object -// with the ability to set a timeout on a request. -func NewDetailIdentityTypeParamsWithTimeout(timeout time.Duration) *DetailIdentityTypeParams { - return &DetailIdentityTypeParams{ - timeout: timeout, - } -} - -// NewDetailIdentityTypeParamsWithContext creates a new DetailIdentityTypeParams object -// with the ability to set a context for a request. -func NewDetailIdentityTypeParamsWithContext(ctx context.Context) *DetailIdentityTypeParams { - return &DetailIdentityTypeParams{ - Context: ctx, - } -} - -// NewDetailIdentityTypeParamsWithHTTPClient creates a new DetailIdentityTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailIdentityTypeParamsWithHTTPClient(client *http.Client) *DetailIdentityTypeParams { - return &DetailIdentityTypeParams{ - HTTPClient: client, - } -} - -/* DetailIdentityTypeParams contains all the parameters to send to the API endpoint - for the detail identity type operation. - - Typically these are written to a http.Request. -*/ -type DetailIdentityTypeParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail identity type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailIdentityTypeParams) WithDefaults() *DetailIdentityTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail identity type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailIdentityTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail identity type params -func (o *DetailIdentityTypeParams) WithTimeout(timeout time.Duration) *DetailIdentityTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail identity type params -func (o *DetailIdentityTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail identity type params -func (o *DetailIdentityTypeParams) WithContext(ctx context.Context) *DetailIdentityTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail identity type params -func (o *DetailIdentityTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail identity type params -func (o *DetailIdentityTypeParams) WithHTTPClient(client *http.Client) *DetailIdentityTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail identity type params -func (o *DetailIdentityTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail identity type params -func (o *DetailIdentityTypeParams) WithID(id string) *DetailIdentityTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail identity type params -func (o *DetailIdentityTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailIdentityTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/detail_identity_type_responses.go b/rest_management_api_client/identity/detail_identity_type_responses.go deleted file mode 100644 index f363b2742..000000000 --- a/rest_management_api_client/identity/detail_identity_type_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailIdentityTypeReader is a Reader for the DetailIdentityType structure. -type DetailIdentityTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailIdentityTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailIdentityTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailIdentityTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailIdentityTypeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailIdentityTypeOK creates a DetailIdentityTypeOK with default headers values -func NewDetailIdentityTypeOK() *DetailIdentityTypeOK { - return &DetailIdentityTypeOK{} -} - -/* DetailIdentityTypeOK describes a response with status code 200, with default header values. - -A single identity type -*/ -type DetailIdentityTypeOK struct { - Payload *rest_model.DetailIdentityTypeEnvelope -} - -func (o *DetailIdentityTypeOK) Error() string { - return fmt.Sprintf("[GET /identity-types/{id}][%d] detailIdentityTypeOK %+v", 200, o.Payload) -} -func (o *DetailIdentityTypeOK) GetPayload() *rest_model.DetailIdentityTypeEnvelope { - return o.Payload -} - -func (o *DetailIdentityTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailIdentityTypeEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailIdentityTypeUnauthorized creates a DetailIdentityTypeUnauthorized with default headers values -func NewDetailIdentityTypeUnauthorized() *DetailIdentityTypeUnauthorized { - return &DetailIdentityTypeUnauthorized{} -} - -/* DetailIdentityTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailIdentityTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailIdentityTypeUnauthorized) Error() string { - return fmt.Sprintf("[GET /identity-types/{id}][%d] detailIdentityTypeUnauthorized %+v", 401, o.Payload) -} -func (o *DetailIdentityTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailIdentityTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailIdentityTypeNotFound creates a DetailIdentityTypeNotFound with default headers values -func NewDetailIdentityTypeNotFound() *DetailIdentityTypeNotFound { - return &DetailIdentityTypeNotFound{} -} - -/* DetailIdentityTypeNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailIdentityTypeNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailIdentityTypeNotFound) Error() string { - return fmt.Sprintf("[GET /identity-types/{id}][%d] detailIdentityTypeNotFound %+v", 404, o.Payload) -} -func (o *DetailIdentityTypeNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailIdentityTypeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/disable_identity_parameters.go b/rest_management_api_client/identity/disable_identity_parameters.go deleted file mode 100644 index 9ad4201f0..000000000 --- a/rest_management_api_client/identity/disable_identity_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewDisableIdentityParams creates a new DisableIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDisableIdentityParams() *DisableIdentityParams { - return &DisableIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDisableIdentityParamsWithTimeout creates a new DisableIdentityParams object -// with the ability to set a timeout on a request. -func NewDisableIdentityParamsWithTimeout(timeout time.Duration) *DisableIdentityParams { - return &DisableIdentityParams{ - timeout: timeout, - } -} - -// NewDisableIdentityParamsWithContext creates a new DisableIdentityParams object -// with the ability to set a context for a request. -func NewDisableIdentityParamsWithContext(ctx context.Context) *DisableIdentityParams { - return &DisableIdentityParams{ - Context: ctx, - } -} - -// NewDisableIdentityParamsWithHTTPClient creates a new DisableIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewDisableIdentityParamsWithHTTPClient(client *http.Client) *DisableIdentityParams { - return &DisableIdentityParams{ - HTTPClient: client, - } -} - -/* DisableIdentityParams contains all the parameters to send to the API endpoint - for the disable identity operation. - - Typically these are written to a http.Request. -*/ -type DisableIdentityParams struct { - - /* Disable. - - Disable parameters - */ - Disable *rest_model.DisableParams - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the disable identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisableIdentityParams) WithDefaults() *DisableIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disable identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisableIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the disable identity params -func (o *DisableIdentityParams) WithTimeout(timeout time.Duration) *DisableIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the disable identity params -func (o *DisableIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the disable identity params -func (o *DisableIdentityParams) WithContext(ctx context.Context) *DisableIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the disable identity params -func (o *DisableIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the disable identity params -func (o *DisableIdentityParams) WithHTTPClient(client *http.Client) *DisableIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the disable identity params -func (o *DisableIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithDisable adds the disable to the disable identity params -func (o *DisableIdentityParams) WithDisable(disable *rest_model.DisableParams) *DisableIdentityParams { - o.SetDisable(disable) - return o -} - -// SetDisable adds the disable to the disable identity params -func (o *DisableIdentityParams) SetDisable(disable *rest_model.DisableParams) { - o.Disable = disable -} - -// WithID adds the id to the disable identity params -func (o *DisableIdentityParams) WithID(id string) *DisableIdentityParams { - o.SetID(id) - return o -} - -// SetID adds the id to the disable identity params -func (o *DisableIdentityParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DisableIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Disable != nil { - if err := r.SetBodyParam(o.Disable); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/disable_identity_responses.go b/rest_management_api_client/identity/disable_identity_responses.go deleted file mode 100644 index feaa487b1..000000000 --- a/rest_management_api_client/identity/disable_identity_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DisableIdentityReader is a Reader for the DisableIdentity structure. -type DisableIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DisableIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDisableIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDisableIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDisableIdentityNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDisableIdentityOK creates a DisableIdentityOK with default headers values -func NewDisableIdentityOK() *DisableIdentityOK { - return &DisableIdentityOK{} -} - -/* DisableIdentityOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DisableIdentityOK struct { - Payload *rest_model.Empty -} - -func (o *DisableIdentityOK) Error() string { - return fmt.Sprintf("[POST /identities/{id}/disable][%d] disableIdentityOK %+v", 200, o.Payload) -} -func (o *DisableIdentityOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DisableIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableIdentityUnauthorized creates a DisableIdentityUnauthorized with default headers values -func NewDisableIdentityUnauthorized() *DisableIdentityUnauthorized { - return &DisableIdentityUnauthorized{} -} - -/* DisableIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DisableIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DisableIdentityUnauthorized) Error() string { - return fmt.Sprintf("[POST /identities/{id}/disable][%d] disableIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *DisableIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DisableIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisableIdentityNotFound creates a DisableIdentityNotFound with default headers values -func NewDisableIdentityNotFound() *DisableIdentityNotFound { - return &DisableIdentityNotFound{} -} - -/* DisableIdentityNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DisableIdentityNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DisableIdentityNotFound) Error() string { - return fmt.Sprintf("[POST /identities/{id}/disable][%d] disableIdentityNotFound %+v", 404, o.Payload) -} -func (o *DisableIdentityNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DisableIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/disassociate_identitys_service_configs_parameters.go b/rest_management_api_client/identity/disassociate_identitys_service_configs_parameters.go deleted file mode 100644 index cb9b08116..000000000 --- a/rest_management_api_client/identity/disassociate_identitys_service_configs_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewDisassociateIdentitysServiceConfigsParams creates a new DisassociateIdentitysServiceConfigsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDisassociateIdentitysServiceConfigsParams() *DisassociateIdentitysServiceConfigsParams { - return &DisassociateIdentitysServiceConfigsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDisassociateIdentitysServiceConfigsParamsWithTimeout creates a new DisassociateIdentitysServiceConfigsParams object -// with the ability to set a timeout on a request. -func NewDisassociateIdentitysServiceConfigsParamsWithTimeout(timeout time.Duration) *DisassociateIdentitysServiceConfigsParams { - return &DisassociateIdentitysServiceConfigsParams{ - timeout: timeout, - } -} - -// NewDisassociateIdentitysServiceConfigsParamsWithContext creates a new DisassociateIdentitysServiceConfigsParams object -// with the ability to set a context for a request. -func NewDisassociateIdentitysServiceConfigsParamsWithContext(ctx context.Context) *DisassociateIdentitysServiceConfigsParams { - return &DisassociateIdentitysServiceConfigsParams{ - Context: ctx, - } -} - -// NewDisassociateIdentitysServiceConfigsParamsWithHTTPClient creates a new DisassociateIdentitysServiceConfigsParams object -// with the ability to set a custom HTTPClient for a request. -func NewDisassociateIdentitysServiceConfigsParamsWithHTTPClient(client *http.Client) *DisassociateIdentitysServiceConfigsParams { - return &DisassociateIdentitysServiceConfigsParams{ - HTTPClient: client, - } -} - -/* DisassociateIdentitysServiceConfigsParams contains all the parameters to send to the API endpoint - for the disassociate identitys service configs operation. - - Typically these are written to a http.Request. -*/ -type DisassociateIdentitysServiceConfigsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* ServiceConfigIDPairs. - - An array of service and config id pairs to remove - */ - ServiceConfigIDPairs rest_model.ServiceConfigsAssignList - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the disassociate identitys service configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisassociateIdentitysServiceConfigsParams) WithDefaults() *DisassociateIdentitysServiceConfigsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the disassociate identitys service configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DisassociateIdentitysServiceConfigsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) WithTimeout(timeout time.Duration) *DisassociateIdentitysServiceConfigsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) WithContext(ctx context.Context) *DisassociateIdentitysServiceConfigsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) WithHTTPClient(client *http.Client) *DisassociateIdentitysServiceConfigsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) WithID(id string) *DisassociateIdentitysServiceConfigsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) SetID(id string) { - o.ID = id -} - -// WithServiceConfigIDPairs adds the serviceConfigIDPairs to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) WithServiceConfigIDPairs(serviceConfigIDPairs rest_model.ServiceConfigsAssignList) *DisassociateIdentitysServiceConfigsParams { - o.SetServiceConfigIDPairs(serviceConfigIDPairs) - return o -} - -// SetServiceConfigIDPairs adds the serviceConfigIdPairs to the disassociate identitys service configs params -func (o *DisassociateIdentitysServiceConfigsParams) SetServiceConfigIDPairs(serviceConfigIDPairs rest_model.ServiceConfigsAssignList) { - o.ServiceConfigIDPairs = serviceConfigIDPairs -} - -// WriteToRequest writes these params to a swagger request -func (o *DisassociateIdentitysServiceConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.ServiceConfigIDPairs != nil { - if err := r.SetBodyParam(o.ServiceConfigIDPairs); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/disassociate_identitys_service_configs_responses.go b/rest_management_api_client/identity/disassociate_identitys_service_configs_responses.go deleted file mode 100644 index e3ac5a579..000000000 --- a/rest_management_api_client/identity/disassociate_identitys_service_configs_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DisassociateIdentitysServiceConfigsReader is a Reader for the DisassociateIdentitysServiceConfigs structure. -type DisassociateIdentitysServiceConfigsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DisassociateIdentitysServiceConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDisassociateIdentitysServiceConfigsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDisassociateIdentitysServiceConfigsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDisassociateIdentitysServiceConfigsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDisassociateIdentitysServiceConfigsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDisassociateIdentitysServiceConfigsOK creates a DisassociateIdentitysServiceConfigsOK with default headers values -func NewDisassociateIdentitysServiceConfigsOK() *DisassociateIdentitysServiceConfigsOK { - return &DisassociateIdentitysServiceConfigsOK{} -} - -/* DisassociateIdentitysServiceConfigsOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type DisassociateIdentitysServiceConfigsOK struct { - Payload *rest_model.Empty -} - -func (o *DisassociateIdentitysServiceConfigsOK) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/service-configs][%d] disassociateIdentitysServiceConfigsOK %+v", 200, o.Payload) -} -func (o *DisassociateIdentitysServiceConfigsOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DisassociateIdentitysServiceConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisassociateIdentitysServiceConfigsBadRequest creates a DisassociateIdentitysServiceConfigsBadRequest with default headers values -func NewDisassociateIdentitysServiceConfigsBadRequest() *DisassociateIdentitysServiceConfigsBadRequest { - return &DisassociateIdentitysServiceConfigsBadRequest{} -} - -/* DisassociateIdentitysServiceConfigsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DisassociateIdentitysServiceConfigsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DisassociateIdentitysServiceConfigsBadRequest) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/service-configs][%d] disassociateIdentitysServiceConfigsBadRequest %+v", 400, o.Payload) -} -func (o *DisassociateIdentitysServiceConfigsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DisassociateIdentitysServiceConfigsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisassociateIdentitysServiceConfigsUnauthorized creates a DisassociateIdentitysServiceConfigsUnauthorized with default headers values -func NewDisassociateIdentitysServiceConfigsUnauthorized() *DisassociateIdentitysServiceConfigsUnauthorized { - return &DisassociateIdentitysServiceConfigsUnauthorized{} -} - -/* DisassociateIdentitysServiceConfigsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DisassociateIdentitysServiceConfigsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DisassociateIdentitysServiceConfigsUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/service-configs][%d] disassociateIdentitysServiceConfigsUnauthorized %+v", 401, o.Payload) -} -func (o *DisassociateIdentitysServiceConfigsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DisassociateIdentitysServiceConfigsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDisassociateIdentitysServiceConfigsNotFound creates a DisassociateIdentitysServiceConfigsNotFound with default headers values -func NewDisassociateIdentitysServiceConfigsNotFound() *DisassociateIdentitysServiceConfigsNotFound { - return &DisassociateIdentitysServiceConfigsNotFound{} -} - -/* DisassociateIdentitysServiceConfigsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DisassociateIdentitysServiceConfigsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DisassociateIdentitysServiceConfigsNotFound) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/service-configs][%d] disassociateIdentitysServiceConfigsNotFound %+v", 404, o.Payload) -} -func (o *DisassociateIdentitysServiceConfigsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DisassociateIdentitysServiceConfigsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/enable_identity_parameters.go b/rest_management_api_client/identity/enable_identity_parameters.go deleted file mode 100644 index a86ff0d3c..000000000 --- a/rest_management_api_client/identity/enable_identity_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewEnableIdentityParams creates a new EnableIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewEnableIdentityParams() *EnableIdentityParams { - return &EnableIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewEnableIdentityParamsWithTimeout creates a new EnableIdentityParams object -// with the ability to set a timeout on a request. -func NewEnableIdentityParamsWithTimeout(timeout time.Duration) *EnableIdentityParams { - return &EnableIdentityParams{ - timeout: timeout, - } -} - -// NewEnableIdentityParamsWithContext creates a new EnableIdentityParams object -// with the ability to set a context for a request. -func NewEnableIdentityParamsWithContext(ctx context.Context) *EnableIdentityParams { - return &EnableIdentityParams{ - Context: ctx, - } -} - -// NewEnableIdentityParamsWithHTTPClient creates a new EnableIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewEnableIdentityParamsWithHTTPClient(client *http.Client) *EnableIdentityParams { - return &EnableIdentityParams{ - HTTPClient: client, - } -} - -/* EnableIdentityParams contains all the parameters to send to the API endpoint - for the enable identity operation. - - Typically these are written to a http.Request. -*/ -type EnableIdentityParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the enable identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnableIdentityParams) WithDefaults() *EnableIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the enable identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *EnableIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the enable identity params -func (o *EnableIdentityParams) WithTimeout(timeout time.Duration) *EnableIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the enable identity params -func (o *EnableIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the enable identity params -func (o *EnableIdentityParams) WithContext(ctx context.Context) *EnableIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the enable identity params -func (o *EnableIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the enable identity params -func (o *EnableIdentityParams) WithHTTPClient(client *http.Client) *EnableIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the enable identity params -func (o *EnableIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the enable identity params -func (o *EnableIdentityParams) WithID(id string) *EnableIdentityParams { - o.SetID(id) - return o -} - -// SetID adds the id to the enable identity params -func (o *EnableIdentityParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *EnableIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/enable_identity_responses.go b/rest_management_api_client/identity/enable_identity_responses.go deleted file mode 100644 index 0a07dc93c..000000000 --- a/rest_management_api_client/identity/enable_identity_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// EnableIdentityReader is a Reader for the EnableIdentity structure. -type EnableIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *EnableIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewEnableIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewEnableIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewEnableIdentityNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewEnableIdentityOK creates a EnableIdentityOK with default headers values -func NewEnableIdentityOK() *EnableIdentityOK { - return &EnableIdentityOK{} -} - -/* EnableIdentityOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type EnableIdentityOK struct { - Payload *rest_model.Empty -} - -func (o *EnableIdentityOK) Error() string { - return fmt.Sprintf("[POST /identities/{id}/enable][%d] enableIdentityOK %+v", 200, o.Payload) -} -func (o *EnableIdentityOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *EnableIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableIdentityUnauthorized creates a EnableIdentityUnauthorized with default headers values -func NewEnableIdentityUnauthorized() *EnableIdentityUnauthorized { - return &EnableIdentityUnauthorized{} -} - -/* EnableIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type EnableIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnableIdentityUnauthorized) Error() string { - return fmt.Sprintf("[POST /identities/{id}/enable][%d] enableIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *EnableIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnableIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewEnableIdentityNotFound creates a EnableIdentityNotFound with default headers values -func NewEnableIdentityNotFound() *EnableIdentityNotFound { - return &EnableIdentityNotFound{} -} - -/* EnableIdentityNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type EnableIdentityNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *EnableIdentityNotFound) Error() string { - return fmt.Sprintf("[POST /identities/{id}/enable][%d] enableIdentityNotFound %+v", 404, o.Payload) -} -func (o *EnableIdentityNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *EnableIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/get_identity_authenticators_parameters.go b/rest_management_api_client/identity/get_identity_authenticators_parameters.go deleted file mode 100644 index 58658e232..000000000 --- a/rest_management_api_client/identity/get_identity_authenticators_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityAuthenticatorsParams creates a new GetIdentityAuthenticatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetIdentityAuthenticatorsParams() *GetIdentityAuthenticatorsParams { - return &GetIdentityAuthenticatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetIdentityAuthenticatorsParamsWithTimeout creates a new GetIdentityAuthenticatorsParams object -// with the ability to set a timeout on a request. -func NewGetIdentityAuthenticatorsParamsWithTimeout(timeout time.Duration) *GetIdentityAuthenticatorsParams { - return &GetIdentityAuthenticatorsParams{ - timeout: timeout, - } -} - -// NewGetIdentityAuthenticatorsParamsWithContext creates a new GetIdentityAuthenticatorsParams object -// with the ability to set a context for a request. -func NewGetIdentityAuthenticatorsParamsWithContext(ctx context.Context) *GetIdentityAuthenticatorsParams { - return &GetIdentityAuthenticatorsParams{ - Context: ctx, - } -} - -// NewGetIdentityAuthenticatorsParamsWithHTTPClient creates a new GetIdentityAuthenticatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetIdentityAuthenticatorsParamsWithHTTPClient(client *http.Client) *GetIdentityAuthenticatorsParams { - return &GetIdentityAuthenticatorsParams{ - HTTPClient: client, - } -} - -/* GetIdentityAuthenticatorsParams contains all the parameters to send to the API endpoint - for the get identity authenticators operation. - - Typically these are written to a http.Request. -*/ -type GetIdentityAuthenticatorsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get identity authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityAuthenticatorsParams) WithDefaults() *GetIdentityAuthenticatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get identity authenticators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityAuthenticatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) WithTimeout(timeout time.Duration) *GetIdentityAuthenticatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) WithContext(ctx context.Context) *GetIdentityAuthenticatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) WithHTTPClient(client *http.Client) *GetIdentityAuthenticatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) WithID(id string) *GetIdentityAuthenticatorsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get identity authenticators params -func (o *GetIdentityAuthenticatorsParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetIdentityAuthenticatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/get_identity_authenticators_responses.go b/rest_management_api_client/identity/get_identity_authenticators_responses.go deleted file mode 100644 index bd6a9c9c6..000000000 --- a/rest_management_api_client/identity/get_identity_authenticators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityAuthenticatorsReader is a Reader for the GetIdentityAuthenticators structure. -type GetIdentityAuthenticatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetIdentityAuthenticatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetIdentityAuthenticatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetIdentityAuthenticatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetIdentityAuthenticatorsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetIdentityAuthenticatorsOK creates a GetIdentityAuthenticatorsOK with default headers values -func NewGetIdentityAuthenticatorsOK() *GetIdentityAuthenticatorsOK { - return &GetIdentityAuthenticatorsOK{} -} - -/* GetIdentityAuthenticatorsOK describes a response with status code 200, with default header values. - -A list of authenticators -*/ -type GetIdentityAuthenticatorsOK struct { - Payload *rest_model.ListAuthenticatorsEnvelope -} - -func (o *GetIdentityAuthenticatorsOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/authenticators][%d] getIdentityAuthenticatorsOK %+v", 200, o.Payload) -} -func (o *GetIdentityAuthenticatorsOK) GetPayload() *rest_model.ListAuthenticatorsEnvelope { - return o.Payload -} - -func (o *GetIdentityAuthenticatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListAuthenticatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityAuthenticatorsUnauthorized creates a GetIdentityAuthenticatorsUnauthorized with default headers values -func NewGetIdentityAuthenticatorsUnauthorized() *GetIdentityAuthenticatorsUnauthorized { - return &GetIdentityAuthenticatorsUnauthorized{} -} - -/* GetIdentityAuthenticatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetIdentityAuthenticatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityAuthenticatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/authenticators][%d] getIdentityAuthenticatorsUnauthorized %+v", 401, o.Payload) -} -func (o *GetIdentityAuthenticatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityAuthenticatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityAuthenticatorsNotFound creates a GetIdentityAuthenticatorsNotFound with default headers values -func NewGetIdentityAuthenticatorsNotFound() *GetIdentityAuthenticatorsNotFound { - return &GetIdentityAuthenticatorsNotFound{} -} - -/* GetIdentityAuthenticatorsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type GetIdentityAuthenticatorsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityAuthenticatorsNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/authenticators][%d] getIdentityAuthenticatorsNotFound %+v", 404, o.Payload) -} -func (o *GetIdentityAuthenticatorsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityAuthenticatorsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/get_identity_enrollments_parameters.go b/rest_management_api_client/identity/get_identity_enrollments_parameters.go deleted file mode 100644 index abd8c34b3..000000000 --- a/rest_management_api_client/identity/get_identity_enrollments_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityEnrollmentsParams creates a new GetIdentityEnrollmentsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetIdentityEnrollmentsParams() *GetIdentityEnrollmentsParams { - return &GetIdentityEnrollmentsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetIdentityEnrollmentsParamsWithTimeout creates a new GetIdentityEnrollmentsParams object -// with the ability to set a timeout on a request. -func NewGetIdentityEnrollmentsParamsWithTimeout(timeout time.Duration) *GetIdentityEnrollmentsParams { - return &GetIdentityEnrollmentsParams{ - timeout: timeout, - } -} - -// NewGetIdentityEnrollmentsParamsWithContext creates a new GetIdentityEnrollmentsParams object -// with the ability to set a context for a request. -func NewGetIdentityEnrollmentsParamsWithContext(ctx context.Context) *GetIdentityEnrollmentsParams { - return &GetIdentityEnrollmentsParams{ - Context: ctx, - } -} - -// NewGetIdentityEnrollmentsParamsWithHTTPClient creates a new GetIdentityEnrollmentsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetIdentityEnrollmentsParamsWithHTTPClient(client *http.Client) *GetIdentityEnrollmentsParams { - return &GetIdentityEnrollmentsParams{ - HTTPClient: client, - } -} - -/* GetIdentityEnrollmentsParams contains all the parameters to send to the API endpoint - for the get identity enrollments operation. - - Typically these are written to a http.Request. -*/ -type GetIdentityEnrollmentsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get identity enrollments params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityEnrollmentsParams) WithDefaults() *GetIdentityEnrollmentsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get identity enrollments params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityEnrollmentsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) WithTimeout(timeout time.Duration) *GetIdentityEnrollmentsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) WithContext(ctx context.Context) *GetIdentityEnrollmentsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) WithHTTPClient(client *http.Client) *GetIdentityEnrollmentsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) WithID(id string) *GetIdentityEnrollmentsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get identity enrollments params -func (o *GetIdentityEnrollmentsParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetIdentityEnrollmentsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/get_identity_enrollments_responses.go b/rest_management_api_client/identity/get_identity_enrollments_responses.go deleted file mode 100644 index edfafa649..000000000 --- a/rest_management_api_client/identity/get_identity_enrollments_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityEnrollmentsReader is a Reader for the GetIdentityEnrollments structure. -type GetIdentityEnrollmentsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetIdentityEnrollmentsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetIdentityEnrollmentsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetIdentityEnrollmentsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetIdentityEnrollmentsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetIdentityEnrollmentsOK creates a GetIdentityEnrollmentsOK with default headers values -func NewGetIdentityEnrollmentsOK() *GetIdentityEnrollmentsOK { - return &GetIdentityEnrollmentsOK{} -} - -/* GetIdentityEnrollmentsOK describes a response with status code 200, with default header values. - -A list of enrollments -*/ -type GetIdentityEnrollmentsOK struct { - Payload *rest_model.ListEnrollmentsEnvelope -} - -func (o *GetIdentityEnrollmentsOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/enrollments][%d] getIdentityEnrollmentsOK %+v", 200, o.Payload) -} -func (o *GetIdentityEnrollmentsOK) GetPayload() *rest_model.ListEnrollmentsEnvelope { - return o.Payload -} - -func (o *GetIdentityEnrollmentsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEnrollmentsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityEnrollmentsUnauthorized creates a GetIdentityEnrollmentsUnauthorized with default headers values -func NewGetIdentityEnrollmentsUnauthorized() *GetIdentityEnrollmentsUnauthorized { - return &GetIdentityEnrollmentsUnauthorized{} -} - -/* GetIdentityEnrollmentsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetIdentityEnrollmentsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityEnrollmentsUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/enrollments][%d] getIdentityEnrollmentsUnauthorized %+v", 401, o.Payload) -} -func (o *GetIdentityEnrollmentsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityEnrollmentsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityEnrollmentsNotFound creates a GetIdentityEnrollmentsNotFound with default headers values -func NewGetIdentityEnrollmentsNotFound() *GetIdentityEnrollmentsNotFound { - return &GetIdentityEnrollmentsNotFound{} -} - -/* GetIdentityEnrollmentsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type GetIdentityEnrollmentsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityEnrollmentsNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/enrollments][%d] getIdentityEnrollmentsNotFound %+v", 404, o.Payload) -} -func (o *GetIdentityEnrollmentsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityEnrollmentsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/get_identity_failed_service_requests_parameters.go b/rest_management_api_client/identity/get_identity_failed_service_requests_parameters.go deleted file mode 100644 index f7e13ab25..000000000 --- a/rest_management_api_client/identity/get_identity_failed_service_requests_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityFailedServiceRequestsParams creates a new GetIdentityFailedServiceRequestsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetIdentityFailedServiceRequestsParams() *GetIdentityFailedServiceRequestsParams { - return &GetIdentityFailedServiceRequestsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetIdentityFailedServiceRequestsParamsWithTimeout creates a new GetIdentityFailedServiceRequestsParams object -// with the ability to set a timeout on a request. -func NewGetIdentityFailedServiceRequestsParamsWithTimeout(timeout time.Duration) *GetIdentityFailedServiceRequestsParams { - return &GetIdentityFailedServiceRequestsParams{ - timeout: timeout, - } -} - -// NewGetIdentityFailedServiceRequestsParamsWithContext creates a new GetIdentityFailedServiceRequestsParams object -// with the ability to set a context for a request. -func NewGetIdentityFailedServiceRequestsParamsWithContext(ctx context.Context) *GetIdentityFailedServiceRequestsParams { - return &GetIdentityFailedServiceRequestsParams{ - Context: ctx, - } -} - -// NewGetIdentityFailedServiceRequestsParamsWithHTTPClient creates a new GetIdentityFailedServiceRequestsParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetIdentityFailedServiceRequestsParamsWithHTTPClient(client *http.Client) *GetIdentityFailedServiceRequestsParams { - return &GetIdentityFailedServiceRequestsParams{ - HTTPClient: client, - } -} - -/* GetIdentityFailedServiceRequestsParams contains all the parameters to send to the API endpoint - for the get identity failed service requests operation. - - Typically these are written to a http.Request. -*/ -type GetIdentityFailedServiceRequestsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get identity failed service requests params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityFailedServiceRequestsParams) WithDefaults() *GetIdentityFailedServiceRequestsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get identity failed service requests params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityFailedServiceRequestsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) WithTimeout(timeout time.Duration) *GetIdentityFailedServiceRequestsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) WithContext(ctx context.Context) *GetIdentityFailedServiceRequestsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) WithHTTPClient(client *http.Client) *GetIdentityFailedServiceRequestsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) WithID(id string) *GetIdentityFailedServiceRequestsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get identity failed service requests params -func (o *GetIdentityFailedServiceRequestsParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetIdentityFailedServiceRequestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/get_identity_failed_service_requests_responses.go b/rest_management_api_client/identity/get_identity_failed_service_requests_responses.go deleted file mode 100644 index ea26ff885..000000000 --- a/rest_management_api_client/identity/get_identity_failed_service_requests_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityFailedServiceRequestsReader is a Reader for the GetIdentityFailedServiceRequests structure. -type GetIdentityFailedServiceRequestsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetIdentityFailedServiceRequestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetIdentityFailedServiceRequestsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetIdentityFailedServiceRequestsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetIdentityFailedServiceRequestsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetIdentityFailedServiceRequestsOK creates a GetIdentityFailedServiceRequestsOK with default headers values -func NewGetIdentityFailedServiceRequestsOK() *GetIdentityFailedServiceRequestsOK { - return &GetIdentityFailedServiceRequestsOK{} -} - -/* GetIdentityFailedServiceRequestsOK describes a response with status code 200, with default header values. - -Returns a list of service request failures -*/ -type GetIdentityFailedServiceRequestsOK struct { - Payload *rest_model.FailedServiceRequestEnvelope -} - -func (o *GetIdentityFailedServiceRequestsOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/failed-service-requests][%d] getIdentityFailedServiceRequestsOK %+v", 200, o.Payload) -} -func (o *GetIdentityFailedServiceRequestsOK) GetPayload() *rest_model.FailedServiceRequestEnvelope { - return o.Payload -} - -func (o *GetIdentityFailedServiceRequestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.FailedServiceRequestEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityFailedServiceRequestsUnauthorized creates a GetIdentityFailedServiceRequestsUnauthorized with default headers values -func NewGetIdentityFailedServiceRequestsUnauthorized() *GetIdentityFailedServiceRequestsUnauthorized { - return &GetIdentityFailedServiceRequestsUnauthorized{} -} - -/* GetIdentityFailedServiceRequestsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetIdentityFailedServiceRequestsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityFailedServiceRequestsUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/failed-service-requests][%d] getIdentityFailedServiceRequestsUnauthorized %+v", 401, o.Payload) -} -func (o *GetIdentityFailedServiceRequestsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityFailedServiceRequestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityFailedServiceRequestsNotFound creates a GetIdentityFailedServiceRequestsNotFound with default headers values -func NewGetIdentityFailedServiceRequestsNotFound() *GetIdentityFailedServiceRequestsNotFound { - return &GetIdentityFailedServiceRequestsNotFound{} -} - -/* GetIdentityFailedServiceRequestsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type GetIdentityFailedServiceRequestsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityFailedServiceRequestsNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/failed-service-requests][%d] getIdentityFailedServiceRequestsNotFound %+v", 404, o.Payload) -} -func (o *GetIdentityFailedServiceRequestsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityFailedServiceRequestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/get_identity_policy_advice_parameters.go b/rest_management_api_client/identity/get_identity_policy_advice_parameters.go deleted file mode 100644 index a68cf699a..000000000 --- a/rest_management_api_client/identity/get_identity_policy_advice_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityPolicyAdviceParams creates a new GetIdentityPolicyAdviceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetIdentityPolicyAdviceParams() *GetIdentityPolicyAdviceParams { - return &GetIdentityPolicyAdviceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetIdentityPolicyAdviceParamsWithTimeout creates a new GetIdentityPolicyAdviceParams object -// with the ability to set a timeout on a request. -func NewGetIdentityPolicyAdviceParamsWithTimeout(timeout time.Duration) *GetIdentityPolicyAdviceParams { - return &GetIdentityPolicyAdviceParams{ - timeout: timeout, - } -} - -// NewGetIdentityPolicyAdviceParamsWithContext creates a new GetIdentityPolicyAdviceParams object -// with the ability to set a context for a request. -func NewGetIdentityPolicyAdviceParamsWithContext(ctx context.Context) *GetIdentityPolicyAdviceParams { - return &GetIdentityPolicyAdviceParams{ - Context: ctx, - } -} - -// NewGetIdentityPolicyAdviceParamsWithHTTPClient creates a new GetIdentityPolicyAdviceParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetIdentityPolicyAdviceParamsWithHTTPClient(client *http.Client) *GetIdentityPolicyAdviceParams { - return &GetIdentityPolicyAdviceParams{ - HTTPClient: client, - } -} - -/* GetIdentityPolicyAdviceParams contains all the parameters to send to the API endpoint - for the get identity policy advice operation. - - Typically these are written to a http.Request. -*/ -type GetIdentityPolicyAdviceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* ServiceID. - - The id of a service - */ - ServiceID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get identity policy advice params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityPolicyAdviceParams) WithDefaults() *GetIdentityPolicyAdviceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get identity policy advice params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityPolicyAdviceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) WithTimeout(timeout time.Duration) *GetIdentityPolicyAdviceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) WithContext(ctx context.Context) *GetIdentityPolicyAdviceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) WithHTTPClient(client *http.Client) *GetIdentityPolicyAdviceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) WithID(id string) *GetIdentityPolicyAdviceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) SetID(id string) { - o.ID = id -} - -// WithServiceID adds the serviceID to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) WithServiceID(serviceID string) *GetIdentityPolicyAdviceParams { - o.SetServiceID(serviceID) - return o -} - -// SetServiceID adds the serviceId to the get identity policy advice params -func (o *GetIdentityPolicyAdviceParams) SetServiceID(serviceID string) { - o.ServiceID = serviceID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetIdentityPolicyAdviceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - // path param serviceId - if err := r.SetPathParam("serviceId", o.ServiceID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/get_identity_policy_advice_responses.go b/rest_management_api_client/identity/get_identity_policy_advice_responses.go deleted file mode 100644 index 167ede022..000000000 --- a/rest_management_api_client/identity/get_identity_policy_advice_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityPolicyAdviceReader is a Reader for the GetIdentityPolicyAdvice structure. -type GetIdentityPolicyAdviceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetIdentityPolicyAdviceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetIdentityPolicyAdviceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetIdentityPolicyAdviceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetIdentityPolicyAdviceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetIdentityPolicyAdviceOK creates a GetIdentityPolicyAdviceOK with default headers values -func NewGetIdentityPolicyAdviceOK() *GetIdentityPolicyAdviceOK { - return &GetIdentityPolicyAdviceOK{} -} - -/* GetIdentityPolicyAdviceOK describes a response with status code 200, with default header values. - -Returns the document that represents the policy advice -*/ -type GetIdentityPolicyAdviceOK struct { - Payload *rest_model.GetIdentityPolicyAdviceEnvelope -} - -func (o *GetIdentityPolicyAdviceOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/policy-advice/{serviceId}][%d] getIdentityPolicyAdviceOK %+v", 200, o.Payload) -} -func (o *GetIdentityPolicyAdviceOK) GetPayload() *rest_model.GetIdentityPolicyAdviceEnvelope { - return o.Payload -} - -func (o *GetIdentityPolicyAdviceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.GetIdentityPolicyAdviceEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityPolicyAdviceUnauthorized creates a GetIdentityPolicyAdviceUnauthorized with default headers values -func NewGetIdentityPolicyAdviceUnauthorized() *GetIdentityPolicyAdviceUnauthorized { - return &GetIdentityPolicyAdviceUnauthorized{} -} - -/* GetIdentityPolicyAdviceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetIdentityPolicyAdviceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityPolicyAdviceUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/policy-advice/{serviceId}][%d] getIdentityPolicyAdviceUnauthorized %+v", 401, o.Payload) -} -func (o *GetIdentityPolicyAdviceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityPolicyAdviceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityPolicyAdviceNotFound creates a GetIdentityPolicyAdviceNotFound with default headers values -func NewGetIdentityPolicyAdviceNotFound() *GetIdentityPolicyAdviceNotFound { - return &GetIdentityPolicyAdviceNotFound{} -} - -/* GetIdentityPolicyAdviceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type GetIdentityPolicyAdviceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityPolicyAdviceNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/policy-advice/{serviceId}][%d] getIdentityPolicyAdviceNotFound %+v", 404, o.Payload) -} -func (o *GetIdentityPolicyAdviceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityPolicyAdviceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/get_identity_posture_data_parameters.go b/rest_management_api_client/identity/get_identity_posture_data_parameters.go deleted file mode 100644 index d2a72343e..000000000 --- a/rest_management_api_client/identity/get_identity_posture_data_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityPostureDataParams creates a new GetIdentityPostureDataParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetIdentityPostureDataParams() *GetIdentityPostureDataParams { - return &GetIdentityPostureDataParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetIdentityPostureDataParamsWithTimeout creates a new GetIdentityPostureDataParams object -// with the ability to set a timeout on a request. -func NewGetIdentityPostureDataParamsWithTimeout(timeout time.Duration) *GetIdentityPostureDataParams { - return &GetIdentityPostureDataParams{ - timeout: timeout, - } -} - -// NewGetIdentityPostureDataParamsWithContext creates a new GetIdentityPostureDataParams object -// with the ability to set a context for a request. -func NewGetIdentityPostureDataParamsWithContext(ctx context.Context) *GetIdentityPostureDataParams { - return &GetIdentityPostureDataParams{ - Context: ctx, - } -} - -// NewGetIdentityPostureDataParamsWithHTTPClient creates a new GetIdentityPostureDataParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetIdentityPostureDataParamsWithHTTPClient(client *http.Client) *GetIdentityPostureDataParams { - return &GetIdentityPostureDataParams{ - HTTPClient: client, - } -} - -/* GetIdentityPostureDataParams contains all the parameters to send to the API endpoint - for the get identity posture data operation. - - Typically these are written to a http.Request. -*/ -type GetIdentityPostureDataParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get identity posture data params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityPostureDataParams) WithDefaults() *GetIdentityPostureDataParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get identity posture data params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetIdentityPostureDataParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get identity posture data params -func (o *GetIdentityPostureDataParams) WithTimeout(timeout time.Duration) *GetIdentityPostureDataParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get identity posture data params -func (o *GetIdentityPostureDataParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get identity posture data params -func (o *GetIdentityPostureDataParams) WithContext(ctx context.Context) *GetIdentityPostureDataParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get identity posture data params -func (o *GetIdentityPostureDataParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get identity posture data params -func (o *GetIdentityPostureDataParams) WithHTTPClient(client *http.Client) *GetIdentityPostureDataParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get identity posture data params -func (o *GetIdentityPostureDataParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the get identity posture data params -func (o *GetIdentityPostureDataParams) WithID(id string) *GetIdentityPostureDataParams { - o.SetID(id) - return o -} - -// SetID adds the id to the get identity posture data params -func (o *GetIdentityPostureDataParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *GetIdentityPostureDataParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/get_identity_posture_data_responses.go b/rest_management_api_client/identity/get_identity_posture_data_responses.go deleted file mode 100644 index 851c12854..000000000 --- a/rest_management_api_client/identity/get_identity_posture_data_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityPostureDataReader is a Reader for the GetIdentityPostureData structure. -type GetIdentityPostureDataReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetIdentityPostureDataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetIdentityPostureDataOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetIdentityPostureDataUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetIdentityPostureDataNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewGetIdentityPostureDataOK creates a GetIdentityPostureDataOK with default headers values -func NewGetIdentityPostureDataOK() *GetIdentityPostureDataOK { - return &GetIdentityPostureDataOK{} -} - -/* GetIdentityPostureDataOK describes a response with status code 200, with default header values. - -Returns the document that represents posture data -*/ -type GetIdentityPostureDataOK struct { - Payload *rest_model.PostureDataEnvelope -} - -func (o *GetIdentityPostureDataOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/posture-data][%d] getIdentityPostureDataOK %+v", 200, o.Payload) -} -func (o *GetIdentityPostureDataOK) GetPayload() *rest_model.PostureDataEnvelope { - return o.Payload -} - -func (o *GetIdentityPostureDataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.PostureDataEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityPostureDataUnauthorized creates a GetIdentityPostureDataUnauthorized with default headers values -func NewGetIdentityPostureDataUnauthorized() *GetIdentityPostureDataUnauthorized { - return &GetIdentityPostureDataUnauthorized{} -} - -/* GetIdentityPostureDataUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type GetIdentityPostureDataUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityPostureDataUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/posture-data][%d] getIdentityPostureDataUnauthorized %+v", 401, o.Payload) -} -func (o *GetIdentityPostureDataUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityPostureDataUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetIdentityPostureDataNotFound creates a GetIdentityPostureDataNotFound with default headers values -func NewGetIdentityPostureDataNotFound() *GetIdentityPostureDataNotFound { - return &GetIdentityPostureDataNotFound{} -} - -/* GetIdentityPostureDataNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type GetIdentityPostureDataNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *GetIdentityPostureDataNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/posture-data][%d] getIdentityPostureDataNotFound %+v", 404, o.Payload) -} -func (o *GetIdentityPostureDataNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *GetIdentityPostureDataNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/identity_client.go b/rest_management_api_client/identity/identity_client.go deleted file mode 100644 index a44fa8ee7..000000000 --- a/rest_management_api_client/identity/identity_client.go +++ /dev/null @@ -1,1114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new identity API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for identity API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - AssociateIdentitysServiceConfigs(params *AssociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AssociateIdentitysServiceConfigsOK, error) - - CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIdentityCreated, error) - - DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIdentityOK, error) - - DetailIdentity(params *DetailIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityOK, error) - - DetailIdentityType(params *DetailIdentityTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityTypeOK, error) - - DisableIdentity(params *DisableIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableIdentityOK, error) - - DisassociateIdentitysServiceConfigs(params *DisassociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisassociateIdentitysServiceConfigsOK, error) - - EnableIdentity(params *EnableIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableIdentityOK, error) - - GetIdentityAuthenticators(params *GetIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityAuthenticatorsOK, error) - - GetIdentityEnrollments(params *GetIdentityEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityEnrollmentsOK, error) - - GetIdentityFailedServiceRequests(params *GetIdentityFailedServiceRequestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityFailedServiceRequestsOK, error) - - GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPolicyAdviceOK, error) - - GetIdentityPostureData(params *GetIdentityPostureDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPostureDataOK, error) - - ListIdentities(params *ListIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitiesOK, error) - - ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityEdgeRoutersOK, error) - - ListIdentityServicePolicies(params *ListIdentityServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicePoliciesOK, error) - - ListIdentityServices(params *ListIdentityServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicesOK, error) - - ListIdentityTypes(params *ListIdentityTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityTypesOK, error) - - ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysEdgeRouterPoliciesOK, error) - - ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysServiceConfigsOK, error) - - PatchIdentity(params *PatchIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchIdentityOK, error) - - RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveIdentityMfaOK, error) - - UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIdentityOK, error) - - UpdateIdentityTracing(params *UpdateIdentityTracingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIdentityTracingOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - AssociateIdentitysServiceConfigs associates service configs for a specific identity - - Associate service configs to a specific identity -*/ -func (a *Client) AssociateIdentitysServiceConfigs(params *AssociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AssociateIdentitysServiceConfigsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewAssociateIdentitysServiceConfigsParams() - } - op := &runtime.ClientOperation{ - ID: "associateIdentitysServiceConfigs", - Method: "POST", - PathPattern: "/identities/{id}/service-configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &AssociateIdentitysServiceConfigsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*AssociateIdentitysServiceConfigsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for associateIdentitysServiceConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateIdentity creates an identity resource - - Create an identity resource. Requires admin access. -*/ -func (a *Client) CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIdentityCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "createIdentity", - Method: "POST", - PathPattern: "/identities", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateIdentityCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteIdentity deletes an identity - - Delete an identity by id. Requires admin access. -*/ -func (a *Client) DeleteIdentity(params *DeleteIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "deleteIdentity", - Method: "DELETE", - PathPattern: "/identities/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailIdentity retrieves a single identity - - Retrieves a single identity by id. Requires admin access. -*/ -func (a *Client) DetailIdentity(params *DetailIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "detailIdentity", - Method: "GET", - PathPattern: "/identities/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailIdentityType retrieves a identity type - - Retrieves a single identity type by id. Requires admin access. -*/ -func (a *Client) DetailIdentityType(params *DetailIdentityTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailIdentityTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailIdentityTypeParams() - } - op := &runtime.ClientOperation{ - ID: "detailIdentityType", - Method: "GET", - PathPattern: "/identity-types/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailIdentityTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailIdentityTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailIdentityType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DisableIdentity sets an identity as disabled - - Allows an admin disable an identity for a set amount of time or indefinitely. - -*/ -func (a *Client) DisableIdentity(params *DisableIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDisableIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "disableIdentity", - Method: "POST", - PathPattern: "/identities/{id}/disable", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DisableIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DisableIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for disableIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DisassociateIdentitysServiceConfigs removes associated service configs from a specific identity - - Remove service configs from a specific identity -*/ -func (a *Client) DisassociateIdentitysServiceConfigs(params *DisassociateIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisassociateIdentitysServiceConfigsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDisassociateIdentitysServiceConfigsParams() - } - op := &runtime.ClientOperation{ - ID: "disassociateIdentitysServiceConfigs", - Method: "DELETE", - PathPattern: "/identities/{id}/service-configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DisassociateIdentitysServiceConfigsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DisassociateIdentitysServiceConfigsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for disassociateIdentitysServiceConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - EnableIdentity clears all disabled state from an identity - - Allows an admin to remove disabled statuses from an identity. - -*/ -func (a *Client) EnableIdentity(params *EnableIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*EnableIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewEnableIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "enableIdentity", - Method: "POST", - PathPattern: "/identities/{id}/enable", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &EnableIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*EnableIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for enableIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetIdentityAuthenticators retrieves the current authenticators of a specific identity - - Returns a list of authenticators associated to the identity specified - -*/ -func (a *Client) GetIdentityAuthenticators(params *GetIdentityAuthenticatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityAuthenticatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetIdentityAuthenticatorsParams() - } - op := &runtime.ClientOperation{ - ID: "getIdentityAuthenticators", - Method: "GET", - PathPattern: "/identities/{id}/authenticators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetIdentityAuthenticatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetIdentityAuthenticatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getIdentityAuthenticators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetIdentityEnrollments retrieves the current enrollments of a specific identity - - Returns a list of enrollments associated to the identity specified - -*/ -func (a *Client) GetIdentityEnrollments(params *GetIdentityEnrollmentsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityEnrollmentsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetIdentityEnrollmentsParams() - } - op := &runtime.ClientOperation{ - ID: "getIdentityEnrollments", - Method: "GET", - PathPattern: "/identities/{id}/enrollments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetIdentityEnrollmentsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetIdentityEnrollmentsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getIdentityEnrollments: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetIdentityFailedServiceRequests retrieves a list of the most recent service failure requests due to posture checks - - Returns a list of service session requests that failed due to posture checks. The entries will contain -every policy that was verified against and every failed check in each policy. Each check will include -the historical posture data and posture check configuration. - -*/ -func (a *Client) GetIdentityFailedServiceRequests(params *GetIdentityFailedServiceRequestsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityFailedServiceRequestsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetIdentityFailedServiceRequestsParams() - } - op := &runtime.ClientOperation{ - ID: "getIdentityFailedServiceRequests", - Method: "GET", - PathPattern: "/identities/{id}/failed-service-requests", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetIdentityFailedServiceRequestsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetIdentityFailedServiceRequestsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getIdentityFailedServiceRequests: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetIdentityPolicyAdvice analyzes policies relating the given identity and service - - Analyzes policies to see if the given identity should be able to dial or bind the given service. | -Will check services policies to see if the identity can access the service. Will check edge router policies | -to check if the identity and service have access to common edge routers so that a connnection can be made. | -Will also check if at least one edge router is on-line. Requires admin access. - -*/ -func (a *Client) GetIdentityPolicyAdvice(params *GetIdentityPolicyAdviceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPolicyAdviceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetIdentityPolicyAdviceParams() - } - op := &runtime.ClientOperation{ - ID: "getIdentityPolicyAdvice", - Method: "GET", - PathPattern: "/identities/{id}/policy-advice/{serviceId}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetIdentityPolicyAdviceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetIdentityPolicyAdviceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getIdentityPolicyAdvice: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetIdentityPostureData retrieves the curent posture data for a specific identity - - Returns a nested map data represeting the posture data of the identity. -This data should be considered volatile. - -*/ -func (a *Client) GetIdentityPostureData(params *GetIdentityPostureDataParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetIdentityPostureDataOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetIdentityPostureDataParams() - } - op := &runtime.ClientOperation{ - ID: "getIdentityPostureData", - Method: "GET", - PathPattern: "/identities/{id}/posture-data", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &GetIdentityPostureDataReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetIdentityPostureDataOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getIdentityPostureData: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentities lists identities - - Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListIdentities(params *ListIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentitiesParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentities", - Method: "GET", - PathPattern: "/identities", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentitiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentitiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentityEdgeRouters lists accessible edge routers - - Retrieves a list of edge-routers that the given identity may use to access services. Supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListIdentityEdgeRouters(params *ListIdentityEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityEdgeRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentityEdgeRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentityEdgeRouters", - Method: "GET", - PathPattern: "/identities/{id}/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentityEdgeRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentityEdgeRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentityEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentityServicePolicies lists the service policies that affect an identity - - Retrieves a list of service policies that apply to the specified identity. -*/ -func (a *Client) ListIdentityServicePolicies(params *ListIdentityServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicePoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentityServicePoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentityServicePolicies", - Method: "GET", - PathPattern: "/identities/{id}/service-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentityServicePoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentityServicePoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentityServicePolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentityServices lists accessible services - - Retrieves a list of services that the given identity has access to. Supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListIdentityServices(params *ListIdentityServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentityServicesParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentityServices", - Method: "GET", - PathPattern: "/identities/{id}/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentityServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentityServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentityServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentityTypes lists available identity types - - Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListIdentityTypes(params *ListIdentityTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityTypesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentityTypesParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentityTypes", - Method: "GET", - PathPattern: "/identity-types", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentityTypesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentityTypesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentityTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentitysEdgeRouterPolicies lists the edge router policies that affect an identity - - Retrieves a list of edge router policies that apply to the specified identity. -*/ -func (a *Client) ListIdentitysEdgeRouterPolicies(params *ListIdentitysEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysEdgeRouterPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentitysEdgeRouterPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentitysEdgeRouterPolicies", - Method: "GET", - PathPattern: "/identities/{id}/edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentitysEdgeRouterPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentitysEdgeRouterPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentitysEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentitysServiceConfigs lists the service configs associated a specific identity - - Retrieves a list of service configs associated to a specific identity -*/ -func (a *Client) ListIdentitysServiceConfigs(params *ListIdentitysServiceConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentitysServiceConfigsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentitysServiceConfigsParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentitysServiceConfigs", - Method: "GET", - PathPattern: "/identities/{id}/service-configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentitysServiceConfigsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentitysServiceConfigsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentitysServiceConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchIdentity updates the supplied fields on an identity - - Update the supplied fields on an identity. Requires admin access. -*/ -func (a *Client) PatchIdentity(params *PatchIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "patchIdentity", - Method: "PATCH", - PathPattern: "/identities/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - RemoveIdentityMfa removes m f a from an identitity - - Allows an admin to remove MFA enrollment from a specific identity. Requires admin. - -*/ -func (a *Client) RemoveIdentityMfa(params *RemoveIdentityMfaParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveIdentityMfaOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRemoveIdentityMfaParams() - } - op := &runtime.ClientOperation{ - ID: "removeIdentityMfa", - Method: "DELETE", - PathPattern: "/identities/{id}/mfa", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &RemoveIdentityMfaReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*RemoveIdentityMfaOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for removeIdentityMfa: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateIdentity updates all fields on an identity - - Update all fields on an identity by id. Requires admin access. -*/ -func (a *Client) UpdateIdentity(params *UpdateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIdentityOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateIdentityParams() - } - op := &runtime.ClientOperation{ - ID: "updateIdentity", - Method: "PUT", - PathPattern: "/identities/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateIdentityReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateIdentityOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateIdentity: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateIdentityTracing enables disable data flow tracing for an identity - - Allows an admin to enable/disable data flow tracing for an identity - -*/ -func (a *Client) UpdateIdentityTracing(params *UpdateIdentityTracingParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateIdentityTracingOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateIdentityTracingParams() - } - op := &runtime.ClientOperation{ - ID: "updateIdentityTracing", - Method: "PUT", - PathPattern: "/identities/{id}/trace", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateIdentityTracingReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateIdentityTracingOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateIdentityTracing: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/identity/list_identities_parameters.go b/rest_management_api_client/identity/list_identities_parameters.go deleted file mode 100644 index e0ccc71e4..000000000 --- a/rest_management_api_client/identity/list_identities_parameters.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListIdentitiesParams creates a new ListIdentitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentitiesParams() *ListIdentitiesParams { - return &ListIdentitiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentitiesParamsWithTimeout creates a new ListIdentitiesParams object -// with the ability to set a timeout on a request. -func NewListIdentitiesParamsWithTimeout(timeout time.Duration) *ListIdentitiesParams { - return &ListIdentitiesParams{ - timeout: timeout, - } -} - -// NewListIdentitiesParamsWithContext creates a new ListIdentitiesParams object -// with the ability to set a context for a request. -func NewListIdentitiesParamsWithContext(ctx context.Context) *ListIdentitiesParams { - return &ListIdentitiesParams{ - Context: ctx, - } -} - -// NewListIdentitiesParamsWithHTTPClient creates a new ListIdentitiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentitiesParamsWithHTTPClient(client *http.Client) *ListIdentitiesParams { - return &ListIdentitiesParams{ - HTTPClient: client, - } -} - -/* ListIdentitiesParams contains all the parameters to send to the API endpoint - for the list identities operation. - - Typically these are written to a http.Request. -*/ -type ListIdentitiesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - // RoleFilter. - RoleFilter []string - - // RoleSemantic. - RoleSemantic *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitiesParams) WithDefaults() *ListIdentitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitiesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identities params -func (o *ListIdentitiesParams) WithTimeout(timeout time.Duration) *ListIdentitiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identities params -func (o *ListIdentitiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identities params -func (o *ListIdentitiesParams) WithContext(ctx context.Context) *ListIdentitiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identities params -func (o *ListIdentitiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identities params -func (o *ListIdentitiesParams) WithHTTPClient(client *http.Client) *ListIdentitiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identities params -func (o *ListIdentitiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list identities params -func (o *ListIdentitiesParams) WithFilter(filter *string) *ListIdentitiesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list identities params -func (o *ListIdentitiesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list identities params -func (o *ListIdentitiesParams) WithLimit(limit *int64) *ListIdentitiesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list identities params -func (o *ListIdentitiesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list identities params -func (o *ListIdentitiesParams) WithOffset(offset *int64) *ListIdentitiesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list identities params -func (o *ListIdentitiesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithRoleFilter adds the roleFilter to the list identities params -func (o *ListIdentitiesParams) WithRoleFilter(roleFilter []string) *ListIdentitiesParams { - o.SetRoleFilter(roleFilter) - return o -} - -// SetRoleFilter adds the roleFilter to the list identities params -func (o *ListIdentitiesParams) SetRoleFilter(roleFilter []string) { - o.RoleFilter = roleFilter -} - -// WithRoleSemantic adds the roleSemantic to the list identities params -func (o *ListIdentitiesParams) WithRoleSemantic(roleSemantic *string) *ListIdentitiesParams { - o.SetRoleSemantic(roleSemantic) - return o -} - -// SetRoleSemantic adds the roleSemantic to the list identities params -func (o *ListIdentitiesParams) SetRoleSemantic(roleSemantic *string) { - o.RoleSemantic = roleSemantic -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if o.RoleFilter != nil { - - // binding items for roleFilter - joinedRoleFilter := o.bindParamRoleFilter(reg) - - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err - } - } - - if o.RoleSemantic != nil { - - // query param roleSemantic - var qrRoleSemantic string - - if o.RoleSemantic != nil { - qrRoleSemantic = *o.RoleSemantic - } - qRoleSemantic := qrRoleSemantic - if qRoleSemantic != "" { - - if err := r.SetQueryParam("roleSemantic", qRoleSemantic); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamListIdentities binds the parameter roleFilter -func (o *ListIdentitiesParams) bindParamRoleFilter(formats strfmt.Registry) []string { - roleFilterIR := o.RoleFilter - - var roleFilterIC []string - for _, roleFilterIIR := range roleFilterIR { // explode []string - - roleFilterIIV := roleFilterIIR // string as string - roleFilterIC = append(roleFilterIC, roleFilterIIV) - } - - // items.CollectionFormat: "multi" - roleFilterIS := swag.JoinByFormat(roleFilterIC, "multi") - - return roleFilterIS -} diff --git a/rest_management_api_client/identity/list_identities_responses.go b/rest_management_api_client/identity/list_identities_responses.go deleted file mode 100644 index 436f8d6de..000000000 --- a/rest_management_api_client/identity/list_identities_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentitiesReader is a Reader for the ListIdentities structure. -type ListIdentitiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentitiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListIdentitiesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListIdentitiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentitiesOK creates a ListIdentitiesOK with default headers values -func NewListIdentitiesOK() *ListIdentitiesOK { - return &ListIdentitiesOK{} -} - -/* ListIdentitiesOK describes a response with status code 200, with default header values. - -A list of identities -*/ -type ListIdentitiesOK struct { - Payload *rest_model.ListIdentitiesEnvelope -} - -func (o *ListIdentitiesOK) Error() string { - return fmt.Sprintf("[GET /identities][%d] listIdentitiesOK %+v", 200, o.Payload) -} -func (o *ListIdentitiesOK) GetPayload() *rest_model.ListIdentitiesEnvelope { - return o.Payload -} - -func (o *ListIdentitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListIdentitiesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentitiesBadRequest creates a ListIdentitiesBadRequest with default headers values -func NewListIdentitiesBadRequest() *ListIdentitiesBadRequest { - return &ListIdentitiesBadRequest{} -} - -/* ListIdentitiesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListIdentitiesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentitiesBadRequest) Error() string { - return fmt.Sprintf("[GET /identities][%d] listIdentitiesBadRequest %+v", 400, o.Payload) -} -func (o *ListIdentitiesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentitiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentitiesUnauthorized creates a ListIdentitiesUnauthorized with default headers values -func NewListIdentitiesUnauthorized() *ListIdentitiesUnauthorized { - return &ListIdentitiesUnauthorized{} -} - -/* ListIdentitiesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentitiesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentitiesUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities][%d] listIdentitiesUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentitiesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/list_identity_edge_routers_parameters.go b/rest_management_api_client/identity/list_identity_edge_routers_parameters.go deleted file mode 100644 index 9205330fc..000000000 --- a/rest_management_api_client/identity/list_identity_edge_routers_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListIdentityEdgeRoutersParams creates a new ListIdentityEdgeRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentityEdgeRoutersParams() *ListIdentityEdgeRoutersParams { - return &ListIdentityEdgeRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentityEdgeRoutersParamsWithTimeout creates a new ListIdentityEdgeRoutersParams object -// with the ability to set a timeout on a request. -func NewListIdentityEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListIdentityEdgeRoutersParams { - return &ListIdentityEdgeRoutersParams{ - timeout: timeout, - } -} - -// NewListIdentityEdgeRoutersParamsWithContext creates a new ListIdentityEdgeRoutersParams object -// with the ability to set a context for a request. -func NewListIdentityEdgeRoutersParamsWithContext(ctx context.Context) *ListIdentityEdgeRoutersParams { - return &ListIdentityEdgeRoutersParams{ - Context: ctx, - } -} - -// NewListIdentityEdgeRoutersParamsWithHTTPClient creates a new ListIdentityEdgeRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentityEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListIdentityEdgeRoutersParams { - return &ListIdentityEdgeRoutersParams{ - HTTPClient: client, - } -} - -/* ListIdentityEdgeRoutersParams contains all the parameters to send to the API endpoint - for the list identity edge routers operation. - - Typically these are written to a http.Request. -*/ -type ListIdentityEdgeRoutersParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identity edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityEdgeRoutersParams) WithDefaults() *ListIdentityEdgeRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identity edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityEdgeRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) WithTimeout(timeout time.Duration) *ListIdentityEdgeRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) WithContext(ctx context.Context) *ListIdentityEdgeRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) WithHTTPClient(client *http.Client) *ListIdentityEdgeRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) WithID(id string) *ListIdentityEdgeRoutersParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list identity edge routers params -func (o *ListIdentityEdgeRoutersParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentityEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/list_identity_edge_routers_responses.go b/rest_management_api_client/identity/list_identity_edge_routers_responses.go deleted file mode 100644 index ab33d6e82..000000000 --- a/rest_management_api_client/identity/list_identity_edge_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityEdgeRoutersReader is a Reader for the ListIdentityEdgeRouters structure. -type ListIdentityEdgeRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentityEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentityEdgeRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListIdentityEdgeRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListIdentityEdgeRoutersNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentityEdgeRoutersOK creates a ListIdentityEdgeRoutersOK with default headers values -func NewListIdentityEdgeRoutersOK() *ListIdentityEdgeRoutersOK { - return &ListIdentityEdgeRoutersOK{} -} - -/* ListIdentityEdgeRoutersOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type ListIdentityEdgeRoutersOK struct { - Payload *rest_model.ListEdgeRoutersEnvelope -} - -func (o *ListIdentityEdgeRoutersOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/edge-routers][%d] listIdentityEdgeRoutersOK %+v", 200, o.Payload) -} -func (o *ListIdentityEdgeRoutersOK) GetPayload() *rest_model.ListEdgeRoutersEnvelope { - return o.Payload -} - -func (o *ListIdentityEdgeRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityEdgeRoutersUnauthorized creates a ListIdentityEdgeRoutersUnauthorized with default headers values -func NewListIdentityEdgeRoutersUnauthorized() *ListIdentityEdgeRoutersUnauthorized { - return &ListIdentityEdgeRoutersUnauthorized{} -} - -/* ListIdentityEdgeRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentityEdgeRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityEdgeRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/edge-routers][%d] listIdentityEdgeRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentityEdgeRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityEdgeRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityEdgeRoutersNotFound creates a ListIdentityEdgeRoutersNotFound with default headers values -func NewListIdentityEdgeRoutersNotFound() *ListIdentityEdgeRoutersNotFound { - return &ListIdentityEdgeRoutersNotFound{} -} - -/* ListIdentityEdgeRoutersNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListIdentityEdgeRoutersNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityEdgeRoutersNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/edge-routers][%d] listIdentityEdgeRoutersNotFound %+v", 404, o.Payload) -} -func (o *ListIdentityEdgeRoutersNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityEdgeRoutersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/list_identity_service_policies_parameters.go b/rest_management_api_client/identity/list_identity_service_policies_parameters.go deleted file mode 100644 index 82f8eb6da..000000000 --- a/rest_management_api_client/identity/list_identity_service_policies_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListIdentityServicePoliciesParams creates a new ListIdentityServicePoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentityServicePoliciesParams() *ListIdentityServicePoliciesParams { - return &ListIdentityServicePoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentityServicePoliciesParamsWithTimeout creates a new ListIdentityServicePoliciesParams object -// with the ability to set a timeout on a request. -func NewListIdentityServicePoliciesParamsWithTimeout(timeout time.Duration) *ListIdentityServicePoliciesParams { - return &ListIdentityServicePoliciesParams{ - timeout: timeout, - } -} - -// NewListIdentityServicePoliciesParamsWithContext creates a new ListIdentityServicePoliciesParams object -// with the ability to set a context for a request. -func NewListIdentityServicePoliciesParamsWithContext(ctx context.Context) *ListIdentityServicePoliciesParams { - return &ListIdentityServicePoliciesParams{ - Context: ctx, - } -} - -// NewListIdentityServicePoliciesParamsWithHTTPClient creates a new ListIdentityServicePoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentityServicePoliciesParamsWithHTTPClient(client *http.Client) *ListIdentityServicePoliciesParams { - return &ListIdentityServicePoliciesParams{ - HTTPClient: client, - } -} - -/* ListIdentityServicePoliciesParams contains all the parameters to send to the API endpoint - for the list identity service policies operation. - - Typically these are written to a http.Request. -*/ -type ListIdentityServicePoliciesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identity service policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityServicePoliciesParams) WithDefaults() *ListIdentityServicePoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identity service policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityServicePoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) WithTimeout(timeout time.Duration) *ListIdentityServicePoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) WithContext(ctx context.Context) *ListIdentityServicePoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) WithHTTPClient(client *http.Client) *ListIdentityServicePoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) WithID(id string) *ListIdentityServicePoliciesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list identity service policies params -func (o *ListIdentityServicePoliciesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentityServicePoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/list_identity_service_policies_responses.go b/rest_management_api_client/identity/list_identity_service_policies_responses.go deleted file mode 100644 index 236efae20..000000000 --- a/rest_management_api_client/identity/list_identity_service_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityServicePoliciesReader is a Reader for the ListIdentityServicePolicies structure. -type ListIdentityServicePoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentityServicePoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentityServicePoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListIdentityServicePoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListIdentityServicePoliciesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentityServicePoliciesOK creates a ListIdentityServicePoliciesOK with default headers values -func NewListIdentityServicePoliciesOK() *ListIdentityServicePoliciesOK { - return &ListIdentityServicePoliciesOK{} -} - -/* ListIdentityServicePoliciesOK describes a response with status code 200, with default header values. - -A list of service policies -*/ -type ListIdentityServicePoliciesOK struct { - Payload *rest_model.ListServicePoliciesEnvelope -} - -func (o *ListIdentityServicePoliciesOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/service-policies][%d] listIdentityServicePoliciesOK %+v", 200, o.Payload) -} -func (o *ListIdentityServicePoliciesOK) GetPayload() *rest_model.ListServicePoliciesEnvelope { - return o.Payload -} - -func (o *ListIdentityServicePoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicePoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityServicePoliciesUnauthorized creates a ListIdentityServicePoliciesUnauthorized with default headers values -func NewListIdentityServicePoliciesUnauthorized() *ListIdentityServicePoliciesUnauthorized { - return &ListIdentityServicePoliciesUnauthorized{} -} - -/* ListIdentityServicePoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentityServicePoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityServicePoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/service-policies][%d] listIdentityServicePoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentityServicePoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityServicePoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityServicePoliciesNotFound creates a ListIdentityServicePoliciesNotFound with default headers values -func NewListIdentityServicePoliciesNotFound() *ListIdentityServicePoliciesNotFound { - return &ListIdentityServicePoliciesNotFound{} -} - -/* ListIdentityServicePoliciesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListIdentityServicePoliciesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityServicePoliciesNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/service-policies][%d] listIdentityServicePoliciesNotFound %+v", 404, o.Payload) -} -func (o *ListIdentityServicePoliciesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityServicePoliciesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/list_identity_services_parameters.go b/rest_management_api_client/identity/list_identity_services_parameters.go deleted file mode 100644 index 0a3df1c37..000000000 --- a/rest_management_api_client/identity/list_identity_services_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListIdentityServicesParams creates a new ListIdentityServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentityServicesParams() *ListIdentityServicesParams { - return &ListIdentityServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentityServicesParamsWithTimeout creates a new ListIdentityServicesParams object -// with the ability to set a timeout on a request. -func NewListIdentityServicesParamsWithTimeout(timeout time.Duration) *ListIdentityServicesParams { - return &ListIdentityServicesParams{ - timeout: timeout, - } -} - -// NewListIdentityServicesParamsWithContext creates a new ListIdentityServicesParams object -// with the ability to set a context for a request. -func NewListIdentityServicesParamsWithContext(ctx context.Context) *ListIdentityServicesParams { - return &ListIdentityServicesParams{ - Context: ctx, - } -} - -// NewListIdentityServicesParamsWithHTTPClient creates a new ListIdentityServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentityServicesParamsWithHTTPClient(client *http.Client) *ListIdentityServicesParams { - return &ListIdentityServicesParams{ - HTTPClient: client, - } -} - -/* ListIdentityServicesParams contains all the parameters to send to the API endpoint - for the list identity services operation. - - Typically these are written to a http.Request. -*/ -type ListIdentityServicesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identity services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityServicesParams) WithDefaults() *ListIdentityServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identity services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identity services params -func (o *ListIdentityServicesParams) WithTimeout(timeout time.Duration) *ListIdentityServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identity services params -func (o *ListIdentityServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identity services params -func (o *ListIdentityServicesParams) WithContext(ctx context.Context) *ListIdentityServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identity services params -func (o *ListIdentityServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identity services params -func (o *ListIdentityServicesParams) WithHTTPClient(client *http.Client) *ListIdentityServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identity services params -func (o *ListIdentityServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list identity services params -func (o *ListIdentityServicesParams) WithID(id string) *ListIdentityServicesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list identity services params -func (o *ListIdentityServicesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentityServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/list_identity_services_responses.go b/rest_management_api_client/identity/list_identity_services_responses.go deleted file mode 100644 index 276347742..000000000 --- a/rest_management_api_client/identity/list_identity_services_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityServicesReader is a Reader for the ListIdentityServices structure. -type ListIdentityServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentityServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentityServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListIdentityServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListIdentityServicesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentityServicesOK creates a ListIdentityServicesOK with default headers values -func NewListIdentityServicesOK() *ListIdentityServicesOK { - return &ListIdentityServicesOK{} -} - -/* ListIdentityServicesOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type ListIdentityServicesOK struct { - Payload *rest_model.ListEdgeRoutersEnvelope -} - -func (o *ListIdentityServicesOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/services][%d] listIdentityServicesOK %+v", 200, o.Payload) -} -func (o *ListIdentityServicesOK) GetPayload() *rest_model.ListEdgeRoutersEnvelope { - return o.Payload -} - -func (o *ListIdentityServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityServicesUnauthorized creates a ListIdentityServicesUnauthorized with default headers values -func NewListIdentityServicesUnauthorized() *ListIdentityServicesUnauthorized { - return &ListIdentityServicesUnauthorized{} -} - -/* ListIdentityServicesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentityServicesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/services][%d] listIdentityServicesUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentityServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityServicesNotFound creates a ListIdentityServicesNotFound with default headers values -func NewListIdentityServicesNotFound() *ListIdentityServicesNotFound { - return &ListIdentityServicesNotFound{} -} - -/* ListIdentityServicesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListIdentityServicesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityServicesNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/services][%d] listIdentityServicesNotFound %+v", 404, o.Payload) -} -func (o *ListIdentityServicesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/list_identity_types_parameters.go b/rest_management_api_client/identity/list_identity_types_parameters.go deleted file mode 100644 index 906095941..000000000 --- a/rest_management_api_client/identity/list_identity_types_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListIdentityTypesParams creates a new ListIdentityTypesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentityTypesParams() *ListIdentityTypesParams { - return &ListIdentityTypesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentityTypesParamsWithTimeout creates a new ListIdentityTypesParams object -// with the ability to set a timeout on a request. -func NewListIdentityTypesParamsWithTimeout(timeout time.Duration) *ListIdentityTypesParams { - return &ListIdentityTypesParams{ - timeout: timeout, - } -} - -// NewListIdentityTypesParamsWithContext creates a new ListIdentityTypesParams object -// with the ability to set a context for a request. -func NewListIdentityTypesParamsWithContext(ctx context.Context) *ListIdentityTypesParams { - return &ListIdentityTypesParams{ - Context: ctx, - } -} - -// NewListIdentityTypesParamsWithHTTPClient creates a new ListIdentityTypesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentityTypesParamsWithHTTPClient(client *http.Client) *ListIdentityTypesParams { - return &ListIdentityTypesParams{ - HTTPClient: client, - } -} - -/* ListIdentityTypesParams contains all the parameters to send to the API endpoint - for the list identity types operation. - - Typically these are written to a http.Request. -*/ -type ListIdentityTypesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identity types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityTypesParams) WithDefaults() *ListIdentityTypesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identity types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityTypesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identity types params -func (o *ListIdentityTypesParams) WithTimeout(timeout time.Duration) *ListIdentityTypesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identity types params -func (o *ListIdentityTypesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identity types params -func (o *ListIdentityTypesParams) WithContext(ctx context.Context) *ListIdentityTypesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identity types params -func (o *ListIdentityTypesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identity types params -func (o *ListIdentityTypesParams) WithHTTPClient(client *http.Client) *ListIdentityTypesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identity types params -func (o *ListIdentityTypesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list identity types params -func (o *ListIdentityTypesParams) WithFilter(filter *string) *ListIdentityTypesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list identity types params -func (o *ListIdentityTypesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list identity types params -func (o *ListIdentityTypesParams) WithLimit(limit *int64) *ListIdentityTypesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list identity types params -func (o *ListIdentityTypesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list identity types params -func (o *ListIdentityTypesParams) WithOffset(offset *int64) *ListIdentityTypesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list identity types params -func (o *ListIdentityTypesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentityTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/list_identity_types_responses.go b/rest_management_api_client/identity/list_identity_types_responses.go deleted file mode 100644 index 8b4c9a100..000000000 --- a/rest_management_api_client/identity/list_identity_types_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityTypesReader is a Reader for the ListIdentityTypes structure. -type ListIdentityTypesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentityTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentityTypesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListIdentityTypesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListIdentityTypesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentityTypesOK creates a ListIdentityTypesOK with default headers values -func NewListIdentityTypesOK() *ListIdentityTypesOK { - return &ListIdentityTypesOK{} -} - -/* ListIdentityTypesOK describes a response with status code 200, with default header values. - -A list of identity types -*/ -type ListIdentityTypesOK struct { - Payload *rest_model.ListIdentityTypesEnvelope -} - -func (o *ListIdentityTypesOK) Error() string { - return fmt.Sprintf("[GET /identity-types][%d] listIdentityTypesOK %+v", 200, o.Payload) -} -func (o *ListIdentityTypesOK) GetPayload() *rest_model.ListIdentityTypesEnvelope { - return o.Payload -} - -func (o *ListIdentityTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListIdentityTypesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityTypesBadRequest creates a ListIdentityTypesBadRequest with default headers values -func NewListIdentityTypesBadRequest() *ListIdentityTypesBadRequest { - return &ListIdentityTypesBadRequest{} -} - -/* ListIdentityTypesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListIdentityTypesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityTypesBadRequest) Error() string { - return fmt.Sprintf("[GET /identity-types][%d] listIdentityTypesBadRequest %+v", 400, o.Payload) -} -func (o *ListIdentityTypesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityTypesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityTypesUnauthorized creates a ListIdentityTypesUnauthorized with default headers values -func NewListIdentityTypesUnauthorized() *ListIdentityTypesUnauthorized { - return &ListIdentityTypesUnauthorized{} -} - -/* ListIdentityTypesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentityTypesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityTypesUnauthorized) Error() string { - return fmt.Sprintf("[GET /identity-types][%d] listIdentityTypesUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentityTypesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/list_identitys_edge_router_policies_parameters.go b/rest_management_api_client/identity/list_identitys_edge_router_policies_parameters.go deleted file mode 100644 index 83f9a9521..000000000 --- a/rest_management_api_client/identity/list_identitys_edge_router_policies_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListIdentitysEdgeRouterPoliciesParams creates a new ListIdentitysEdgeRouterPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentitysEdgeRouterPoliciesParams() *ListIdentitysEdgeRouterPoliciesParams { - return &ListIdentitysEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentitysEdgeRouterPoliciesParamsWithTimeout creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the ability to set a timeout on a request. -func NewListIdentitysEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListIdentitysEdgeRouterPoliciesParams { - return &ListIdentitysEdgeRouterPoliciesParams{ - timeout: timeout, - } -} - -// NewListIdentitysEdgeRouterPoliciesParamsWithContext creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the ability to set a context for a request. -func NewListIdentitysEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListIdentitysEdgeRouterPoliciesParams { - return &ListIdentitysEdgeRouterPoliciesParams{ - Context: ctx, - } -} - -// NewListIdentitysEdgeRouterPoliciesParamsWithHTTPClient creates a new ListIdentitysEdgeRouterPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentitysEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListIdentitysEdgeRouterPoliciesParams { - return &ListIdentitysEdgeRouterPoliciesParams{ - HTTPClient: client, - } -} - -/* ListIdentitysEdgeRouterPoliciesParams contains all the parameters to send to the API endpoint - for the list identitys edge router policies operation. - - Typically these are written to a http.Request. -*/ -type ListIdentitysEdgeRouterPoliciesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identitys edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitysEdgeRouterPoliciesParams) WithDefaults() *ListIdentitysEdgeRouterPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identitys edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitysEdgeRouterPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) WithTimeout(timeout time.Duration) *ListIdentitysEdgeRouterPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) WithContext(ctx context.Context) *ListIdentitysEdgeRouterPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) WithHTTPClient(client *http.Client) *ListIdentitysEdgeRouterPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) WithID(id string) *ListIdentitysEdgeRouterPoliciesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list identitys edge router policies params -func (o *ListIdentitysEdgeRouterPoliciesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentitysEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/list_identitys_edge_router_policies_responses.go b/rest_management_api_client/identity/list_identitys_edge_router_policies_responses.go deleted file mode 100644 index 5a8aaba40..000000000 --- a/rest_management_api_client/identity/list_identitys_edge_router_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentitysEdgeRouterPoliciesReader is a Reader for the ListIdentitysEdgeRouterPolicies structure. -type ListIdentitysEdgeRouterPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentitysEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentitysEdgeRouterPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListIdentitysEdgeRouterPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListIdentitysEdgeRouterPoliciesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentitysEdgeRouterPoliciesOK creates a ListIdentitysEdgeRouterPoliciesOK with default headers values -func NewListIdentitysEdgeRouterPoliciesOK() *ListIdentitysEdgeRouterPoliciesOK { - return &ListIdentitysEdgeRouterPoliciesOK{} -} - -/* ListIdentitysEdgeRouterPoliciesOK describes a response with status code 200, with default header values. - -A list of edge router policies -*/ -type ListIdentitysEdgeRouterPoliciesOK struct { - Payload *rest_model.ListEdgeRouterPoliciesEnvelope -} - -func (o *ListIdentitysEdgeRouterPoliciesOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/edge-router-policies][%d] listIdentitysEdgeRouterPoliciesOK %+v", 200, o.Payload) -} -func (o *ListIdentitysEdgeRouterPoliciesOK) GetPayload() *rest_model.ListEdgeRouterPoliciesEnvelope { - return o.Payload -} - -func (o *ListIdentitysEdgeRouterPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRouterPoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentitysEdgeRouterPoliciesUnauthorized creates a ListIdentitysEdgeRouterPoliciesUnauthorized with default headers values -func NewListIdentitysEdgeRouterPoliciesUnauthorized() *ListIdentitysEdgeRouterPoliciesUnauthorized { - return &ListIdentitysEdgeRouterPoliciesUnauthorized{} -} - -/* ListIdentitysEdgeRouterPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentitysEdgeRouterPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentitysEdgeRouterPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/edge-router-policies][%d] listIdentitysEdgeRouterPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentitysEdgeRouterPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentitysEdgeRouterPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentitysEdgeRouterPoliciesNotFound creates a ListIdentitysEdgeRouterPoliciesNotFound with default headers values -func NewListIdentitysEdgeRouterPoliciesNotFound() *ListIdentitysEdgeRouterPoliciesNotFound { - return &ListIdentitysEdgeRouterPoliciesNotFound{} -} - -/* ListIdentitysEdgeRouterPoliciesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListIdentitysEdgeRouterPoliciesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentitysEdgeRouterPoliciesNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/edge-router-policies][%d] listIdentitysEdgeRouterPoliciesNotFound %+v", 404, o.Payload) -} -func (o *ListIdentitysEdgeRouterPoliciesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentitysEdgeRouterPoliciesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/list_identitys_service_configs_parameters.go b/rest_management_api_client/identity/list_identitys_service_configs_parameters.go deleted file mode 100644 index 0659d5c81..000000000 --- a/rest_management_api_client/identity/list_identitys_service_configs_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListIdentitysServiceConfigsParams creates a new ListIdentitysServiceConfigsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentitysServiceConfigsParams() *ListIdentitysServiceConfigsParams { - return &ListIdentitysServiceConfigsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentitysServiceConfigsParamsWithTimeout creates a new ListIdentitysServiceConfigsParams object -// with the ability to set a timeout on a request. -func NewListIdentitysServiceConfigsParamsWithTimeout(timeout time.Duration) *ListIdentitysServiceConfigsParams { - return &ListIdentitysServiceConfigsParams{ - timeout: timeout, - } -} - -// NewListIdentitysServiceConfigsParamsWithContext creates a new ListIdentitysServiceConfigsParams object -// with the ability to set a context for a request. -func NewListIdentitysServiceConfigsParamsWithContext(ctx context.Context) *ListIdentitysServiceConfigsParams { - return &ListIdentitysServiceConfigsParams{ - Context: ctx, - } -} - -// NewListIdentitysServiceConfigsParamsWithHTTPClient creates a new ListIdentitysServiceConfigsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentitysServiceConfigsParamsWithHTTPClient(client *http.Client) *ListIdentitysServiceConfigsParams { - return &ListIdentitysServiceConfigsParams{ - HTTPClient: client, - } -} - -/* ListIdentitysServiceConfigsParams contains all the parameters to send to the API endpoint - for the list identitys service configs operation. - - Typically these are written to a http.Request. -*/ -type ListIdentitysServiceConfigsParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identitys service configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitysServiceConfigsParams) WithDefaults() *ListIdentitysServiceConfigsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identitys service configs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentitysServiceConfigsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) WithTimeout(timeout time.Duration) *ListIdentitysServiceConfigsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) WithContext(ctx context.Context) *ListIdentitysServiceConfigsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) WithHTTPClient(client *http.Client) *ListIdentitysServiceConfigsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) WithID(id string) *ListIdentitysServiceConfigsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list identitys service configs params -func (o *ListIdentitysServiceConfigsParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentitysServiceConfigsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/list_identitys_service_configs_responses.go b/rest_management_api_client/identity/list_identitys_service_configs_responses.go deleted file mode 100644 index f5834005a..000000000 --- a/rest_management_api_client/identity/list_identitys_service_configs_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentitysServiceConfigsReader is a Reader for the ListIdentitysServiceConfigs structure. -type ListIdentitysServiceConfigsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentitysServiceConfigsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentitysServiceConfigsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListIdentitysServiceConfigsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListIdentitysServiceConfigsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentitysServiceConfigsOK creates a ListIdentitysServiceConfigsOK with default headers values -func NewListIdentitysServiceConfigsOK() *ListIdentitysServiceConfigsOK { - return &ListIdentitysServiceConfigsOK{} -} - -/* ListIdentitysServiceConfigsOK describes a response with status code 200, with default header values. - -A list of service configs -*/ -type ListIdentitysServiceConfigsOK struct { - Payload *rest_model.ListServiceConfigsEnvelope -} - -func (o *ListIdentitysServiceConfigsOK) Error() string { - return fmt.Sprintf("[GET /identities/{id}/service-configs][%d] listIdentitysServiceConfigsOK %+v", 200, o.Payload) -} -func (o *ListIdentitysServiceConfigsOK) GetPayload() *rest_model.ListServiceConfigsEnvelope { - return o.Payload -} - -func (o *ListIdentitysServiceConfigsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServiceConfigsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentitysServiceConfigsUnauthorized creates a ListIdentitysServiceConfigsUnauthorized with default headers values -func NewListIdentitysServiceConfigsUnauthorized() *ListIdentitysServiceConfigsUnauthorized { - return &ListIdentitysServiceConfigsUnauthorized{} -} - -/* ListIdentitysServiceConfigsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentitysServiceConfigsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentitysServiceConfigsUnauthorized) Error() string { - return fmt.Sprintf("[GET /identities/{id}/service-configs][%d] listIdentitysServiceConfigsUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentitysServiceConfigsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentitysServiceConfigsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentitysServiceConfigsNotFound creates a ListIdentitysServiceConfigsNotFound with default headers values -func NewListIdentitysServiceConfigsNotFound() *ListIdentitysServiceConfigsNotFound { - return &ListIdentitysServiceConfigsNotFound{} -} - -/* ListIdentitysServiceConfigsNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListIdentitysServiceConfigsNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentitysServiceConfigsNotFound) Error() string { - return fmt.Sprintf("[GET /identities/{id}/service-configs][%d] listIdentitysServiceConfigsNotFound %+v", 404, o.Payload) -} -func (o *ListIdentitysServiceConfigsNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentitysServiceConfigsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/patch_identity_parameters.go b/rest_management_api_client/identity/patch_identity_parameters.go deleted file mode 100644 index fa5244894..000000000 --- a/rest_management_api_client/identity/patch_identity_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchIdentityParams creates a new PatchIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchIdentityParams() *PatchIdentityParams { - return &PatchIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchIdentityParamsWithTimeout creates a new PatchIdentityParams object -// with the ability to set a timeout on a request. -func NewPatchIdentityParamsWithTimeout(timeout time.Duration) *PatchIdentityParams { - return &PatchIdentityParams{ - timeout: timeout, - } -} - -// NewPatchIdentityParamsWithContext creates a new PatchIdentityParams object -// with the ability to set a context for a request. -func NewPatchIdentityParamsWithContext(ctx context.Context) *PatchIdentityParams { - return &PatchIdentityParams{ - Context: ctx, - } -} - -// NewPatchIdentityParamsWithHTTPClient creates a new PatchIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchIdentityParamsWithHTTPClient(client *http.Client) *PatchIdentityParams { - return &PatchIdentityParams{ - HTTPClient: client, - } -} - -/* PatchIdentityParams contains all the parameters to send to the API endpoint - for the patch identity operation. - - Typically these are written to a http.Request. -*/ -type PatchIdentityParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Identity. - - An identity patch object - */ - Identity *rest_model.IdentityPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchIdentityParams) WithDefaults() *PatchIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch identity params -func (o *PatchIdentityParams) WithTimeout(timeout time.Duration) *PatchIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch identity params -func (o *PatchIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch identity params -func (o *PatchIdentityParams) WithContext(ctx context.Context) *PatchIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch identity params -func (o *PatchIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch identity params -func (o *PatchIdentityParams) WithHTTPClient(client *http.Client) *PatchIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch identity params -func (o *PatchIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch identity params -func (o *PatchIdentityParams) WithID(id string) *PatchIdentityParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch identity params -func (o *PatchIdentityParams) SetID(id string) { - o.ID = id -} - -// WithIdentity adds the identity to the patch identity params -func (o *PatchIdentityParams) WithIdentity(identity *rest_model.IdentityPatch) *PatchIdentityParams { - o.SetIdentity(identity) - return o -} - -// SetIdentity adds the identity to the patch identity params -func (o *PatchIdentityParams) SetIdentity(identity *rest_model.IdentityPatch) { - o.Identity = identity -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Identity != nil { - if err := r.SetBodyParam(o.Identity); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/patch_identity_responses.go b/rest_management_api_client/identity/patch_identity_responses.go deleted file mode 100644 index 718b2aaf5..000000000 --- a/rest_management_api_client/identity/patch_identity_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchIdentityReader is a Reader for the PatchIdentity structure. -type PatchIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchIdentityBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchIdentityNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchIdentityOK creates a PatchIdentityOK with default headers values -func NewPatchIdentityOK() *PatchIdentityOK { - return &PatchIdentityOK{} -} - -/* PatchIdentityOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchIdentityOK struct { - Payload *rest_model.Empty -} - -func (o *PatchIdentityOK) Error() string { - return fmt.Sprintf("[PATCH /identities/{id}][%d] patchIdentityOK %+v", 200, o.Payload) -} -func (o *PatchIdentityOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchIdentityBadRequest creates a PatchIdentityBadRequest with default headers values -func NewPatchIdentityBadRequest() *PatchIdentityBadRequest { - return &PatchIdentityBadRequest{} -} - -/* PatchIdentityBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchIdentityBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchIdentityBadRequest) Error() string { - return fmt.Sprintf("[PATCH /identities/{id}][%d] patchIdentityBadRequest %+v", 400, o.Payload) -} -func (o *PatchIdentityBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchIdentityUnauthorized creates a PatchIdentityUnauthorized with default headers values -func NewPatchIdentityUnauthorized() *PatchIdentityUnauthorized { - return &PatchIdentityUnauthorized{} -} - -/* PatchIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchIdentityUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /identities/{id}][%d] patchIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *PatchIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchIdentityNotFound creates a PatchIdentityNotFound with default headers values -func NewPatchIdentityNotFound() *PatchIdentityNotFound { - return &PatchIdentityNotFound{} -} - -/* PatchIdentityNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchIdentityNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchIdentityNotFound) Error() string { - return fmt.Sprintf("[PATCH /identities/{id}][%d] patchIdentityNotFound %+v", 404, o.Payload) -} -func (o *PatchIdentityNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/remove_identity_mfa_parameters.go b/rest_management_api_client/identity/remove_identity_mfa_parameters.go deleted file mode 100644 index f26c9d605..000000000 --- a/rest_management_api_client/identity/remove_identity_mfa_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewRemoveIdentityMfaParams creates a new RemoveIdentityMfaParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRemoveIdentityMfaParams() *RemoveIdentityMfaParams { - return &RemoveIdentityMfaParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRemoveIdentityMfaParamsWithTimeout creates a new RemoveIdentityMfaParams object -// with the ability to set a timeout on a request. -func NewRemoveIdentityMfaParamsWithTimeout(timeout time.Duration) *RemoveIdentityMfaParams { - return &RemoveIdentityMfaParams{ - timeout: timeout, - } -} - -// NewRemoveIdentityMfaParamsWithContext creates a new RemoveIdentityMfaParams object -// with the ability to set a context for a request. -func NewRemoveIdentityMfaParamsWithContext(ctx context.Context) *RemoveIdentityMfaParams { - return &RemoveIdentityMfaParams{ - Context: ctx, - } -} - -// NewRemoveIdentityMfaParamsWithHTTPClient creates a new RemoveIdentityMfaParams object -// with the ability to set a custom HTTPClient for a request. -func NewRemoveIdentityMfaParamsWithHTTPClient(client *http.Client) *RemoveIdentityMfaParams { - return &RemoveIdentityMfaParams{ - HTTPClient: client, - } -} - -/* RemoveIdentityMfaParams contains all the parameters to send to the API endpoint - for the remove identity mfa operation. - - Typically these are written to a http.Request. -*/ -type RemoveIdentityMfaParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the remove identity mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveIdentityMfaParams) WithDefaults() *RemoveIdentityMfaParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the remove identity mfa params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RemoveIdentityMfaParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the remove identity mfa params -func (o *RemoveIdentityMfaParams) WithTimeout(timeout time.Duration) *RemoveIdentityMfaParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the remove identity mfa params -func (o *RemoveIdentityMfaParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the remove identity mfa params -func (o *RemoveIdentityMfaParams) WithContext(ctx context.Context) *RemoveIdentityMfaParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the remove identity mfa params -func (o *RemoveIdentityMfaParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the remove identity mfa params -func (o *RemoveIdentityMfaParams) WithHTTPClient(client *http.Client) *RemoveIdentityMfaParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the remove identity mfa params -func (o *RemoveIdentityMfaParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the remove identity mfa params -func (o *RemoveIdentityMfaParams) WithID(id string) *RemoveIdentityMfaParams { - o.SetID(id) - return o -} - -// SetID adds the id to the remove identity mfa params -func (o *RemoveIdentityMfaParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *RemoveIdentityMfaParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/remove_identity_mfa_responses.go b/rest_management_api_client/identity/remove_identity_mfa_responses.go deleted file mode 100644 index 7dd99aed1..000000000 --- a/rest_management_api_client/identity/remove_identity_mfa_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// RemoveIdentityMfaReader is a Reader for the RemoveIdentityMfa structure. -type RemoveIdentityMfaReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RemoveIdentityMfaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewRemoveIdentityMfaOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewRemoveIdentityMfaUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewRemoveIdentityMfaNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewRemoveIdentityMfaOK creates a RemoveIdentityMfaOK with default headers values -func NewRemoveIdentityMfaOK() *RemoveIdentityMfaOK { - return &RemoveIdentityMfaOK{} -} - -/* RemoveIdentityMfaOK describes a response with status code 200, with default header values. - -Base empty response -*/ -type RemoveIdentityMfaOK struct { - Payload *rest_model.Empty -} - -func (o *RemoveIdentityMfaOK) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/mfa][%d] removeIdentityMfaOK %+v", 200, o.Payload) -} -func (o *RemoveIdentityMfaOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *RemoveIdentityMfaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRemoveIdentityMfaUnauthorized creates a RemoveIdentityMfaUnauthorized with default headers values -func NewRemoveIdentityMfaUnauthorized() *RemoveIdentityMfaUnauthorized { - return &RemoveIdentityMfaUnauthorized{} -} - -/* RemoveIdentityMfaUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type RemoveIdentityMfaUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *RemoveIdentityMfaUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/mfa][%d] removeIdentityMfaUnauthorized %+v", 401, o.Payload) -} -func (o *RemoveIdentityMfaUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *RemoveIdentityMfaUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRemoveIdentityMfaNotFound creates a RemoveIdentityMfaNotFound with default headers values -func NewRemoveIdentityMfaNotFound() *RemoveIdentityMfaNotFound { - return &RemoveIdentityMfaNotFound{} -} - -/* RemoveIdentityMfaNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type RemoveIdentityMfaNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *RemoveIdentityMfaNotFound) Error() string { - return fmt.Sprintf("[DELETE /identities/{id}/mfa][%d] removeIdentityMfaNotFound %+v", 404, o.Payload) -} -func (o *RemoveIdentityMfaNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *RemoveIdentityMfaNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/update_identity_parameters.go b/rest_management_api_client/identity/update_identity_parameters.go deleted file mode 100644 index de9b7bd8c..000000000 --- a/rest_management_api_client/identity/update_identity_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateIdentityParams creates a new UpdateIdentityParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateIdentityParams() *UpdateIdentityParams { - return &UpdateIdentityParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateIdentityParamsWithTimeout creates a new UpdateIdentityParams object -// with the ability to set a timeout on a request. -func NewUpdateIdentityParamsWithTimeout(timeout time.Duration) *UpdateIdentityParams { - return &UpdateIdentityParams{ - timeout: timeout, - } -} - -// NewUpdateIdentityParamsWithContext creates a new UpdateIdentityParams object -// with the ability to set a context for a request. -func NewUpdateIdentityParamsWithContext(ctx context.Context) *UpdateIdentityParams { - return &UpdateIdentityParams{ - Context: ctx, - } -} - -// NewUpdateIdentityParamsWithHTTPClient creates a new UpdateIdentityParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateIdentityParamsWithHTTPClient(client *http.Client) *UpdateIdentityParams { - return &UpdateIdentityParams{ - HTTPClient: client, - } -} - -/* UpdateIdentityParams contains all the parameters to send to the API endpoint - for the update identity operation. - - Typically these are written to a http.Request. -*/ -type UpdateIdentityParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Identity. - - An identity update object - */ - Identity *rest_model.IdentityUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateIdentityParams) WithDefaults() *UpdateIdentityParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update identity params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateIdentityParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update identity params -func (o *UpdateIdentityParams) WithTimeout(timeout time.Duration) *UpdateIdentityParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update identity params -func (o *UpdateIdentityParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update identity params -func (o *UpdateIdentityParams) WithContext(ctx context.Context) *UpdateIdentityParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update identity params -func (o *UpdateIdentityParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update identity params -func (o *UpdateIdentityParams) WithHTTPClient(client *http.Client) *UpdateIdentityParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update identity params -func (o *UpdateIdentityParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update identity params -func (o *UpdateIdentityParams) WithID(id string) *UpdateIdentityParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update identity params -func (o *UpdateIdentityParams) SetID(id string) { - o.ID = id -} - -// WithIdentity adds the identity to the update identity params -func (o *UpdateIdentityParams) WithIdentity(identity *rest_model.IdentityUpdate) *UpdateIdentityParams { - o.SetIdentity(identity) - return o -} - -// SetIdentity adds the identity to the update identity params -func (o *UpdateIdentityParams) SetIdentity(identity *rest_model.IdentityUpdate) { - o.Identity = identity -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateIdentityParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Identity != nil { - if err := r.SetBodyParam(o.Identity); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/update_identity_responses.go b/rest_management_api_client/identity/update_identity_responses.go deleted file mode 100644 index 90f6b60d3..000000000 --- a/rest_management_api_client/identity/update_identity_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateIdentityReader is a Reader for the UpdateIdentity structure. -type UpdateIdentityReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateIdentityOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateIdentityBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateIdentityUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateIdentityNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateIdentityOK creates a UpdateIdentityOK with default headers values -func NewUpdateIdentityOK() *UpdateIdentityOK { - return &UpdateIdentityOK{} -} - -/* UpdateIdentityOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateIdentityOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateIdentityOK) Error() string { - return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityOK %+v", 200, o.Payload) -} -func (o *UpdateIdentityOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateIdentityBadRequest creates a UpdateIdentityBadRequest with default headers values -func NewUpdateIdentityBadRequest() *UpdateIdentityBadRequest { - return &UpdateIdentityBadRequest{} -} - -/* UpdateIdentityBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateIdentityBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateIdentityBadRequest) Error() string { - return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityBadRequest %+v", 400, o.Payload) -} -func (o *UpdateIdentityBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateIdentityBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateIdentityUnauthorized creates a UpdateIdentityUnauthorized with default headers values -func NewUpdateIdentityUnauthorized() *UpdateIdentityUnauthorized { - return &UpdateIdentityUnauthorized{} -} - -/* UpdateIdentityUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateIdentityUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateIdentityUnauthorized) Error() string { - return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateIdentityUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateIdentityNotFound creates a UpdateIdentityNotFound with default headers values -func NewUpdateIdentityNotFound() *UpdateIdentityNotFound { - return &UpdateIdentityNotFound{} -} - -/* UpdateIdentityNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateIdentityNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateIdentityNotFound) Error() string { - return fmt.Sprintf("[PUT /identities/{id}][%d] updateIdentityNotFound %+v", 404, o.Payload) -} -func (o *UpdateIdentityNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/identity/update_identity_tracing_parameters.go b/rest_management_api_client/identity/update_identity_tracing_parameters.go deleted file mode 100644 index 15cb7ea3a..000000000 --- a/rest_management_api_client/identity/update_identity_tracing_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateIdentityTracingParams creates a new UpdateIdentityTracingParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateIdentityTracingParams() *UpdateIdentityTracingParams { - return &UpdateIdentityTracingParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateIdentityTracingParamsWithTimeout creates a new UpdateIdentityTracingParams object -// with the ability to set a timeout on a request. -func NewUpdateIdentityTracingParamsWithTimeout(timeout time.Duration) *UpdateIdentityTracingParams { - return &UpdateIdentityTracingParams{ - timeout: timeout, - } -} - -// NewUpdateIdentityTracingParamsWithContext creates a new UpdateIdentityTracingParams object -// with the ability to set a context for a request. -func NewUpdateIdentityTracingParamsWithContext(ctx context.Context) *UpdateIdentityTracingParams { - return &UpdateIdentityTracingParams{ - Context: ctx, - } -} - -// NewUpdateIdentityTracingParamsWithHTTPClient creates a new UpdateIdentityTracingParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateIdentityTracingParamsWithHTTPClient(client *http.Client) *UpdateIdentityTracingParams { - return &UpdateIdentityTracingParams{ - HTTPClient: client, - } -} - -/* UpdateIdentityTracingParams contains all the parameters to send to the API endpoint - for the update identity tracing operation. - - Typically these are written to a http.Request. -*/ -type UpdateIdentityTracingParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* TraceSpec. - - A traceSpec object - */ - TraceSpec *rest_model.TraceSpec - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update identity tracing params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateIdentityTracingParams) WithDefaults() *UpdateIdentityTracingParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update identity tracing params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateIdentityTracingParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update identity tracing params -func (o *UpdateIdentityTracingParams) WithTimeout(timeout time.Duration) *UpdateIdentityTracingParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update identity tracing params -func (o *UpdateIdentityTracingParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update identity tracing params -func (o *UpdateIdentityTracingParams) WithContext(ctx context.Context) *UpdateIdentityTracingParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update identity tracing params -func (o *UpdateIdentityTracingParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update identity tracing params -func (o *UpdateIdentityTracingParams) WithHTTPClient(client *http.Client) *UpdateIdentityTracingParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update identity tracing params -func (o *UpdateIdentityTracingParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update identity tracing params -func (o *UpdateIdentityTracingParams) WithID(id string) *UpdateIdentityTracingParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update identity tracing params -func (o *UpdateIdentityTracingParams) SetID(id string) { - o.ID = id -} - -// WithTraceSpec adds the traceSpec to the update identity tracing params -func (o *UpdateIdentityTracingParams) WithTraceSpec(traceSpec *rest_model.TraceSpec) *UpdateIdentityTracingParams { - o.SetTraceSpec(traceSpec) - return o -} - -// SetTraceSpec adds the traceSpec to the update identity tracing params -func (o *UpdateIdentityTracingParams) SetTraceSpec(traceSpec *rest_model.TraceSpec) { - o.TraceSpec = traceSpec -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateIdentityTracingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.TraceSpec != nil { - if err := r.SetBodyParam(o.TraceSpec); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/identity/update_identity_tracing_responses.go b/rest_management_api_client/identity/update_identity_tracing_responses.go deleted file mode 100644 index d194422dd..000000000 --- a/rest_management_api_client/identity/update_identity_tracing_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateIdentityTracingReader is a Reader for the UpdateIdentityTracing structure. -type UpdateIdentityTracingReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateIdentityTracingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateIdentityTracingOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateIdentityTracingBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateIdentityTracingUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateIdentityTracingNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateIdentityTracingOK creates a UpdateIdentityTracingOK with default headers values -func NewUpdateIdentityTracingOK() *UpdateIdentityTracingOK { - return &UpdateIdentityTracingOK{} -} - -/* UpdateIdentityTracingOK describes a response with status code 200, with default header values. - -Returns the document that represents the trace state -*/ -type UpdateIdentityTracingOK struct { - Payload *rest_model.TraceDetailEnvelope -} - -func (o *UpdateIdentityTracingOK) Error() string { - return fmt.Sprintf("[PUT /identities/{id}/trace][%d] updateIdentityTracingOK %+v", 200, o.Payload) -} -func (o *UpdateIdentityTracingOK) GetPayload() *rest_model.TraceDetailEnvelope { - return o.Payload -} - -func (o *UpdateIdentityTracingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.TraceDetailEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateIdentityTracingBadRequest creates a UpdateIdentityTracingBadRequest with default headers values -func NewUpdateIdentityTracingBadRequest() *UpdateIdentityTracingBadRequest { - return &UpdateIdentityTracingBadRequest{} -} - -/* UpdateIdentityTracingBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateIdentityTracingBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateIdentityTracingBadRequest) Error() string { - return fmt.Sprintf("[PUT /identities/{id}/trace][%d] updateIdentityTracingBadRequest %+v", 400, o.Payload) -} -func (o *UpdateIdentityTracingBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateIdentityTracingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateIdentityTracingUnauthorized creates a UpdateIdentityTracingUnauthorized with default headers values -func NewUpdateIdentityTracingUnauthorized() *UpdateIdentityTracingUnauthorized { - return &UpdateIdentityTracingUnauthorized{} -} - -/* UpdateIdentityTracingUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateIdentityTracingUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateIdentityTracingUnauthorized) Error() string { - return fmt.Sprintf("[PUT /identities/{id}/trace][%d] updateIdentityTracingUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateIdentityTracingUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateIdentityTracingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateIdentityTracingNotFound creates a UpdateIdentityTracingNotFound with default headers values -func NewUpdateIdentityTracingNotFound() *UpdateIdentityTracingNotFound { - return &UpdateIdentityTracingNotFound{} -} - -/* UpdateIdentityTracingNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateIdentityTracingNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateIdentityTracingNotFound) Error() string { - return fmt.Sprintf("[PUT /identities/{id}/trace][%d] updateIdentityTracingNotFound %+v", 404, o.Payload) -} -func (o *UpdateIdentityTracingNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateIdentityTracingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/informational/detail_spec_body_parameters.go b/rest_management_api_client/informational/detail_spec_body_parameters.go deleted file mode 100644 index 49fad06ba..000000000 --- a/rest_management_api_client/informational/detail_spec_body_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecBodyParams creates a new DetailSpecBodyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSpecBodyParams() *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSpecBodyParamsWithTimeout creates a new DetailSpecBodyParams object -// with the ability to set a timeout on a request. -func NewDetailSpecBodyParamsWithTimeout(timeout time.Duration) *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - timeout: timeout, - } -} - -// NewDetailSpecBodyParamsWithContext creates a new DetailSpecBodyParams object -// with the ability to set a context for a request. -func NewDetailSpecBodyParamsWithContext(ctx context.Context) *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - Context: ctx, - } -} - -// NewDetailSpecBodyParamsWithHTTPClient creates a new DetailSpecBodyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSpecBodyParamsWithHTTPClient(client *http.Client) *DetailSpecBodyParams { - return &DetailSpecBodyParams{ - HTTPClient: client, - } -} - -/* DetailSpecBodyParams contains all the parameters to send to the API endpoint - for the detail spec body operation. - - Typically these are written to a http.Request. -*/ -type DetailSpecBodyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail spec body params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecBodyParams) WithDefaults() *DetailSpecBodyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail spec body params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecBodyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail spec body params -func (o *DetailSpecBodyParams) WithTimeout(timeout time.Duration) *DetailSpecBodyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail spec body params -func (o *DetailSpecBodyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail spec body params -func (o *DetailSpecBodyParams) WithContext(ctx context.Context) *DetailSpecBodyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail spec body params -func (o *DetailSpecBodyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail spec body params -func (o *DetailSpecBodyParams) WithHTTPClient(client *http.Client) *DetailSpecBodyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail spec body params -func (o *DetailSpecBodyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail spec body params -func (o *DetailSpecBodyParams) WithID(id string) *DetailSpecBodyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail spec body params -func (o *DetailSpecBodyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSpecBodyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/informational/detail_spec_body_responses.go b/rest_management_api_client/informational/detail_spec_body_responses.go deleted file mode 100644 index 795f4b4a3..000000000 --- a/rest_management_api_client/informational/detail_spec_body_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecBodyReader is a Reader for the DetailSpecBody structure. -type DetailSpecBodyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSpecBodyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSpecBodyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSpecBodyOK creates a DetailSpecBodyOK with default headers values -func NewDetailSpecBodyOK() *DetailSpecBodyOK { - return &DetailSpecBodyOK{} -} - -/* DetailSpecBodyOK describes a response with status code 200, with default header values. - -Returns the document that represents the specification -*/ -type DetailSpecBodyOK struct { - Payload *rest_model.DetailSpecBodyEnvelope -} - -func (o *DetailSpecBodyOK) Error() string { - return fmt.Sprintf("[GET /specs/{id}/spec][%d] detailSpecBodyOK %+v", 200, o.Payload) -} -func (o *DetailSpecBodyOK) GetPayload() *rest_model.DetailSpecBodyEnvelope { - return o.Payload -} - -func (o *DetailSpecBodyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSpecBodyEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/informational/detail_spec_parameters.go b/rest_management_api_client/informational/detail_spec_parameters.go deleted file mode 100644 index fdf79c350..000000000 --- a/rest_management_api_client/informational/detail_spec_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecParams creates a new DetailSpecParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSpecParams() *DetailSpecParams { - return &DetailSpecParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSpecParamsWithTimeout creates a new DetailSpecParams object -// with the ability to set a timeout on a request. -func NewDetailSpecParamsWithTimeout(timeout time.Duration) *DetailSpecParams { - return &DetailSpecParams{ - timeout: timeout, - } -} - -// NewDetailSpecParamsWithContext creates a new DetailSpecParams object -// with the ability to set a context for a request. -func NewDetailSpecParamsWithContext(ctx context.Context) *DetailSpecParams { - return &DetailSpecParams{ - Context: ctx, - } -} - -// NewDetailSpecParamsWithHTTPClient creates a new DetailSpecParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSpecParamsWithHTTPClient(client *http.Client) *DetailSpecParams { - return &DetailSpecParams{ - HTTPClient: client, - } -} - -/* DetailSpecParams contains all the parameters to send to the API endpoint - for the detail spec operation. - - Typically these are written to a http.Request. -*/ -type DetailSpecParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail spec params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecParams) WithDefaults() *DetailSpecParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail spec params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSpecParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail spec params -func (o *DetailSpecParams) WithTimeout(timeout time.Duration) *DetailSpecParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail spec params -func (o *DetailSpecParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail spec params -func (o *DetailSpecParams) WithContext(ctx context.Context) *DetailSpecParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail spec params -func (o *DetailSpecParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail spec params -func (o *DetailSpecParams) WithHTTPClient(client *http.Client) *DetailSpecParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail spec params -func (o *DetailSpecParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail spec params -func (o *DetailSpecParams) WithID(id string) *DetailSpecParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail spec params -func (o *DetailSpecParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSpecParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/informational/detail_spec_responses.go b/rest_management_api_client/informational/detail_spec_responses.go deleted file mode 100644 index 34c30fcd6..000000000 --- a/rest_management_api_client/informational/detail_spec_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecReader is a Reader for the DetailSpec structure. -type DetailSpecReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSpecReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSpecOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSpecOK creates a DetailSpecOK with default headers values -func NewDetailSpecOK() *DetailSpecOK { - return &DetailSpecOK{} -} - -/* DetailSpecOK describes a response with status code 200, with default header values. - -A single specification -*/ -type DetailSpecOK struct { - Payload *rest_model.DetailSpecEnvelope -} - -func (o *DetailSpecOK) Error() string { - return fmt.Sprintf("[GET /specs/{id}][%d] detailSpecOK %+v", 200, o.Payload) -} -func (o *DetailSpecOK) GetPayload() *rest_model.DetailSpecEnvelope { - return o.Payload -} - -func (o *DetailSpecOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSpecEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/informational/informational_client.go b/rest_management_api_client/informational/informational_client.go deleted file mode 100644 index f97475644..000000000 --- a/rest_management_api_client/informational/informational_client.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new informational API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for informational API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DetailSpec(params *DetailSpecParams, opts ...ClientOption) (*DetailSpecOK, error) - - DetailSpecBody(params *DetailSpecBodyParams, opts ...ClientOption) (*DetailSpecBodyOK, error) - - ListRoot(params *ListRootParams, opts ...ClientOption) (*ListRootOK, error) - - ListSpecs(params *ListSpecsParams, opts ...ClientOption) (*ListSpecsOK, error) - - ListSummary(params *ListSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSummaryOK, error) - - ListVersion(params *ListVersionParams, opts ...ClientOption) (*ListVersionOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DetailSpec returns a single spec resource - - Returns single spec resource embedded within the controller for consumption/documentation/code geneartion -*/ -func (a *Client) DetailSpec(params *DetailSpecParams, opts ...ClientOption) (*DetailSpecOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSpecParams() - } - op := &runtime.ClientOperation{ - ID: "detailSpec", - Method: "GET", - PathPattern: "/specs/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSpecReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSpecOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSpec: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailSpecBody returns the spec s file - - Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). -*/ -func (a *Client) DetailSpecBody(params *DetailSpecBodyParams, opts ...ClientOption) (*DetailSpecBodyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSpecBodyParams() - } - op := &runtime.ClientOperation{ - ID: "detailSpecBody", - Method: "GET", - PathPattern: "/specs/{id}/spec", - ProducesMediaTypes: []string{"application/json", "text/yaml"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSpecBodyReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSpecBodyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSpecBody: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListRoot returns version information -*/ -func (a *Client) ListRoot(params *ListRootParams, opts ...ClientOption) (*ListRootOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListRootParams() - } - op := &runtime.ClientOperation{ - ID: "listRoot", - Method: "GET", - PathPattern: "/", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListRootReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListRootOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listRoot: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListSpecs returns a list of API specs - - Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion -*/ -func (a *Client) ListSpecs(params *ListSpecsParams, opts ...ClientOption) (*ListSpecsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListSpecsParams() - } - op := &runtime.ClientOperation{ - ID: "listSpecs", - Method: "GET", - PathPattern: "/specs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListSpecsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListSpecsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listSpecs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListSummary returns a list of accessible resource counts - - This endpoint is usefull for UIs that wish to display UI elements with counts. -*/ -func (a *Client) ListSummary(params *ListSummaryParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSummaryOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListSummaryParams() - } - op := &runtime.ClientOperation{ - ID: "listSummary", - Method: "GET", - PathPattern: "/summary", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListSummaryReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListSummaryOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listSummary: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListVersion returns version information -*/ -func (a *Client) ListVersion(params *ListVersionParams, opts ...ClientOption) (*ListVersionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListVersionParams() - } - op := &runtime.ClientOperation{ - ID: "listVersion", - Method: "GET", - PathPattern: "/version", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListVersionReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListVersionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listVersion: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/informational/list_root_parameters.go b/rest_management_api_client/informational/list_root_parameters.go deleted file mode 100644 index 17d320ebf..000000000 --- a/rest_management_api_client/informational/list_root_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListRootParams creates a new ListRootParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListRootParams() *ListRootParams { - return &ListRootParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListRootParamsWithTimeout creates a new ListRootParams object -// with the ability to set a timeout on a request. -func NewListRootParamsWithTimeout(timeout time.Duration) *ListRootParams { - return &ListRootParams{ - timeout: timeout, - } -} - -// NewListRootParamsWithContext creates a new ListRootParams object -// with the ability to set a context for a request. -func NewListRootParamsWithContext(ctx context.Context) *ListRootParams { - return &ListRootParams{ - Context: ctx, - } -} - -// NewListRootParamsWithHTTPClient creates a new ListRootParams object -// with the ability to set a custom HTTPClient for a request. -func NewListRootParamsWithHTTPClient(client *http.Client) *ListRootParams { - return &ListRootParams{ - HTTPClient: client, - } -} - -/* ListRootParams contains all the parameters to send to the API endpoint - for the list root operation. - - Typically these are written to a http.Request. -*/ -type ListRootParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list root params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRootParams) WithDefaults() *ListRootParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list root params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRootParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list root params -func (o *ListRootParams) WithTimeout(timeout time.Duration) *ListRootParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list root params -func (o *ListRootParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list root params -func (o *ListRootParams) WithContext(ctx context.Context) *ListRootParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list root params -func (o *ListRootParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list root params -func (o *ListRootParams) WithHTTPClient(client *http.Client) *ListRootParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list root params -func (o *ListRootParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListRootParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/informational/list_root_responses.go b/rest_management_api_client/informational/list_root_responses.go deleted file mode 100644 index 599813352..000000000 --- a/rest_management_api_client/informational/list_root_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListRootReader is a Reader for the ListRoot structure. -type ListRootReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListRootReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListRootOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListRootOK creates a ListRootOK with default headers values -func NewListRootOK() *ListRootOK { - return &ListRootOK{} -} - -/* ListRootOK describes a response with status code 200, with default header values. - -Version information for the controller -*/ -type ListRootOK struct { - Payload *rest_model.ListVersionEnvelope -} - -func (o *ListRootOK) Error() string { - return fmt.Sprintf("[GET /][%d] listRootOK %+v", 200, o.Payload) -} -func (o *ListRootOK) GetPayload() *rest_model.ListVersionEnvelope { - return o.Payload -} - -func (o *ListRootOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListVersionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/informational/list_specs_parameters.go b/rest_management_api_client/informational/list_specs_parameters.go deleted file mode 100644 index 9ad83c9e4..000000000 --- a/rest_management_api_client/informational/list_specs_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListSpecsParams creates a new ListSpecsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListSpecsParams() *ListSpecsParams { - return &ListSpecsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListSpecsParamsWithTimeout creates a new ListSpecsParams object -// with the ability to set a timeout on a request. -func NewListSpecsParamsWithTimeout(timeout time.Duration) *ListSpecsParams { - return &ListSpecsParams{ - timeout: timeout, - } -} - -// NewListSpecsParamsWithContext creates a new ListSpecsParams object -// with the ability to set a context for a request. -func NewListSpecsParamsWithContext(ctx context.Context) *ListSpecsParams { - return &ListSpecsParams{ - Context: ctx, - } -} - -// NewListSpecsParamsWithHTTPClient creates a new ListSpecsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListSpecsParamsWithHTTPClient(client *http.Client) *ListSpecsParams { - return &ListSpecsParams{ - HTTPClient: client, - } -} - -/* ListSpecsParams contains all the parameters to send to the API endpoint - for the list specs operation. - - Typically these are written to a http.Request. -*/ -type ListSpecsParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list specs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSpecsParams) WithDefaults() *ListSpecsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list specs params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSpecsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list specs params -func (o *ListSpecsParams) WithTimeout(timeout time.Duration) *ListSpecsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list specs params -func (o *ListSpecsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list specs params -func (o *ListSpecsParams) WithContext(ctx context.Context) *ListSpecsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list specs params -func (o *ListSpecsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list specs params -func (o *ListSpecsParams) WithHTTPClient(client *http.Client) *ListSpecsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list specs params -func (o *ListSpecsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListSpecsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/informational/list_specs_responses.go b/rest_management_api_client/informational/list_specs_responses.go deleted file mode 100644 index ad2e8f189..000000000 --- a/rest_management_api_client/informational/list_specs_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListSpecsReader is a Reader for the ListSpecs structure. -type ListSpecsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListSpecsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListSpecsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListSpecsOK creates a ListSpecsOK with default headers values -func NewListSpecsOK() *ListSpecsOK { - return &ListSpecsOK{} -} - -/* ListSpecsOK describes a response with status code 200, with default header values. - -A list of specifications -*/ -type ListSpecsOK struct { - Payload *rest_model.ListSpecsEnvelope -} - -func (o *ListSpecsOK) Error() string { - return fmt.Sprintf("[GET /specs][%d] listSpecsOK %+v", 200, o.Payload) -} -func (o *ListSpecsOK) GetPayload() *rest_model.ListSpecsEnvelope { - return o.Payload -} - -func (o *ListSpecsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListSpecsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/informational/list_summary_parameters.go b/rest_management_api_client/informational/list_summary_parameters.go deleted file mode 100644 index 3a79299be..000000000 --- a/rest_management_api_client/informational/list_summary_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListSummaryParams creates a new ListSummaryParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListSummaryParams() *ListSummaryParams { - return &ListSummaryParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListSummaryParamsWithTimeout creates a new ListSummaryParams object -// with the ability to set a timeout on a request. -func NewListSummaryParamsWithTimeout(timeout time.Duration) *ListSummaryParams { - return &ListSummaryParams{ - timeout: timeout, - } -} - -// NewListSummaryParamsWithContext creates a new ListSummaryParams object -// with the ability to set a context for a request. -func NewListSummaryParamsWithContext(ctx context.Context) *ListSummaryParams { - return &ListSummaryParams{ - Context: ctx, - } -} - -// NewListSummaryParamsWithHTTPClient creates a new ListSummaryParams object -// with the ability to set a custom HTTPClient for a request. -func NewListSummaryParamsWithHTTPClient(client *http.Client) *ListSummaryParams { - return &ListSummaryParams{ - HTTPClient: client, - } -} - -/* ListSummaryParams contains all the parameters to send to the API endpoint - for the list summary operation. - - Typically these are written to a http.Request. -*/ -type ListSummaryParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list summary params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSummaryParams) WithDefaults() *ListSummaryParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list summary params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSummaryParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list summary params -func (o *ListSummaryParams) WithTimeout(timeout time.Duration) *ListSummaryParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list summary params -func (o *ListSummaryParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list summary params -func (o *ListSummaryParams) WithContext(ctx context.Context) *ListSummaryParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list summary params -func (o *ListSummaryParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list summary params -func (o *ListSummaryParams) WithHTTPClient(client *http.Client) *ListSummaryParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list summary params -func (o *ListSummaryParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListSummaryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/informational/list_summary_responses.go b/rest_management_api_client/informational/list_summary_responses.go deleted file mode 100644 index cba6b92d7..000000000 --- a/rest_management_api_client/informational/list_summary_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListSummaryReader is a Reader for the ListSummary structure. -type ListSummaryReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListSummaryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListSummaryOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListSummaryUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListSummaryOK creates a ListSummaryOK with default headers values -func NewListSummaryOK() *ListSummaryOK { - return &ListSummaryOK{} -} - -/* ListSummaryOK describes a response with status code 200, with default header values. - -Entity counts scopped to the current identitie's access -*/ -type ListSummaryOK struct { - Payload *rest_model.ListSummaryCountsEnvelope -} - -func (o *ListSummaryOK) Error() string { - return fmt.Sprintf("[GET /summary][%d] listSummaryOK %+v", 200, o.Payload) -} -func (o *ListSummaryOK) GetPayload() *rest_model.ListSummaryCountsEnvelope { - return o.Payload -} - -func (o *ListSummaryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListSummaryCountsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListSummaryUnauthorized creates a ListSummaryUnauthorized with default headers values -func NewListSummaryUnauthorized() *ListSummaryUnauthorized { - return &ListSummaryUnauthorized{} -} - -/* ListSummaryUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListSummaryUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListSummaryUnauthorized) Error() string { - return fmt.Sprintf("[GET /summary][%d] listSummaryUnauthorized %+v", 401, o.Payload) -} -func (o *ListSummaryUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListSummaryUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/informational/list_version_parameters.go b/rest_management_api_client/informational/list_version_parameters.go deleted file mode 100644 index 23d7c2688..000000000 --- a/rest_management_api_client/informational/list_version_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListVersionParams creates a new ListVersionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListVersionParams() *ListVersionParams { - return &ListVersionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListVersionParamsWithTimeout creates a new ListVersionParams object -// with the ability to set a timeout on a request. -func NewListVersionParamsWithTimeout(timeout time.Duration) *ListVersionParams { - return &ListVersionParams{ - timeout: timeout, - } -} - -// NewListVersionParamsWithContext creates a new ListVersionParams object -// with the ability to set a context for a request. -func NewListVersionParamsWithContext(ctx context.Context) *ListVersionParams { - return &ListVersionParams{ - Context: ctx, - } -} - -// NewListVersionParamsWithHTTPClient creates a new ListVersionParams object -// with the ability to set a custom HTTPClient for a request. -func NewListVersionParamsWithHTTPClient(client *http.Client) *ListVersionParams { - return &ListVersionParams{ - HTTPClient: client, - } -} - -/* ListVersionParams contains all the parameters to send to the API endpoint - for the list version operation. - - Typically these are written to a http.Request. -*/ -type ListVersionParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListVersionParams) WithDefaults() *ListVersionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list version params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListVersionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list version params -func (o *ListVersionParams) WithTimeout(timeout time.Duration) *ListVersionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list version params -func (o *ListVersionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list version params -func (o *ListVersionParams) WithContext(ctx context.Context) *ListVersionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list version params -func (o *ListVersionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list version params -func (o *ListVersionParams) WithHTTPClient(client *http.Client) *ListVersionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list version params -func (o *ListVersionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *ListVersionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/informational/list_version_responses.go b/rest_management_api_client/informational/list_version_responses.go deleted file mode 100644 index 9e9b0b4a2..000000000 --- a/rest_management_api_client/informational/list_version_responses.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListVersionReader is a Reader for the ListVersion structure. -type ListVersionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListVersionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListVersionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListVersionOK creates a ListVersionOK with default headers values -func NewListVersionOK() *ListVersionOK { - return &ListVersionOK{} -} - -/* ListVersionOK describes a response with status code 200, with default header values. - -Version information for the controller -*/ -type ListVersionOK struct { - Payload *rest_model.ListVersionEnvelope -} - -func (o *ListVersionOK) Error() string { - return fmt.Sprintf("[GET /version][%d] listVersionOK %+v", 200, o.Payload) -} -func (o *ListVersionOK) GetPayload() *rest_model.ListVersionEnvelope { - return o.Payload -} - -func (o *ListVersionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListVersionEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/create_posture_check_parameters.go b/rest_management_api_client/posture_checks/create_posture_check_parameters.go deleted file mode 100644 index 84fee170c..000000000 --- a/rest_management_api_client/posture_checks/create_posture_check_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreatePostureCheckParams creates a new CreatePostureCheckParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreatePostureCheckParams() *CreatePostureCheckParams { - return &CreatePostureCheckParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreatePostureCheckParamsWithTimeout creates a new CreatePostureCheckParams object -// with the ability to set a timeout on a request. -func NewCreatePostureCheckParamsWithTimeout(timeout time.Duration) *CreatePostureCheckParams { - return &CreatePostureCheckParams{ - timeout: timeout, - } -} - -// NewCreatePostureCheckParamsWithContext creates a new CreatePostureCheckParams object -// with the ability to set a context for a request. -func NewCreatePostureCheckParamsWithContext(ctx context.Context) *CreatePostureCheckParams { - return &CreatePostureCheckParams{ - Context: ctx, - } -} - -// NewCreatePostureCheckParamsWithHTTPClient creates a new CreatePostureCheckParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreatePostureCheckParamsWithHTTPClient(client *http.Client) *CreatePostureCheckParams { - return &CreatePostureCheckParams{ - HTTPClient: client, - } -} - -/* CreatePostureCheckParams contains all the parameters to send to the API endpoint - for the create posture check operation. - - Typically these are written to a http.Request. -*/ -type CreatePostureCheckParams struct { - - /* PostureCheck. - - A Posture Check to create - */ - PostureCheck rest_model.PostureCheckCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePostureCheckParams) WithDefaults() *CreatePostureCheckParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePostureCheckParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create posture check params -func (o *CreatePostureCheckParams) WithTimeout(timeout time.Duration) *CreatePostureCheckParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create posture check params -func (o *CreatePostureCheckParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create posture check params -func (o *CreatePostureCheckParams) WithContext(ctx context.Context) *CreatePostureCheckParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create posture check params -func (o *CreatePostureCheckParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create posture check params -func (o *CreatePostureCheckParams) WithHTTPClient(client *http.Client) *CreatePostureCheckParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create posture check params -func (o *CreatePostureCheckParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPostureCheck adds the postureCheck to the create posture check params -func (o *CreatePostureCheckParams) WithPostureCheck(postureCheck rest_model.PostureCheckCreate) *CreatePostureCheckParams { - o.SetPostureCheck(postureCheck) - return o -} - -// SetPostureCheck adds the postureCheck to the create posture check params -func (o *CreatePostureCheckParams) SetPostureCheck(postureCheck rest_model.PostureCheckCreate) { - o.PostureCheck = postureCheck -} - -// WriteToRequest writes these params to a swagger request -func (o *CreatePostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.PostureCheck); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/create_posture_check_responses.go b/rest_management_api_client/posture_checks/create_posture_check_responses.go deleted file mode 100644 index ff3b48af1..000000000 --- a/rest_management_api_client/posture_checks/create_posture_check_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreatePostureCheckReader is a Reader for the CreatePostureCheck structure. -type CreatePostureCheckReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreatePostureCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreatePostureCheckCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreatePostureCheckBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreatePostureCheckUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreatePostureCheckCreated creates a CreatePostureCheckCreated with default headers values -func NewCreatePostureCheckCreated() *CreatePostureCheckCreated { - return &CreatePostureCheckCreated{} -} - -/* CreatePostureCheckCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreatePostureCheckCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreatePostureCheckCreated) Error() string { - return fmt.Sprintf("[POST /posture-checks][%d] createPostureCheckCreated %+v", 201, o.Payload) -} -func (o *CreatePostureCheckCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreatePostureCheckCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePostureCheckBadRequest creates a CreatePostureCheckBadRequest with default headers values -func NewCreatePostureCheckBadRequest() *CreatePostureCheckBadRequest { - return &CreatePostureCheckBadRequest{} -} - -/* CreatePostureCheckBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreatePostureCheckBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreatePostureCheckBadRequest) Error() string { - return fmt.Sprintf("[POST /posture-checks][%d] createPostureCheckBadRequest %+v", 400, o.Payload) -} -func (o *CreatePostureCheckBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreatePostureCheckBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePostureCheckUnauthorized creates a CreatePostureCheckUnauthorized with default headers values -func NewCreatePostureCheckUnauthorized() *CreatePostureCheckUnauthorized { - return &CreatePostureCheckUnauthorized{} -} - -/* CreatePostureCheckUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreatePostureCheckUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreatePostureCheckUnauthorized) Error() string { - return fmt.Sprintf("[POST /posture-checks][%d] createPostureCheckUnauthorized %+v", 401, o.Payload) -} -func (o *CreatePostureCheckUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreatePostureCheckUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/delete_posture_check_parameters.go b/rest_management_api_client/posture_checks/delete_posture_check_parameters.go deleted file mode 100644 index beb5c166f..000000000 --- a/rest_management_api_client/posture_checks/delete_posture_check_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeletePostureCheckParams creates a new DeletePostureCheckParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeletePostureCheckParams() *DeletePostureCheckParams { - return &DeletePostureCheckParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeletePostureCheckParamsWithTimeout creates a new DeletePostureCheckParams object -// with the ability to set a timeout on a request. -func NewDeletePostureCheckParamsWithTimeout(timeout time.Duration) *DeletePostureCheckParams { - return &DeletePostureCheckParams{ - timeout: timeout, - } -} - -// NewDeletePostureCheckParamsWithContext creates a new DeletePostureCheckParams object -// with the ability to set a context for a request. -func NewDeletePostureCheckParamsWithContext(ctx context.Context) *DeletePostureCheckParams { - return &DeletePostureCheckParams{ - Context: ctx, - } -} - -// NewDeletePostureCheckParamsWithHTTPClient creates a new DeletePostureCheckParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeletePostureCheckParamsWithHTTPClient(client *http.Client) *DeletePostureCheckParams { - return &DeletePostureCheckParams{ - HTTPClient: client, - } -} - -/* DeletePostureCheckParams contains all the parameters to send to the API endpoint - for the delete posture check operation. - - Typically these are written to a http.Request. -*/ -type DeletePostureCheckParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeletePostureCheckParams) WithDefaults() *DeletePostureCheckParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeletePostureCheckParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete posture check params -func (o *DeletePostureCheckParams) WithTimeout(timeout time.Duration) *DeletePostureCheckParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete posture check params -func (o *DeletePostureCheckParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete posture check params -func (o *DeletePostureCheckParams) WithContext(ctx context.Context) *DeletePostureCheckParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete posture check params -func (o *DeletePostureCheckParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete posture check params -func (o *DeletePostureCheckParams) WithHTTPClient(client *http.Client) *DeletePostureCheckParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete posture check params -func (o *DeletePostureCheckParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete posture check params -func (o *DeletePostureCheckParams) WithID(id string) *DeletePostureCheckParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete posture check params -func (o *DeletePostureCheckParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeletePostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/delete_posture_check_responses.go b/rest_management_api_client/posture_checks/delete_posture_check_responses.go deleted file mode 100644 index 1b9d17957..000000000 --- a/rest_management_api_client/posture_checks/delete_posture_check_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeletePostureCheckReader is a Reader for the DeletePostureCheck structure. -type DeletePostureCheckReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeletePostureCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeletePostureCheckOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 403: - result := NewDeletePostureCheckForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeletePostureCheckNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeletePostureCheckOK creates a DeletePostureCheckOK with default headers values -func NewDeletePostureCheckOK() *DeletePostureCheckOK { - return &DeletePostureCheckOK{} -} - -/* DeletePostureCheckOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeletePostureCheckOK struct { - Payload *rest_model.Empty -} - -func (o *DeletePostureCheckOK) Error() string { - return fmt.Sprintf("[DELETE /posture-checks/{id}][%d] deletePostureCheckOK %+v", 200, o.Payload) -} -func (o *DeletePostureCheckOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeletePostureCheckOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeletePostureCheckForbidden creates a DeletePostureCheckForbidden with default headers values -func NewDeletePostureCheckForbidden() *DeletePostureCheckForbidden { - return &DeletePostureCheckForbidden{} -} - -/* DeletePostureCheckForbidden describes a response with status code 403, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeletePostureCheckForbidden struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeletePostureCheckForbidden) Error() string { - return fmt.Sprintf("[DELETE /posture-checks/{id}][%d] deletePostureCheckForbidden %+v", 403, o.Payload) -} -func (o *DeletePostureCheckForbidden) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeletePostureCheckForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeletePostureCheckNotFound creates a DeletePostureCheckNotFound with default headers values -func NewDeletePostureCheckNotFound() *DeletePostureCheckNotFound { - return &DeletePostureCheckNotFound{} -} - -/* DeletePostureCheckNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DeletePostureCheckNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeletePostureCheckNotFound) Error() string { - return fmt.Sprintf("[DELETE /posture-checks/{id}][%d] deletePostureCheckNotFound %+v", 404, o.Payload) -} -func (o *DeletePostureCheckNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeletePostureCheckNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/detail_posture_check_parameters.go b/rest_management_api_client/posture_checks/detail_posture_check_parameters.go deleted file mode 100644 index 19093cad5..000000000 --- a/rest_management_api_client/posture_checks/detail_posture_check_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailPostureCheckParams creates a new DetailPostureCheckParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailPostureCheckParams() *DetailPostureCheckParams { - return &DetailPostureCheckParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailPostureCheckParamsWithTimeout creates a new DetailPostureCheckParams object -// with the ability to set a timeout on a request. -func NewDetailPostureCheckParamsWithTimeout(timeout time.Duration) *DetailPostureCheckParams { - return &DetailPostureCheckParams{ - timeout: timeout, - } -} - -// NewDetailPostureCheckParamsWithContext creates a new DetailPostureCheckParams object -// with the ability to set a context for a request. -func NewDetailPostureCheckParamsWithContext(ctx context.Context) *DetailPostureCheckParams { - return &DetailPostureCheckParams{ - Context: ctx, - } -} - -// NewDetailPostureCheckParamsWithHTTPClient creates a new DetailPostureCheckParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailPostureCheckParamsWithHTTPClient(client *http.Client) *DetailPostureCheckParams { - return &DetailPostureCheckParams{ - HTTPClient: client, - } -} - -/* DetailPostureCheckParams contains all the parameters to send to the API endpoint - for the detail posture check operation. - - Typically these are written to a http.Request. -*/ -type DetailPostureCheckParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailPostureCheckParams) WithDefaults() *DetailPostureCheckParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailPostureCheckParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail posture check params -func (o *DetailPostureCheckParams) WithTimeout(timeout time.Duration) *DetailPostureCheckParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail posture check params -func (o *DetailPostureCheckParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail posture check params -func (o *DetailPostureCheckParams) WithContext(ctx context.Context) *DetailPostureCheckParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail posture check params -func (o *DetailPostureCheckParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail posture check params -func (o *DetailPostureCheckParams) WithHTTPClient(client *http.Client) *DetailPostureCheckParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail posture check params -func (o *DetailPostureCheckParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail posture check params -func (o *DetailPostureCheckParams) WithID(id string) *DetailPostureCheckParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail posture check params -func (o *DetailPostureCheckParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailPostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/detail_posture_check_responses.go b/rest_management_api_client/posture_checks/detail_posture_check_responses.go deleted file mode 100644 index e901b5253..000000000 --- a/rest_management_api_client/posture_checks/detail_posture_check_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailPostureCheckReader is a Reader for the DetailPostureCheck structure. -type DetailPostureCheckReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailPostureCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailPostureCheckOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailPostureCheckUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailPostureCheckNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailPostureCheckOK creates a DetailPostureCheckOK with default headers values -func NewDetailPostureCheckOK() *DetailPostureCheckOK { - return &DetailPostureCheckOK{} -} - -/* DetailPostureCheckOK describes a response with status code 200, with default header values. - -Retrieves a singular posture check by id -*/ -type DetailPostureCheckOK struct { - Payload *rest_model.DetailPostureCheckEnvelope -} - -func (o *DetailPostureCheckOK) Error() string { - return fmt.Sprintf("[GET /posture-checks/{id}][%d] detailPostureCheckOK %+v", 200, o.Payload) -} -func (o *DetailPostureCheckOK) GetPayload() *rest_model.DetailPostureCheckEnvelope { - return o.Payload -} - -func (o *DetailPostureCheckOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailPostureCheckEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailPostureCheckUnauthorized creates a DetailPostureCheckUnauthorized with default headers values -func NewDetailPostureCheckUnauthorized() *DetailPostureCheckUnauthorized { - return &DetailPostureCheckUnauthorized{} -} - -/* DetailPostureCheckUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailPostureCheckUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailPostureCheckUnauthorized) Error() string { - return fmt.Sprintf("[GET /posture-checks/{id}][%d] detailPostureCheckUnauthorized %+v", 401, o.Payload) -} -func (o *DetailPostureCheckUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailPostureCheckUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailPostureCheckNotFound creates a DetailPostureCheckNotFound with default headers values -func NewDetailPostureCheckNotFound() *DetailPostureCheckNotFound { - return &DetailPostureCheckNotFound{} -} - -/* DetailPostureCheckNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailPostureCheckNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailPostureCheckNotFound) Error() string { - return fmt.Sprintf("[GET /posture-checks/{id}][%d] detailPostureCheckNotFound %+v", 404, o.Payload) -} -func (o *DetailPostureCheckNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailPostureCheckNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/detail_posture_check_type_parameters.go b/rest_management_api_client/posture_checks/detail_posture_check_type_parameters.go deleted file mode 100644 index 9f32d50be..000000000 --- a/rest_management_api_client/posture_checks/detail_posture_check_type_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailPostureCheckTypeParams creates a new DetailPostureCheckTypeParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailPostureCheckTypeParams() *DetailPostureCheckTypeParams { - return &DetailPostureCheckTypeParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailPostureCheckTypeParamsWithTimeout creates a new DetailPostureCheckTypeParams object -// with the ability to set a timeout on a request. -func NewDetailPostureCheckTypeParamsWithTimeout(timeout time.Duration) *DetailPostureCheckTypeParams { - return &DetailPostureCheckTypeParams{ - timeout: timeout, - } -} - -// NewDetailPostureCheckTypeParamsWithContext creates a new DetailPostureCheckTypeParams object -// with the ability to set a context for a request. -func NewDetailPostureCheckTypeParamsWithContext(ctx context.Context) *DetailPostureCheckTypeParams { - return &DetailPostureCheckTypeParams{ - Context: ctx, - } -} - -// NewDetailPostureCheckTypeParamsWithHTTPClient creates a new DetailPostureCheckTypeParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailPostureCheckTypeParamsWithHTTPClient(client *http.Client) *DetailPostureCheckTypeParams { - return &DetailPostureCheckTypeParams{ - HTTPClient: client, - } -} - -/* DetailPostureCheckTypeParams contains all the parameters to send to the API endpoint - for the detail posture check type operation. - - Typically these are written to a http.Request. -*/ -type DetailPostureCheckTypeParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail posture check type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailPostureCheckTypeParams) WithDefaults() *DetailPostureCheckTypeParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail posture check type params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailPostureCheckTypeParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail posture check type params -func (o *DetailPostureCheckTypeParams) WithTimeout(timeout time.Duration) *DetailPostureCheckTypeParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail posture check type params -func (o *DetailPostureCheckTypeParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail posture check type params -func (o *DetailPostureCheckTypeParams) WithContext(ctx context.Context) *DetailPostureCheckTypeParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail posture check type params -func (o *DetailPostureCheckTypeParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail posture check type params -func (o *DetailPostureCheckTypeParams) WithHTTPClient(client *http.Client) *DetailPostureCheckTypeParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail posture check type params -func (o *DetailPostureCheckTypeParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail posture check type params -func (o *DetailPostureCheckTypeParams) WithID(id string) *DetailPostureCheckTypeParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail posture check type params -func (o *DetailPostureCheckTypeParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailPostureCheckTypeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/detail_posture_check_type_responses.go b/rest_management_api_client/posture_checks/detail_posture_check_type_responses.go deleted file mode 100644 index 2caee167a..000000000 --- a/rest_management_api_client/posture_checks/detail_posture_check_type_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailPostureCheckTypeReader is a Reader for the DetailPostureCheckType structure. -type DetailPostureCheckTypeReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailPostureCheckTypeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailPostureCheckTypeOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailPostureCheckTypeUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailPostureCheckTypeNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailPostureCheckTypeOK creates a DetailPostureCheckTypeOK with default headers values -func NewDetailPostureCheckTypeOK() *DetailPostureCheckTypeOK { - return &DetailPostureCheckTypeOK{} -} - -/* DetailPostureCheckTypeOK describes a response with status code 200, with default header values. - -Retrieves a singular posture check type by id -*/ -type DetailPostureCheckTypeOK struct { - Payload *rest_model.DetailPostureCheckTypeEnvelope -} - -func (o *DetailPostureCheckTypeOK) Error() string { - return fmt.Sprintf("[GET /posture-check-types/{id}][%d] detailPostureCheckTypeOK %+v", 200, o.Payload) -} -func (o *DetailPostureCheckTypeOK) GetPayload() *rest_model.DetailPostureCheckTypeEnvelope { - return o.Payload -} - -func (o *DetailPostureCheckTypeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailPostureCheckTypeEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailPostureCheckTypeUnauthorized creates a DetailPostureCheckTypeUnauthorized with default headers values -func NewDetailPostureCheckTypeUnauthorized() *DetailPostureCheckTypeUnauthorized { - return &DetailPostureCheckTypeUnauthorized{} -} - -/* DetailPostureCheckTypeUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailPostureCheckTypeUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailPostureCheckTypeUnauthorized) Error() string { - return fmt.Sprintf("[GET /posture-check-types/{id}][%d] detailPostureCheckTypeUnauthorized %+v", 401, o.Payload) -} -func (o *DetailPostureCheckTypeUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailPostureCheckTypeUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailPostureCheckTypeNotFound creates a DetailPostureCheckTypeNotFound with default headers values -func NewDetailPostureCheckTypeNotFound() *DetailPostureCheckTypeNotFound { - return &DetailPostureCheckTypeNotFound{} -} - -/* DetailPostureCheckTypeNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailPostureCheckTypeNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailPostureCheckTypeNotFound) Error() string { - return fmt.Sprintf("[GET /posture-check-types/{id}][%d] detailPostureCheckTypeNotFound %+v", 404, o.Payload) -} -func (o *DetailPostureCheckTypeNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailPostureCheckTypeNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/list_posture_check_types_parameters.go b/rest_management_api_client/posture_checks/list_posture_check_types_parameters.go deleted file mode 100644 index 708701cd9..000000000 --- a/rest_management_api_client/posture_checks/list_posture_check_types_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListPostureCheckTypesParams creates a new ListPostureCheckTypesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListPostureCheckTypesParams() *ListPostureCheckTypesParams { - return &ListPostureCheckTypesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListPostureCheckTypesParamsWithTimeout creates a new ListPostureCheckTypesParams object -// with the ability to set a timeout on a request. -func NewListPostureCheckTypesParamsWithTimeout(timeout time.Duration) *ListPostureCheckTypesParams { - return &ListPostureCheckTypesParams{ - timeout: timeout, - } -} - -// NewListPostureCheckTypesParamsWithContext creates a new ListPostureCheckTypesParams object -// with the ability to set a context for a request. -func NewListPostureCheckTypesParamsWithContext(ctx context.Context) *ListPostureCheckTypesParams { - return &ListPostureCheckTypesParams{ - Context: ctx, - } -} - -// NewListPostureCheckTypesParamsWithHTTPClient creates a new ListPostureCheckTypesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListPostureCheckTypesParamsWithHTTPClient(client *http.Client) *ListPostureCheckTypesParams { - return &ListPostureCheckTypesParams{ - HTTPClient: client, - } -} - -/* ListPostureCheckTypesParams contains all the parameters to send to the API endpoint - for the list posture check types operation. - - Typically these are written to a http.Request. -*/ -type ListPostureCheckTypesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list posture check types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListPostureCheckTypesParams) WithDefaults() *ListPostureCheckTypesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list posture check types params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListPostureCheckTypesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list posture check types params -func (o *ListPostureCheckTypesParams) WithTimeout(timeout time.Duration) *ListPostureCheckTypesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list posture check types params -func (o *ListPostureCheckTypesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list posture check types params -func (o *ListPostureCheckTypesParams) WithContext(ctx context.Context) *ListPostureCheckTypesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list posture check types params -func (o *ListPostureCheckTypesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list posture check types params -func (o *ListPostureCheckTypesParams) WithHTTPClient(client *http.Client) *ListPostureCheckTypesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list posture check types params -func (o *ListPostureCheckTypesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list posture check types params -func (o *ListPostureCheckTypesParams) WithFilter(filter *string) *ListPostureCheckTypesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list posture check types params -func (o *ListPostureCheckTypesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list posture check types params -func (o *ListPostureCheckTypesParams) WithLimit(limit *int64) *ListPostureCheckTypesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list posture check types params -func (o *ListPostureCheckTypesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list posture check types params -func (o *ListPostureCheckTypesParams) WithOffset(offset *int64) *ListPostureCheckTypesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list posture check types params -func (o *ListPostureCheckTypesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListPostureCheckTypesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/list_posture_check_types_responses.go b/rest_management_api_client/posture_checks/list_posture_check_types_responses.go deleted file mode 100644 index 451b4857e..000000000 --- a/rest_management_api_client/posture_checks/list_posture_check_types_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListPostureCheckTypesReader is a Reader for the ListPostureCheckTypes structure. -type ListPostureCheckTypesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListPostureCheckTypesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListPostureCheckTypesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListPostureCheckTypesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListPostureCheckTypesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListPostureCheckTypesOK creates a ListPostureCheckTypesOK with default headers values -func NewListPostureCheckTypesOK() *ListPostureCheckTypesOK { - return &ListPostureCheckTypesOK{} -} - -/* ListPostureCheckTypesOK describes a response with status code 200, with default header values. - -A list of posture check types -*/ -type ListPostureCheckTypesOK struct { - Payload *rest_model.ListPostureCheckTypesEnvelope -} - -func (o *ListPostureCheckTypesOK) Error() string { - return fmt.Sprintf("[GET /posture-check-types][%d] listPostureCheckTypesOK %+v", 200, o.Payload) -} -func (o *ListPostureCheckTypesOK) GetPayload() *rest_model.ListPostureCheckTypesEnvelope { - return o.Payload -} - -func (o *ListPostureCheckTypesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListPostureCheckTypesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListPostureCheckTypesBadRequest creates a ListPostureCheckTypesBadRequest with default headers values -func NewListPostureCheckTypesBadRequest() *ListPostureCheckTypesBadRequest { - return &ListPostureCheckTypesBadRequest{} -} - -/* ListPostureCheckTypesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListPostureCheckTypesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListPostureCheckTypesBadRequest) Error() string { - return fmt.Sprintf("[GET /posture-check-types][%d] listPostureCheckTypesBadRequest %+v", 400, o.Payload) -} -func (o *ListPostureCheckTypesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListPostureCheckTypesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListPostureCheckTypesUnauthorized creates a ListPostureCheckTypesUnauthorized with default headers values -func NewListPostureCheckTypesUnauthorized() *ListPostureCheckTypesUnauthorized { - return &ListPostureCheckTypesUnauthorized{} -} - -/* ListPostureCheckTypesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListPostureCheckTypesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListPostureCheckTypesUnauthorized) Error() string { - return fmt.Sprintf("[GET /posture-check-types][%d] listPostureCheckTypesUnauthorized %+v", 401, o.Payload) -} -func (o *ListPostureCheckTypesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListPostureCheckTypesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/list_posture_checks_parameters.go b/rest_management_api_client/posture_checks/list_posture_checks_parameters.go deleted file mode 100644 index 76c586ffd..000000000 --- a/rest_management_api_client/posture_checks/list_posture_checks_parameters.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListPostureChecksParams creates a new ListPostureChecksParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListPostureChecksParams() *ListPostureChecksParams { - return &ListPostureChecksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListPostureChecksParamsWithTimeout creates a new ListPostureChecksParams object -// with the ability to set a timeout on a request. -func NewListPostureChecksParamsWithTimeout(timeout time.Duration) *ListPostureChecksParams { - return &ListPostureChecksParams{ - timeout: timeout, - } -} - -// NewListPostureChecksParamsWithContext creates a new ListPostureChecksParams object -// with the ability to set a context for a request. -func NewListPostureChecksParamsWithContext(ctx context.Context) *ListPostureChecksParams { - return &ListPostureChecksParams{ - Context: ctx, - } -} - -// NewListPostureChecksParamsWithHTTPClient creates a new ListPostureChecksParams object -// with the ability to set a custom HTTPClient for a request. -func NewListPostureChecksParamsWithHTTPClient(client *http.Client) *ListPostureChecksParams { - return &ListPostureChecksParams{ - HTTPClient: client, - } -} - -/* ListPostureChecksParams contains all the parameters to send to the API endpoint - for the list posture checks operation. - - Typically these are written to a http.Request. -*/ -type ListPostureChecksParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - // RoleFilter. - RoleFilter []string - - // RoleSemantic. - RoleSemantic *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list posture checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListPostureChecksParams) WithDefaults() *ListPostureChecksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list posture checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListPostureChecksParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list posture checks params -func (o *ListPostureChecksParams) WithTimeout(timeout time.Duration) *ListPostureChecksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list posture checks params -func (o *ListPostureChecksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list posture checks params -func (o *ListPostureChecksParams) WithContext(ctx context.Context) *ListPostureChecksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list posture checks params -func (o *ListPostureChecksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list posture checks params -func (o *ListPostureChecksParams) WithHTTPClient(client *http.Client) *ListPostureChecksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list posture checks params -func (o *ListPostureChecksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list posture checks params -func (o *ListPostureChecksParams) WithFilter(filter *string) *ListPostureChecksParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list posture checks params -func (o *ListPostureChecksParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list posture checks params -func (o *ListPostureChecksParams) WithLimit(limit *int64) *ListPostureChecksParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list posture checks params -func (o *ListPostureChecksParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list posture checks params -func (o *ListPostureChecksParams) WithOffset(offset *int64) *ListPostureChecksParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list posture checks params -func (o *ListPostureChecksParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithRoleFilter adds the roleFilter to the list posture checks params -func (o *ListPostureChecksParams) WithRoleFilter(roleFilter []string) *ListPostureChecksParams { - o.SetRoleFilter(roleFilter) - return o -} - -// SetRoleFilter adds the roleFilter to the list posture checks params -func (o *ListPostureChecksParams) SetRoleFilter(roleFilter []string) { - o.RoleFilter = roleFilter -} - -// WithRoleSemantic adds the roleSemantic to the list posture checks params -func (o *ListPostureChecksParams) WithRoleSemantic(roleSemantic *string) *ListPostureChecksParams { - o.SetRoleSemantic(roleSemantic) - return o -} - -// SetRoleSemantic adds the roleSemantic to the list posture checks params -func (o *ListPostureChecksParams) SetRoleSemantic(roleSemantic *string) { - o.RoleSemantic = roleSemantic -} - -// WriteToRequest writes these params to a swagger request -func (o *ListPostureChecksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if o.RoleFilter != nil { - - // binding items for roleFilter - joinedRoleFilter := o.bindParamRoleFilter(reg) - - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err - } - } - - if o.RoleSemantic != nil { - - // query param roleSemantic - var qrRoleSemantic string - - if o.RoleSemantic != nil { - qrRoleSemantic = *o.RoleSemantic - } - qRoleSemantic := qrRoleSemantic - if qRoleSemantic != "" { - - if err := r.SetQueryParam("roleSemantic", qRoleSemantic); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamListPostureChecks binds the parameter roleFilter -func (o *ListPostureChecksParams) bindParamRoleFilter(formats strfmt.Registry) []string { - roleFilterIR := o.RoleFilter - - var roleFilterIC []string - for _, roleFilterIIR := range roleFilterIR { // explode []string - - roleFilterIIV := roleFilterIIR // string as string - roleFilterIC = append(roleFilterIC, roleFilterIIV) - } - - // items.CollectionFormat: "multi" - roleFilterIS := swag.JoinByFormat(roleFilterIC, "multi") - - return roleFilterIS -} diff --git a/rest_management_api_client/posture_checks/list_posture_checks_responses.go b/rest_management_api_client/posture_checks/list_posture_checks_responses.go deleted file mode 100644 index a6cb59b53..000000000 --- a/rest_management_api_client/posture_checks/list_posture_checks_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListPostureChecksReader is a Reader for the ListPostureChecks structure. -type ListPostureChecksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListPostureChecksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListPostureChecksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListPostureChecksBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListPostureChecksUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListPostureChecksOK creates a ListPostureChecksOK with default headers values -func NewListPostureChecksOK() *ListPostureChecksOK { - return &ListPostureChecksOK{} -} - -/* ListPostureChecksOK describes a response with status code 200, with default header values. - -A list of posture checks -*/ -type ListPostureChecksOK struct { - Payload *rest_model.ListPostureCheckEnvelope -} - -func (o *ListPostureChecksOK) Error() string { - return fmt.Sprintf("[GET /posture-checks][%d] listPostureChecksOK %+v", 200, o.Payload) -} -func (o *ListPostureChecksOK) GetPayload() *rest_model.ListPostureCheckEnvelope { - return o.Payload -} - -func (o *ListPostureChecksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListPostureCheckEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListPostureChecksBadRequest creates a ListPostureChecksBadRequest with default headers values -func NewListPostureChecksBadRequest() *ListPostureChecksBadRequest { - return &ListPostureChecksBadRequest{} -} - -/* ListPostureChecksBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListPostureChecksBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListPostureChecksBadRequest) Error() string { - return fmt.Sprintf("[GET /posture-checks][%d] listPostureChecksBadRequest %+v", 400, o.Payload) -} -func (o *ListPostureChecksBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListPostureChecksBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListPostureChecksUnauthorized creates a ListPostureChecksUnauthorized with default headers values -func NewListPostureChecksUnauthorized() *ListPostureChecksUnauthorized { - return &ListPostureChecksUnauthorized{} -} - -/* ListPostureChecksUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListPostureChecksUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListPostureChecksUnauthorized) Error() string { - return fmt.Sprintf("[GET /posture-checks][%d] listPostureChecksUnauthorized %+v", 401, o.Payload) -} -func (o *ListPostureChecksUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListPostureChecksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/patch_posture_check_parameters.go b/rest_management_api_client/posture_checks/patch_posture_check_parameters.go deleted file mode 100644 index 313aa9189..000000000 --- a/rest_management_api_client/posture_checks/patch_posture_check_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchPostureCheckParams creates a new PatchPostureCheckParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchPostureCheckParams() *PatchPostureCheckParams { - return &PatchPostureCheckParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchPostureCheckParamsWithTimeout creates a new PatchPostureCheckParams object -// with the ability to set a timeout on a request. -func NewPatchPostureCheckParamsWithTimeout(timeout time.Duration) *PatchPostureCheckParams { - return &PatchPostureCheckParams{ - timeout: timeout, - } -} - -// NewPatchPostureCheckParamsWithContext creates a new PatchPostureCheckParams object -// with the ability to set a context for a request. -func NewPatchPostureCheckParamsWithContext(ctx context.Context) *PatchPostureCheckParams { - return &PatchPostureCheckParams{ - Context: ctx, - } -} - -// NewPatchPostureCheckParamsWithHTTPClient creates a new PatchPostureCheckParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchPostureCheckParamsWithHTTPClient(client *http.Client) *PatchPostureCheckParams { - return &PatchPostureCheckParams{ - HTTPClient: client, - } -} - -/* PatchPostureCheckParams contains all the parameters to send to the API endpoint - for the patch posture check operation. - - Typically these are written to a http.Request. -*/ -type PatchPostureCheckParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* PostureCheck. - - A Posture Check patch object - */ - PostureCheck rest_model.PostureCheckPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchPostureCheckParams) WithDefaults() *PatchPostureCheckParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchPostureCheckParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch posture check params -func (o *PatchPostureCheckParams) WithTimeout(timeout time.Duration) *PatchPostureCheckParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch posture check params -func (o *PatchPostureCheckParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch posture check params -func (o *PatchPostureCheckParams) WithContext(ctx context.Context) *PatchPostureCheckParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch posture check params -func (o *PatchPostureCheckParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch posture check params -func (o *PatchPostureCheckParams) WithHTTPClient(client *http.Client) *PatchPostureCheckParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch posture check params -func (o *PatchPostureCheckParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch posture check params -func (o *PatchPostureCheckParams) WithID(id string) *PatchPostureCheckParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch posture check params -func (o *PatchPostureCheckParams) SetID(id string) { - o.ID = id -} - -// WithPostureCheck adds the postureCheck to the patch posture check params -func (o *PatchPostureCheckParams) WithPostureCheck(postureCheck rest_model.PostureCheckPatch) *PatchPostureCheckParams { - o.SetPostureCheck(postureCheck) - return o -} - -// SetPostureCheck adds the postureCheck to the patch posture check params -func (o *PatchPostureCheckParams) SetPostureCheck(postureCheck rest_model.PostureCheckPatch) { - o.PostureCheck = postureCheck -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchPostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if err := r.SetBodyParam(o.PostureCheck); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/patch_posture_check_responses.go b/rest_management_api_client/posture_checks/patch_posture_check_responses.go deleted file mode 100644 index fce80184a..000000000 --- a/rest_management_api_client/posture_checks/patch_posture_check_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchPostureCheckReader is a Reader for the PatchPostureCheck structure. -type PatchPostureCheckReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchPostureCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchPostureCheckOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchPostureCheckBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchPostureCheckUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchPostureCheckNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchPostureCheckOK creates a PatchPostureCheckOK with default headers values -func NewPatchPostureCheckOK() *PatchPostureCheckOK { - return &PatchPostureCheckOK{} -} - -/* PatchPostureCheckOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchPostureCheckOK struct { - Payload *rest_model.Empty -} - -func (o *PatchPostureCheckOK) Error() string { - return fmt.Sprintf("[PATCH /posture-checks/{id}][%d] patchPostureCheckOK %+v", 200, o.Payload) -} -func (o *PatchPostureCheckOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchPostureCheckOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchPostureCheckBadRequest creates a PatchPostureCheckBadRequest with default headers values -func NewPatchPostureCheckBadRequest() *PatchPostureCheckBadRequest { - return &PatchPostureCheckBadRequest{} -} - -/* PatchPostureCheckBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchPostureCheckBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchPostureCheckBadRequest) Error() string { - return fmt.Sprintf("[PATCH /posture-checks/{id}][%d] patchPostureCheckBadRequest %+v", 400, o.Payload) -} -func (o *PatchPostureCheckBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchPostureCheckBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchPostureCheckUnauthorized creates a PatchPostureCheckUnauthorized with default headers values -func NewPatchPostureCheckUnauthorized() *PatchPostureCheckUnauthorized { - return &PatchPostureCheckUnauthorized{} -} - -/* PatchPostureCheckUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchPostureCheckUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchPostureCheckUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /posture-checks/{id}][%d] patchPostureCheckUnauthorized %+v", 401, o.Payload) -} -func (o *PatchPostureCheckUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchPostureCheckUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchPostureCheckNotFound creates a PatchPostureCheckNotFound with default headers values -func NewPatchPostureCheckNotFound() *PatchPostureCheckNotFound { - return &PatchPostureCheckNotFound{} -} - -/* PatchPostureCheckNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchPostureCheckNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchPostureCheckNotFound) Error() string { - return fmt.Sprintf("[PATCH /posture-checks/{id}][%d] patchPostureCheckNotFound %+v", 404, o.Payload) -} -func (o *PatchPostureCheckNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchPostureCheckNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/posture_checks/posture_checks_client.go b/rest_management_api_client/posture_checks/posture_checks_client.go deleted file mode 100644 index a0fcf32d5..000000000 --- a/rest_management_api_client/posture_checks/posture_checks_client.go +++ /dev/null @@ -1,409 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new posture checks API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for posture checks API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreatePostureCheck(params *CreatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureCheckCreated, error) - - DeletePostureCheck(params *DeletePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePostureCheckOK, error) - - DetailPostureCheck(params *DetailPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckOK, error) - - DetailPostureCheckType(params *DetailPostureCheckTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckTypeOK, error) - - ListPostureCheckTypes(params *ListPostureCheckTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureCheckTypesOK, error) - - ListPostureChecks(params *ListPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureChecksOK, error) - - PatchPostureCheck(params *PatchPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchPostureCheckOK, error) - - UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostureCheckOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreatePostureCheck creates a posture checks - - Creates a Posture Checks -*/ -func (a *Client) CreatePostureCheck(params *CreatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreatePostureCheckCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePostureCheckParams() - } - op := &runtime.ClientOperation{ - ID: "createPostureCheck", - Method: "POST", - PathPattern: "/posture-checks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreatePostureCheckReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreatePostureCheckCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createPostureCheck: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeletePostureCheck deletes an posture checks - - Deletes and Posture Checks by id -*/ -func (a *Client) DeletePostureCheck(params *DeletePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeletePostureCheckOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeletePostureCheckParams() - } - op := &runtime.ClientOperation{ - ID: "deletePostureCheck", - Method: "DELETE", - PathPattern: "/posture-checks/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeletePostureCheckReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeletePostureCheckOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deletePostureCheck: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailPostureCheck retrieves a single posture checks - - Retrieves a single Posture Checks by id -*/ -func (a *Client) DetailPostureCheck(params *DetailPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailPostureCheckParams() - } - op := &runtime.ClientOperation{ - ID: "detailPostureCheck", - Method: "GET", - PathPattern: "/posture-checks/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailPostureCheckReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailPostureCheckOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailPostureCheck: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailPostureCheckType retrieves a single posture check type - - Retrieves a single posture check type by id -*/ -func (a *Client) DetailPostureCheckType(params *DetailPostureCheckTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailPostureCheckTypeOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailPostureCheckTypeParams() - } - op := &runtime.ClientOperation{ - ID: "detailPostureCheckType", - Method: "GET", - PathPattern: "/posture-check-types/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailPostureCheckTypeReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailPostureCheckTypeOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailPostureCheckType: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListPostureCheckTypes lists a subset of posture check types - - Retrieves a list of posture check types - -*/ -func (a *Client) ListPostureCheckTypes(params *ListPostureCheckTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureCheckTypesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListPostureCheckTypesParams() - } - op := &runtime.ClientOperation{ - ID: "listPostureCheckTypes", - Method: "GET", - PathPattern: "/posture-check-types", - ProducesMediaTypes: []string{"application/json; charset=utf-8"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListPostureCheckTypesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListPostureCheckTypesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listPostureCheckTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListPostureChecks lists a subset of posture checks - - Retrieves a list of posture checks - -*/ -func (a *Client) ListPostureChecks(params *ListPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListPostureChecksOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListPostureChecksParams() - } - op := &runtime.ClientOperation{ - ID: "listPostureChecks", - Method: "GET", - PathPattern: "/posture-checks", - ProducesMediaTypes: []string{"application/json; charset=utf-8"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListPostureChecksReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListPostureChecksOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listPostureChecks: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchPostureCheck updates the supplied fields on a posture checks - - Update only the supplied fields on a Posture Checks by id -*/ -func (a *Client) PatchPostureCheck(params *PatchPostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchPostureCheckOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchPostureCheckParams() - } - op := &runtime.ClientOperation{ - ID: "patchPostureCheck", - Method: "PATCH", - PathPattern: "/posture-checks/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchPostureCheckReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchPostureCheckOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchPostureCheck: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdatePostureCheck updates all fields on a posture checks - - Update all fields on a Posture Checks by id -*/ -func (a *Client) UpdatePostureCheck(params *UpdatePostureCheckParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdatePostureCheckOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdatePostureCheckParams() - } - op := &runtime.ClientOperation{ - ID: "updatePostureCheck", - Method: "PUT", - PathPattern: "/posture-checks/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdatePostureCheckReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdatePostureCheckOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updatePostureCheck: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/posture_checks/update_posture_check_parameters.go b/rest_management_api_client/posture_checks/update_posture_check_parameters.go deleted file mode 100644 index 74a8bdecb..000000000 --- a/rest_management_api_client/posture_checks/update_posture_check_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdatePostureCheckParams creates a new UpdatePostureCheckParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdatePostureCheckParams() *UpdatePostureCheckParams { - return &UpdatePostureCheckParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdatePostureCheckParamsWithTimeout creates a new UpdatePostureCheckParams object -// with the ability to set a timeout on a request. -func NewUpdatePostureCheckParamsWithTimeout(timeout time.Duration) *UpdatePostureCheckParams { - return &UpdatePostureCheckParams{ - timeout: timeout, - } -} - -// NewUpdatePostureCheckParamsWithContext creates a new UpdatePostureCheckParams object -// with the ability to set a context for a request. -func NewUpdatePostureCheckParamsWithContext(ctx context.Context) *UpdatePostureCheckParams { - return &UpdatePostureCheckParams{ - Context: ctx, - } -} - -// NewUpdatePostureCheckParamsWithHTTPClient creates a new UpdatePostureCheckParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdatePostureCheckParamsWithHTTPClient(client *http.Client) *UpdatePostureCheckParams { - return &UpdatePostureCheckParams{ - HTTPClient: client, - } -} - -/* UpdatePostureCheckParams contains all the parameters to send to the API endpoint - for the update posture check operation. - - Typically these are written to a http.Request. -*/ -type UpdatePostureCheckParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* PostureCheck. - - A Posture Check update object - */ - PostureCheck rest_model.PostureCheckUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdatePostureCheckParams) WithDefaults() *UpdatePostureCheckParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update posture check params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdatePostureCheckParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update posture check params -func (o *UpdatePostureCheckParams) WithTimeout(timeout time.Duration) *UpdatePostureCheckParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update posture check params -func (o *UpdatePostureCheckParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update posture check params -func (o *UpdatePostureCheckParams) WithContext(ctx context.Context) *UpdatePostureCheckParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update posture check params -func (o *UpdatePostureCheckParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update posture check params -func (o *UpdatePostureCheckParams) WithHTTPClient(client *http.Client) *UpdatePostureCheckParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update posture check params -func (o *UpdatePostureCheckParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update posture check params -func (o *UpdatePostureCheckParams) WithID(id string) *UpdatePostureCheckParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update posture check params -func (o *UpdatePostureCheckParams) SetID(id string) { - o.ID = id -} - -// WithPostureCheck adds the postureCheck to the update posture check params -func (o *UpdatePostureCheckParams) WithPostureCheck(postureCheck rest_model.PostureCheckUpdate) *UpdatePostureCheckParams { - o.SetPostureCheck(postureCheck) - return o -} - -// SetPostureCheck adds the postureCheck to the update posture check params -func (o *UpdatePostureCheckParams) SetPostureCheck(postureCheck rest_model.PostureCheckUpdate) { - o.PostureCheck = postureCheck -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdatePostureCheckParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if err := r.SetBodyParam(o.PostureCheck); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/posture_checks/update_posture_check_responses.go b/rest_management_api_client/posture_checks/update_posture_check_responses.go deleted file mode 100644 index a53bb25a7..000000000 --- a/rest_management_api_client/posture_checks/update_posture_check_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdatePostureCheckReader is a Reader for the UpdatePostureCheck structure. -type UpdatePostureCheckReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdatePostureCheckReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdatePostureCheckOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdatePostureCheckBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdatePostureCheckUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdatePostureCheckNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdatePostureCheckOK creates a UpdatePostureCheckOK with default headers values -func NewUpdatePostureCheckOK() *UpdatePostureCheckOK { - return &UpdatePostureCheckOK{} -} - -/* UpdatePostureCheckOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdatePostureCheckOK struct { - Payload *rest_model.Empty -} - -func (o *UpdatePostureCheckOK) Error() string { - return fmt.Sprintf("[PUT /posture-checks/{id}][%d] updatePostureCheckOK %+v", 200, o.Payload) -} -func (o *UpdatePostureCheckOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdatePostureCheckOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePostureCheckBadRequest creates a UpdatePostureCheckBadRequest with default headers values -func NewUpdatePostureCheckBadRequest() *UpdatePostureCheckBadRequest { - return &UpdatePostureCheckBadRequest{} -} - -/* UpdatePostureCheckBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdatePostureCheckBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdatePostureCheckBadRequest) Error() string { - return fmt.Sprintf("[PUT /posture-checks/{id}][%d] updatePostureCheckBadRequest %+v", 400, o.Payload) -} -func (o *UpdatePostureCheckBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdatePostureCheckBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePostureCheckUnauthorized creates a UpdatePostureCheckUnauthorized with default headers values -func NewUpdatePostureCheckUnauthorized() *UpdatePostureCheckUnauthorized { - return &UpdatePostureCheckUnauthorized{} -} - -/* UpdatePostureCheckUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdatePostureCheckUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdatePostureCheckUnauthorized) Error() string { - return fmt.Sprintf("[PUT /posture-checks/{id}][%d] updatePostureCheckUnauthorized %+v", 401, o.Payload) -} -func (o *UpdatePostureCheckUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdatePostureCheckUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePostureCheckNotFound creates a UpdatePostureCheckNotFound with default headers values -func NewUpdatePostureCheckNotFound() *UpdatePostureCheckNotFound { - return &UpdatePostureCheckNotFound{} -} - -/* UpdatePostureCheckNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdatePostureCheckNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdatePostureCheckNotFound) Error() string { - return fmt.Sprintf("[PUT /posture-checks/{id}][%d] updatePostureCheckNotFound %+v", 404, o.Payload) -} -func (o *UpdatePostureCheckNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdatePostureCheckNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/role_attributes/list_edge_router_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_edge_router_role_attributes_parameters.go deleted file mode 100644 index cf15c6d54..000000000 --- a/rest_management_api_client/role_attributes/list_edge_router_role_attributes_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEdgeRouterRoleAttributesParams creates a new ListEdgeRouterRoleAttributesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListEdgeRouterRoleAttributesParams() *ListEdgeRouterRoleAttributesParams { - return &ListEdgeRouterRoleAttributesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListEdgeRouterRoleAttributesParamsWithTimeout creates a new ListEdgeRouterRoleAttributesParams object -// with the ability to set a timeout on a request. -func NewListEdgeRouterRoleAttributesParamsWithTimeout(timeout time.Duration) *ListEdgeRouterRoleAttributesParams { - return &ListEdgeRouterRoleAttributesParams{ - timeout: timeout, - } -} - -// NewListEdgeRouterRoleAttributesParamsWithContext creates a new ListEdgeRouterRoleAttributesParams object -// with the ability to set a context for a request. -func NewListEdgeRouterRoleAttributesParamsWithContext(ctx context.Context) *ListEdgeRouterRoleAttributesParams { - return &ListEdgeRouterRoleAttributesParams{ - Context: ctx, - } -} - -// NewListEdgeRouterRoleAttributesParamsWithHTTPClient creates a new ListEdgeRouterRoleAttributesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListEdgeRouterRoleAttributesParamsWithHTTPClient(client *http.Client) *ListEdgeRouterRoleAttributesParams { - return &ListEdgeRouterRoleAttributesParams{ - HTTPClient: client, - } -} - -/* ListEdgeRouterRoleAttributesParams contains all the parameters to send to the API endpoint - for the list edge router role attributes operation. - - Typically these are written to a http.Request. -*/ -type ListEdgeRouterRoleAttributesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list edge router role attributes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterRoleAttributesParams) WithDefaults() *ListEdgeRouterRoleAttributesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list edge router role attributes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListEdgeRouterRoleAttributesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) WithTimeout(timeout time.Duration) *ListEdgeRouterRoleAttributesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) WithContext(ctx context.Context) *ListEdgeRouterRoleAttributesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) WithHTTPClient(client *http.Client) *ListEdgeRouterRoleAttributesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) WithFilter(filter *string) *ListEdgeRouterRoleAttributesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) WithLimit(limit *int64) *ListEdgeRouterRoleAttributesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) WithOffset(offset *int64) *ListEdgeRouterRoleAttributesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list edge router role attributes params -func (o *ListEdgeRouterRoleAttributesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListEdgeRouterRoleAttributesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/role_attributes/list_edge_router_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_edge_router_role_attributes_responses.go deleted file mode 100644 index 165935867..000000000 --- a/rest_management_api_client/role_attributes/list_edge_router_role_attributes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterRoleAttributesReader is a Reader for the ListEdgeRouterRoleAttributes structure. -type ListEdgeRouterRoleAttributesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListEdgeRouterRoleAttributesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListEdgeRouterRoleAttributesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListEdgeRouterRoleAttributesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListEdgeRouterRoleAttributesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListEdgeRouterRoleAttributesOK creates a ListEdgeRouterRoleAttributesOK with default headers values -func NewListEdgeRouterRoleAttributesOK() *ListEdgeRouterRoleAttributesOK { - return &ListEdgeRouterRoleAttributesOK{} -} - -/* ListEdgeRouterRoleAttributesOK describes a response with status code 200, with default header values. - -A list of role attributes -*/ -type ListEdgeRouterRoleAttributesOK struct { - Payload *rest_model.ListRoleAttributesEnvelope -} - -func (o *ListEdgeRouterRoleAttributesOK) Error() string { - return fmt.Sprintf("[GET /edge-router-role-attributes][%d] listEdgeRouterRoleAttributesOK %+v", 200, o.Payload) -} -func (o *ListEdgeRouterRoleAttributesOK) GetPayload() *rest_model.ListRoleAttributesEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterRoleAttributesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListRoleAttributesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterRoleAttributesBadRequest creates a ListEdgeRouterRoleAttributesBadRequest with default headers values -func NewListEdgeRouterRoleAttributesBadRequest() *ListEdgeRouterRoleAttributesBadRequest { - return &ListEdgeRouterRoleAttributesBadRequest{} -} - -/* ListEdgeRouterRoleAttributesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListEdgeRouterRoleAttributesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterRoleAttributesBadRequest) Error() string { - return fmt.Sprintf("[GET /edge-router-role-attributes][%d] listEdgeRouterRoleAttributesBadRequest %+v", 400, o.Payload) -} -func (o *ListEdgeRouterRoleAttributesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterRoleAttributesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListEdgeRouterRoleAttributesUnauthorized creates a ListEdgeRouterRoleAttributesUnauthorized with default headers values -func NewListEdgeRouterRoleAttributesUnauthorized() *ListEdgeRouterRoleAttributesUnauthorized { - return &ListEdgeRouterRoleAttributesUnauthorized{} -} - -/* ListEdgeRouterRoleAttributesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListEdgeRouterRoleAttributesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListEdgeRouterRoleAttributesUnauthorized) Error() string { - return fmt.Sprintf("[GET /edge-router-role-attributes][%d] listEdgeRouterRoleAttributesUnauthorized %+v", 401, o.Payload) -} -func (o *ListEdgeRouterRoleAttributesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListEdgeRouterRoleAttributesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/role_attributes/list_identity_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_identity_role_attributes_parameters.go deleted file mode 100644 index 8211f2dca..000000000 --- a/rest_management_api_client/role_attributes/list_identity_role_attributes_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListIdentityRoleAttributesParams creates a new ListIdentityRoleAttributesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListIdentityRoleAttributesParams() *ListIdentityRoleAttributesParams { - return &ListIdentityRoleAttributesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListIdentityRoleAttributesParamsWithTimeout creates a new ListIdentityRoleAttributesParams object -// with the ability to set a timeout on a request. -func NewListIdentityRoleAttributesParamsWithTimeout(timeout time.Duration) *ListIdentityRoleAttributesParams { - return &ListIdentityRoleAttributesParams{ - timeout: timeout, - } -} - -// NewListIdentityRoleAttributesParamsWithContext creates a new ListIdentityRoleAttributesParams object -// with the ability to set a context for a request. -func NewListIdentityRoleAttributesParamsWithContext(ctx context.Context) *ListIdentityRoleAttributesParams { - return &ListIdentityRoleAttributesParams{ - Context: ctx, - } -} - -// NewListIdentityRoleAttributesParamsWithHTTPClient creates a new ListIdentityRoleAttributesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListIdentityRoleAttributesParamsWithHTTPClient(client *http.Client) *ListIdentityRoleAttributesParams { - return &ListIdentityRoleAttributesParams{ - HTTPClient: client, - } -} - -/* ListIdentityRoleAttributesParams contains all the parameters to send to the API endpoint - for the list identity role attributes operation. - - Typically these are written to a http.Request. -*/ -type ListIdentityRoleAttributesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list identity role attributes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityRoleAttributesParams) WithDefaults() *ListIdentityRoleAttributesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list identity role attributes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListIdentityRoleAttributesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) WithTimeout(timeout time.Duration) *ListIdentityRoleAttributesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) WithContext(ctx context.Context) *ListIdentityRoleAttributesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) WithHTTPClient(client *http.Client) *ListIdentityRoleAttributesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) WithFilter(filter *string) *ListIdentityRoleAttributesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) WithLimit(limit *int64) *ListIdentityRoleAttributesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) WithOffset(offset *int64) *ListIdentityRoleAttributesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list identity role attributes params -func (o *ListIdentityRoleAttributesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListIdentityRoleAttributesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/role_attributes/list_identity_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_identity_role_attributes_responses.go deleted file mode 100644 index 748af40bc..000000000 --- a/rest_management_api_client/role_attributes/list_identity_role_attributes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityRoleAttributesReader is a Reader for the ListIdentityRoleAttributes structure. -type ListIdentityRoleAttributesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListIdentityRoleAttributesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListIdentityRoleAttributesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListIdentityRoleAttributesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListIdentityRoleAttributesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListIdentityRoleAttributesOK creates a ListIdentityRoleAttributesOK with default headers values -func NewListIdentityRoleAttributesOK() *ListIdentityRoleAttributesOK { - return &ListIdentityRoleAttributesOK{} -} - -/* ListIdentityRoleAttributesOK describes a response with status code 200, with default header values. - -A list of role attributes -*/ -type ListIdentityRoleAttributesOK struct { - Payload *rest_model.ListRoleAttributesEnvelope -} - -func (o *ListIdentityRoleAttributesOK) Error() string { - return fmt.Sprintf("[GET /identity-role-attributes][%d] listIdentityRoleAttributesOK %+v", 200, o.Payload) -} -func (o *ListIdentityRoleAttributesOK) GetPayload() *rest_model.ListRoleAttributesEnvelope { - return o.Payload -} - -func (o *ListIdentityRoleAttributesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListRoleAttributesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityRoleAttributesBadRequest creates a ListIdentityRoleAttributesBadRequest with default headers values -func NewListIdentityRoleAttributesBadRequest() *ListIdentityRoleAttributesBadRequest { - return &ListIdentityRoleAttributesBadRequest{} -} - -/* ListIdentityRoleAttributesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListIdentityRoleAttributesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityRoleAttributesBadRequest) Error() string { - return fmt.Sprintf("[GET /identity-role-attributes][%d] listIdentityRoleAttributesBadRequest %+v", 400, o.Payload) -} -func (o *ListIdentityRoleAttributesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityRoleAttributesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListIdentityRoleAttributesUnauthorized creates a ListIdentityRoleAttributesUnauthorized with default headers values -func NewListIdentityRoleAttributesUnauthorized() *ListIdentityRoleAttributesUnauthorized { - return &ListIdentityRoleAttributesUnauthorized{} -} - -/* ListIdentityRoleAttributesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListIdentityRoleAttributesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListIdentityRoleAttributesUnauthorized) Error() string { - return fmt.Sprintf("[GET /identity-role-attributes][%d] listIdentityRoleAttributesUnauthorized %+v", 401, o.Payload) -} -func (o *ListIdentityRoleAttributesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListIdentityRoleAttributesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/role_attributes/list_service_role_attributes_parameters.go b/rest_management_api_client/role_attributes/list_service_role_attributes_parameters.go deleted file mode 100644 index 3fa348885..000000000 --- a/rest_management_api_client/role_attributes/list_service_role_attributes_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceRoleAttributesParams creates a new ListServiceRoleAttributesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceRoleAttributesParams() *ListServiceRoleAttributesParams { - return &ListServiceRoleAttributesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceRoleAttributesParamsWithTimeout creates a new ListServiceRoleAttributesParams object -// with the ability to set a timeout on a request. -func NewListServiceRoleAttributesParamsWithTimeout(timeout time.Duration) *ListServiceRoleAttributesParams { - return &ListServiceRoleAttributesParams{ - timeout: timeout, - } -} - -// NewListServiceRoleAttributesParamsWithContext creates a new ListServiceRoleAttributesParams object -// with the ability to set a context for a request. -func NewListServiceRoleAttributesParamsWithContext(ctx context.Context) *ListServiceRoleAttributesParams { - return &ListServiceRoleAttributesParams{ - Context: ctx, - } -} - -// NewListServiceRoleAttributesParamsWithHTTPClient creates a new ListServiceRoleAttributesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceRoleAttributesParamsWithHTTPClient(client *http.Client) *ListServiceRoleAttributesParams { - return &ListServiceRoleAttributesParams{ - HTTPClient: client, - } -} - -/* ListServiceRoleAttributesParams contains all the parameters to send to the API endpoint - for the list service role attributes operation. - - Typically these are written to a http.Request. -*/ -type ListServiceRoleAttributesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service role attributes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceRoleAttributesParams) WithDefaults() *ListServiceRoleAttributesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service role attributes params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceRoleAttributesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service role attributes params -func (o *ListServiceRoleAttributesParams) WithTimeout(timeout time.Duration) *ListServiceRoleAttributesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service role attributes params -func (o *ListServiceRoleAttributesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service role attributes params -func (o *ListServiceRoleAttributesParams) WithContext(ctx context.Context) *ListServiceRoleAttributesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service role attributes params -func (o *ListServiceRoleAttributesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service role attributes params -func (o *ListServiceRoleAttributesParams) WithHTTPClient(client *http.Client) *ListServiceRoleAttributesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service role attributes params -func (o *ListServiceRoleAttributesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service role attributes params -func (o *ListServiceRoleAttributesParams) WithFilter(filter *string) *ListServiceRoleAttributesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service role attributes params -func (o *ListServiceRoleAttributesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list service role attributes params -func (o *ListServiceRoleAttributesParams) WithLimit(limit *int64) *ListServiceRoleAttributesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service role attributes params -func (o *ListServiceRoleAttributesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service role attributes params -func (o *ListServiceRoleAttributesParams) WithOffset(offset *int64) *ListServiceRoleAttributesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service role attributes params -func (o *ListServiceRoleAttributesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceRoleAttributesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/role_attributes/list_service_role_attributes_responses.go b/rest_management_api_client/role_attributes/list_service_role_attributes_responses.go deleted file mode 100644 index 233498a09..000000000 --- a/rest_management_api_client/role_attributes/list_service_role_attributes_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceRoleAttributesReader is a Reader for the ListServiceRoleAttributes structure. -type ListServiceRoleAttributesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceRoleAttributesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceRoleAttributesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceRoleAttributesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceRoleAttributesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceRoleAttributesOK creates a ListServiceRoleAttributesOK with default headers values -func NewListServiceRoleAttributesOK() *ListServiceRoleAttributesOK { - return &ListServiceRoleAttributesOK{} -} - -/* ListServiceRoleAttributesOK describes a response with status code 200, with default header values. - -A list of role attributes -*/ -type ListServiceRoleAttributesOK struct { - Payload *rest_model.ListRoleAttributesEnvelope -} - -func (o *ListServiceRoleAttributesOK) Error() string { - return fmt.Sprintf("[GET /service-role-attributes][%d] listServiceRoleAttributesOK %+v", 200, o.Payload) -} -func (o *ListServiceRoleAttributesOK) GetPayload() *rest_model.ListRoleAttributesEnvelope { - return o.Payload -} - -func (o *ListServiceRoleAttributesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListRoleAttributesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceRoleAttributesBadRequest creates a ListServiceRoleAttributesBadRequest with default headers values -func NewListServiceRoleAttributesBadRequest() *ListServiceRoleAttributesBadRequest { - return &ListServiceRoleAttributesBadRequest{} -} - -/* ListServiceRoleAttributesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceRoleAttributesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceRoleAttributesBadRequest) Error() string { - return fmt.Sprintf("[GET /service-role-attributes][%d] listServiceRoleAttributesBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceRoleAttributesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceRoleAttributesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceRoleAttributesUnauthorized creates a ListServiceRoleAttributesUnauthorized with default headers values -func NewListServiceRoleAttributesUnauthorized() *ListServiceRoleAttributesUnauthorized { - return &ListServiceRoleAttributesUnauthorized{} -} - -/* ListServiceRoleAttributesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceRoleAttributesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceRoleAttributesUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-role-attributes][%d] listServiceRoleAttributesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceRoleAttributesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceRoleAttributesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/role_attributes/role_attributes_client.go b/rest_management_api_client/role_attributes/role_attributes_client.go deleted file mode 100644 index 817d4f1af..000000000 --- a/rest_management_api_client/role_attributes/role_attributes_client.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new role attributes API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for role attributes API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - ListEdgeRouterRoleAttributes(params *ListEdgeRouterRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterRoleAttributesOK, error) - - ListIdentityRoleAttributes(params *ListIdentityRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityRoleAttributesOK, error) - - ListServiceRoleAttributes(params *ListServiceRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceRoleAttributesOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - ListEdgeRouterRoleAttributes lists role attributes in use by edge routers - - Retrieves a list of role attributes in use by edge routers; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListEdgeRouterRoleAttributes(params *ListEdgeRouterRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterRoleAttributesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListEdgeRouterRoleAttributesParams() - } - op := &runtime.ClientOperation{ - ID: "listEdgeRouterRoleAttributes", - Method: "GET", - PathPattern: "/edge-router-role-attributes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListEdgeRouterRoleAttributesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListEdgeRouterRoleAttributesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listEdgeRouterRoleAttributes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListIdentityRoleAttributes lists role attributes in use by identities - - Retrieves a list of role attributes in use by identities; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListIdentityRoleAttributes(params *ListIdentityRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListIdentityRoleAttributesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListIdentityRoleAttributesParams() - } - op := &runtime.ClientOperation{ - ID: "listIdentityRoleAttributes", - Method: "GET", - PathPattern: "/identity-role-attributes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListIdentityRoleAttributesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListIdentityRoleAttributesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listIdentityRoleAttributes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceRoleAttributes lists role attributes in use by services - - Retrieves a list of role attributes in use by services; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceRoleAttributes(params *ListServiceRoleAttributesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceRoleAttributesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceRoleAttributesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceRoleAttributes", - Method: "GET", - PathPattern: "/service-role-attributes", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceRoleAttributesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceRoleAttributesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceRoleAttributes: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/router/create_router_parameters.go b/rest_management_api_client/router/create_router_parameters.go deleted file mode 100644 index 663106281..000000000 --- a/rest_management_api_client/router/create_router_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateRouterParams creates a new CreateRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateRouterParams() *CreateRouterParams { - return &CreateRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateRouterParamsWithTimeout creates a new CreateRouterParams object -// with the ability to set a timeout on a request. -func NewCreateRouterParamsWithTimeout(timeout time.Duration) *CreateRouterParams { - return &CreateRouterParams{ - timeout: timeout, - } -} - -// NewCreateRouterParamsWithContext creates a new CreateRouterParams object -// with the ability to set a context for a request. -func NewCreateRouterParamsWithContext(ctx context.Context) *CreateRouterParams { - return &CreateRouterParams{ - Context: ctx, - } -} - -// NewCreateRouterParamsWithHTTPClient creates a new CreateRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateRouterParamsWithHTTPClient(client *http.Client) *CreateRouterParams { - return &CreateRouterParams{ - HTTPClient: client, - } -} - -/* CreateRouterParams contains all the parameters to send to the API endpoint - for the create router operation. - - Typically these are written to a http.Request. -*/ -type CreateRouterParams struct { - - /* Router. - - A router to create - */ - Router *rest_model.RouterCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRouterParams) WithDefaults() *CreateRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create router params -func (o *CreateRouterParams) WithTimeout(timeout time.Duration) *CreateRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create router params -func (o *CreateRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create router params -func (o *CreateRouterParams) WithContext(ctx context.Context) *CreateRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create router params -func (o *CreateRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create router params -func (o *CreateRouterParams) WithHTTPClient(client *http.Client) *CreateRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create router params -func (o *CreateRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRouter adds the router to the create router params -func (o *CreateRouterParams) WithRouter(router *rest_model.RouterCreate) *CreateRouterParams { - o.SetRouter(router) - return o -} - -// SetRouter adds the router to the create router params -func (o *CreateRouterParams) SetRouter(router *rest_model.RouterCreate) { - o.Router = router -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Router != nil { - if err := r.SetBodyParam(o.Router); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/create_router_responses.go b/rest_management_api_client/router/create_router_responses.go deleted file mode 100644 index bc9a8e14c..000000000 --- a/rest_management_api_client/router/create_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateRouterReader is a Reader for the CreateRouter structure. -type CreateRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateRouterCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateRouterCreated creates a CreateRouterCreated with default headers values -func NewCreateRouterCreated() *CreateRouterCreated { - return &CreateRouterCreated{} -} - -/* CreateRouterCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateRouterCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateRouterCreated) Error() string { - return fmt.Sprintf("[POST /routers][%d] createRouterCreated %+v", 201, o.Payload) -} -func (o *CreateRouterCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateRouterCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateRouterBadRequest creates a CreateRouterBadRequest with default headers values -func NewCreateRouterBadRequest() *CreateRouterBadRequest { - return &CreateRouterBadRequest{} -} - -/* CreateRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateRouterBadRequest) Error() string { - return fmt.Sprintf("[POST /routers][%d] createRouterBadRequest %+v", 400, o.Payload) -} -func (o *CreateRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateRouterUnauthorized creates a CreateRouterUnauthorized with default headers values -func NewCreateRouterUnauthorized() *CreateRouterUnauthorized { - return &CreateRouterUnauthorized{} -} - -/* CreateRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateRouterUnauthorized) Error() string { - return fmt.Sprintf("[POST /routers][%d] createRouterUnauthorized %+v", 401, o.Payload) -} -func (o *CreateRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/create_transit_router_parameters.go b/rest_management_api_client/router/create_transit_router_parameters.go deleted file mode 100644 index 374254360..000000000 --- a/rest_management_api_client/router/create_transit_router_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateTransitRouterParams creates a new CreateTransitRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateTransitRouterParams() *CreateTransitRouterParams { - return &CreateTransitRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateTransitRouterParamsWithTimeout creates a new CreateTransitRouterParams object -// with the ability to set a timeout on a request. -func NewCreateTransitRouterParamsWithTimeout(timeout time.Duration) *CreateTransitRouterParams { - return &CreateTransitRouterParams{ - timeout: timeout, - } -} - -// NewCreateTransitRouterParamsWithContext creates a new CreateTransitRouterParams object -// with the ability to set a context for a request. -func NewCreateTransitRouterParamsWithContext(ctx context.Context) *CreateTransitRouterParams { - return &CreateTransitRouterParams{ - Context: ctx, - } -} - -// NewCreateTransitRouterParamsWithHTTPClient creates a new CreateTransitRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateTransitRouterParamsWithHTTPClient(client *http.Client) *CreateTransitRouterParams { - return &CreateTransitRouterParams{ - HTTPClient: client, - } -} - -/* CreateTransitRouterParams contains all the parameters to send to the API endpoint - for the create transit router operation. - - Typically these are written to a http.Request. -*/ -type CreateTransitRouterParams struct { - - /* Router. - - A router to create - */ - Router *rest_model.RouterCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTransitRouterParams) WithDefaults() *CreateTransitRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTransitRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create transit router params -func (o *CreateTransitRouterParams) WithTimeout(timeout time.Duration) *CreateTransitRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create transit router params -func (o *CreateTransitRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create transit router params -func (o *CreateTransitRouterParams) WithContext(ctx context.Context) *CreateTransitRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create transit router params -func (o *CreateTransitRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create transit router params -func (o *CreateTransitRouterParams) WithHTTPClient(client *http.Client) *CreateTransitRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create transit router params -func (o *CreateTransitRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithRouter adds the router to the create transit router params -func (o *CreateTransitRouterParams) WithRouter(router *rest_model.RouterCreate) *CreateTransitRouterParams { - o.SetRouter(router) - return o -} - -// SetRouter adds the router to the create transit router params -func (o *CreateTransitRouterParams) SetRouter(router *rest_model.RouterCreate) { - o.Router = router -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Router != nil { - if err := r.SetBodyParam(o.Router); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/create_transit_router_responses.go b/rest_management_api_client/router/create_transit_router_responses.go deleted file mode 100644 index 070734ad4..000000000 --- a/rest_management_api_client/router/create_transit_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateTransitRouterReader is a Reader for the CreateTransitRouter structure. -type CreateTransitRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateTransitRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateTransitRouterCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateTransitRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateTransitRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateTransitRouterCreated creates a CreateTransitRouterCreated with default headers values -func NewCreateTransitRouterCreated() *CreateTransitRouterCreated { - return &CreateTransitRouterCreated{} -} - -/* CreateTransitRouterCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateTransitRouterCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateTransitRouterCreated) Error() string { - return fmt.Sprintf("[POST /transit-routers][%d] createTransitRouterCreated %+v", 201, o.Payload) -} -func (o *CreateTransitRouterCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateTransitRouterCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTransitRouterBadRequest creates a CreateTransitRouterBadRequest with default headers values -func NewCreateTransitRouterBadRequest() *CreateTransitRouterBadRequest { - return &CreateTransitRouterBadRequest{} -} - -/* CreateTransitRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateTransitRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateTransitRouterBadRequest) Error() string { - return fmt.Sprintf("[POST /transit-routers][%d] createTransitRouterBadRequest %+v", 400, o.Payload) -} -func (o *CreateTransitRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateTransitRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTransitRouterUnauthorized creates a CreateTransitRouterUnauthorized with default headers values -func NewCreateTransitRouterUnauthorized() *CreateTransitRouterUnauthorized { - return &CreateTransitRouterUnauthorized{} -} - -/* CreateTransitRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateTransitRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateTransitRouterUnauthorized) Error() string { - return fmt.Sprintf("[POST /transit-routers][%d] createTransitRouterUnauthorized %+v", 401, o.Payload) -} -func (o *CreateTransitRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateTransitRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/delete_router_parameters.go b/rest_management_api_client/router/delete_router_parameters.go deleted file mode 100644 index a098aa341..000000000 --- a/rest_management_api_client/router/delete_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteRouterParams creates a new DeleteRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteRouterParams() *DeleteRouterParams { - return &DeleteRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteRouterParamsWithTimeout creates a new DeleteRouterParams object -// with the ability to set a timeout on a request. -func NewDeleteRouterParamsWithTimeout(timeout time.Duration) *DeleteRouterParams { - return &DeleteRouterParams{ - timeout: timeout, - } -} - -// NewDeleteRouterParamsWithContext creates a new DeleteRouterParams object -// with the ability to set a context for a request. -func NewDeleteRouterParamsWithContext(ctx context.Context) *DeleteRouterParams { - return &DeleteRouterParams{ - Context: ctx, - } -} - -// NewDeleteRouterParamsWithHTTPClient creates a new DeleteRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteRouterParamsWithHTTPClient(client *http.Client) *DeleteRouterParams { - return &DeleteRouterParams{ - HTTPClient: client, - } -} - -/* DeleteRouterParams contains all the parameters to send to the API endpoint - for the delete router operation. - - Typically these are written to a http.Request. -*/ -type DeleteRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteRouterParams) WithDefaults() *DeleteRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete router params -func (o *DeleteRouterParams) WithTimeout(timeout time.Duration) *DeleteRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete router params -func (o *DeleteRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete router params -func (o *DeleteRouterParams) WithContext(ctx context.Context) *DeleteRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete router params -func (o *DeleteRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete router params -func (o *DeleteRouterParams) WithHTTPClient(client *http.Client) *DeleteRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete router params -func (o *DeleteRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete router params -func (o *DeleteRouterParams) WithID(id string) *DeleteRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete router params -func (o *DeleteRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/delete_router_responses.go b/rest_management_api_client/router/delete_router_responses.go deleted file mode 100644 index 540a46aca..000000000 --- a/rest_management_api_client/router/delete_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteRouterReader is a Reader for the DeleteRouter structure. -type DeleteRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteRouterConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteRouterOK creates a DeleteRouterOK with default headers values -func NewDeleteRouterOK() *DeleteRouterOK { - return &DeleteRouterOK{} -} - -/* DeleteRouterOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteRouterOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteRouterOK) Error() string { - return fmt.Sprintf("[DELETE /routers/{id}][%d] deleteRouterOK %+v", 200, o.Payload) -} -func (o *DeleteRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRouterBadRequest creates a DeleteRouterBadRequest with default headers values -func NewDeleteRouterBadRequest() *DeleteRouterBadRequest { - return &DeleteRouterBadRequest{} -} - -/* DeleteRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteRouterBadRequest) Error() string { - return fmt.Sprintf("[DELETE /routers/{id}][%d] deleteRouterBadRequest %+v", 400, o.Payload) -} -func (o *DeleteRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRouterUnauthorized creates a DeleteRouterUnauthorized with default headers values -func NewDeleteRouterUnauthorized() *DeleteRouterUnauthorized { - return &DeleteRouterUnauthorized{} -} - -/* DeleteRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteRouterUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /routers/{id}][%d] deleteRouterUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteRouterConflict creates a DeleteRouterConflict with default headers values -func NewDeleteRouterConflict() *DeleteRouterConflict { - return &DeleteRouterConflict{} -} - -/* DeleteRouterConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteRouterConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteRouterConflict) Error() string { - return fmt.Sprintf("[DELETE /routers/{id}][%d] deleteRouterConflict %+v", 409, o.Payload) -} -func (o *DeleteRouterConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteRouterConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/delete_transit_router_parameters.go b/rest_management_api_client/router/delete_transit_router_parameters.go deleted file mode 100644 index 2b950a46e..000000000 --- a/rest_management_api_client/router/delete_transit_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteTransitRouterParams creates a new DeleteTransitRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteTransitRouterParams() *DeleteTransitRouterParams { - return &DeleteTransitRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteTransitRouterParamsWithTimeout creates a new DeleteTransitRouterParams object -// with the ability to set a timeout on a request. -func NewDeleteTransitRouterParamsWithTimeout(timeout time.Duration) *DeleteTransitRouterParams { - return &DeleteTransitRouterParams{ - timeout: timeout, - } -} - -// NewDeleteTransitRouterParamsWithContext creates a new DeleteTransitRouterParams object -// with the ability to set a context for a request. -func NewDeleteTransitRouterParamsWithContext(ctx context.Context) *DeleteTransitRouterParams { - return &DeleteTransitRouterParams{ - Context: ctx, - } -} - -// NewDeleteTransitRouterParamsWithHTTPClient creates a new DeleteTransitRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteTransitRouterParamsWithHTTPClient(client *http.Client) *DeleteTransitRouterParams { - return &DeleteTransitRouterParams{ - HTTPClient: client, - } -} - -/* DeleteTransitRouterParams contains all the parameters to send to the API endpoint - for the delete transit router operation. - - Typically these are written to a http.Request. -*/ -type DeleteTransitRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteTransitRouterParams) WithDefaults() *DeleteTransitRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteTransitRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete transit router params -func (o *DeleteTransitRouterParams) WithTimeout(timeout time.Duration) *DeleteTransitRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete transit router params -func (o *DeleteTransitRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete transit router params -func (o *DeleteTransitRouterParams) WithContext(ctx context.Context) *DeleteTransitRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete transit router params -func (o *DeleteTransitRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete transit router params -func (o *DeleteTransitRouterParams) WithHTTPClient(client *http.Client) *DeleteTransitRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete transit router params -func (o *DeleteTransitRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete transit router params -func (o *DeleteTransitRouterParams) WithID(id string) *DeleteTransitRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete transit router params -func (o *DeleteTransitRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/delete_transit_router_responses.go b/rest_management_api_client/router/delete_transit_router_responses.go deleted file mode 100644 index f29148062..000000000 --- a/rest_management_api_client/router/delete_transit_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteTransitRouterReader is a Reader for the DeleteTransitRouter structure. -type DeleteTransitRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteTransitRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteTransitRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteTransitRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteTransitRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteTransitRouterConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteTransitRouterOK creates a DeleteTransitRouterOK with default headers values -func NewDeleteTransitRouterOK() *DeleteTransitRouterOK { - return &DeleteTransitRouterOK{} -} - -/* DeleteTransitRouterOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteTransitRouterOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteTransitRouterOK) Error() string { - return fmt.Sprintf("[DELETE /transit-routers/{id}][%d] deleteTransitRouterOK %+v", 200, o.Payload) -} -func (o *DeleteTransitRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteTransitRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteTransitRouterBadRequest creates a DeleteTransitRouterBadRequest with default headers values -func NewDeleteTransitRouterBadRequest() *DeleteTransitRouterBadRequest { - return &DeleteTransitRouterBadRequest{} -} - -/* DeleteTransitRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteTransitRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteTransitRouterBadRequest) Error() string { - return fmt.Sprintf("[DELETE /transit-routers/{id}][%d] deleteTransitRouterBadRequest %+v", 400, o.Payload) -} -func (o *DeleteTransitRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteTransitRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteTransitRouterUnauthorized creates a DeleteTransitRouterUnauthorized with default headers values -func NewDeleteTransitRouterUnauthorized() *DeleteTransitRouterUnauthorized { - return &DeleteTransitRouterUnauthorized{} -} - -/* DeleteTransitRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteTransitRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteTransitRouterUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /transit-routers/{id}][%d] deleteTransitRouterUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteTransitRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteTransitRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteTransitRouterConflict creates a DeleteTransitRouterConflict with default headers values -func NewDeleteTransitRouterConflict() *DeleteTransitRouterConflict { - return &DeleteTransitRouterConflict{} -} - -/* DeleteTransitRouterConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteTransitRouterConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteTransitRouterConflict) Error() string { - return fmt.Sprintf("[DELETE /transit-routers/{id}][%d] deleteTransitRouterConflict %+v", 409, o.Payload) -} -func (o *DeleteTransitRouterConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteTransitRouterConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/detail_router_parameters.go b/rest_management_api_client/router/detail_router_parameters.go deleted file mode 100644 index c37fa36e2..000000000 --- a/rest_management_api_client/router/detail_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailRouterParams creates a new DetailRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailRouterParams() *DetailRouterParams { - return &DetailRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailRouterParamsWithTimeout creates a new DetailRouterParams object -// with the ability to set a timeout on a request. -func NewDetailRouterParamsWithTimeout(timeout time.Duration) *DetailRouterParams { - return &DetailRouterParams{ - timeout: timeout, - } -} - -// NewDetailRouterParamsWithContext creates a new DetailRouterParams object -// with the ability to set a context for a request. -func NewDetailRouterParamsWithContext(ctx context.Context) *DetailRouterParams { - return &DetailRouterParams{ - Context: ctx, - } -} - -// NewDetailRouterParamsWithHTTPClient creates a new DetailRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailRouterParamsWithHTTPClient(client *http.Client) *DetailRouterParams { - return &DetailRouterParams{ - HTTPClient: client, - } -} - -/* DetailRouterParams contains all the parameters to send to the API endpoint - for the detail router operation. - - Typically these are written to a http.Request. -*/ -type DetailRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailRouterParams) WithDefaults() *DetailRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail router params -func (o *DetailRouterParams) WithTimeout(timeout time.Duration) *DetailRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail router params -func (o *DetailRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail router params -func (o *DetailRouterParams) WithContext(ctx context.Context) *DetailRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail router params -func (o *DetailRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail router params -func (o *DetailRouterParams) WithHTTPClient(client *http.Client) *DetailRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail router params -func (o *DetailRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail router params -func (o *DetailRouterParams) WithID(id string) *DetailRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail router params -func (o *DetailRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/detail_router_responses.go b/rest_management_api_client/router/detail_router_responses.go deleted file mode 100644 index e0353ec5e..000000000 --- a/rest_management_api_client/router/detail_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailRouterReader is a Reader for the DetailRouter structure. -type DetailRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailRouterOK creates a DetailRouterOK with default headers values -func NewDetailRouterOK() *DetailRouterOK { - return &DetailRouterOK{} -} - -/* DetailRouterOK describes a response with status code 200, with default header values. - -A single router -*/ -type DetailRouterOK struct { - Payload *rest_model.DetailRouterEnvelope -} - -func (o *DetailRouterOK) Error() string { - return fmt.Sprintf("[GET /routers/{id}][%d] detailRouterOK %+v", 200, o.Payload) -} -func (o *DetailRouterOK) GetPayload() *rest_model.DetailRouterEnvelope { - return o.Payload -} - -func (o *DetailRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailRouterEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailRouterUnauthorized creates a DetailRouterUnauthorized with default headers values -func NewDetailRouterUnauthorized() *DetailRouterUnauthorized { - return &DetailRouterUnauthorized{} -} - -/* DetailRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailRouterUnauthorized) Error() string { - return fmt.Sprintf("[GET /routers/{id}][%d] detailRouterUnauthorized %+v", 401, o.Payload) -} -func (o *DetailRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailRouterNotFound creates a DetailRouterNotFound with default headers values -func NewDetailRouterNotFound() *DetailRouterNotFound { - return &DetailRouterNotFound{} -} - -/* DetailRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailRouterNotFound) Error() string { - return fmt.Sprintf("[GET /routers/{id}][%d] detailRouterNotFound %+v", 404, o.Payload) -} -func (o *DetailRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/detail_transit_router_parameters.go b/rest_management_api_client/router/detail_transit_router_parameters.go deleted file mode 100644 index 5c183039d..000000000 --- a/rest_management_api_client/router/detail_transit_router_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailTransitRouterParams creates a new DetailTransitRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailTransitRouterParams() *DetailTransitRouterParams { - return &DetailTransitRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailTransitRouterParamsWithTimeout creates a new DetailTransitRouterParams object -// with the ability to set a timeout on a request. -func NewDetailTransitRouterParamsWithTimeout(timeout time.Duration) *DetailTransitRouterParams { - return &DetailTransitRouterParams{ - timeout: timeout, - } -} - -// NewDetailTransitRouterParamsWithContext creates a new DetailTransitRouterParams object -// with the ability to set a context for a request. -func NewDetailTransitRouterParamsWithContext(ctx context.Context) *DetailTransitRouterParams { - return &DetailTransitRouterParams{ - Context: ctx, - } -} - -// NewDetailTransitRouterParamsWithHTTPClient creates a new DetailTransitRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailTransitRouterParamsWithHTTPClient(client *http.Client) *DetailTransitRouterParams { - return &DetailTransitRouterParams{ - HTTPClient: client, - } -} - -/* DetailTransitRouterParams contains all the parameters to send to the API endpoint - for the detail transit router operation. - - Typically these are written to a http.Request. -*/ -type DetailTransitRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailTransitRouterParams) WithDefaults() *DetailTransitRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailTransitRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail transit router params -func (o *DetailTransitRouterParams) WithTimeout(timeout time.Duration) *DetailTransitRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail transit router params -func (o *DetailTransitRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail transit router params -func (o *DetailTransitRouterParams) WithContext(ctx context.Context) *DetailTransitRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail transit router params -func (o *DetailTransitRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail transit router params -func (o *DetailTransitRouterParams) WithHTTPClient(client *http.Client) *DetailTransitRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail transit router params -func (o *DetailTransitRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail transit router params -func (o *DetailTransitRouterParams) WithID(id string) *DetailTransitRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail transit router params -func (o *DetailTransitRouterParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/detail_transit_router_responses.go b/rest_management_api_client/router/detail_transit_router_responses.go deleted file mode 100644 index f2a13193b..000000000 --- a/rest_management_api_client/router/detail_transit_router_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailTransitRouterReader is a Reader for the DetailTransitRouter structure. -type DetailTransitRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailTransitRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailTransitRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailTransitRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailTransitRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailTransitRouterOK creates a DetailTransitRouterOK with default headers values -func NewDetailTransitRouterOK() *DetailTransitRouterOK { - return &DetailTransitRouterOK{} -} - -/* DetailTransitRouterOK describes a response with status code 200, with default header values. - -A single router -*/ -type DetailTransitRouterOK struct { - Payload *rest_model.DetailRouterEnvelope -} - -func (o *DetailTransitRouterOK) Error() string { - return fmt.Sprintf("[GET /transit-routers/{id}][%d] detailTransitRouterOK %+v", 200, o.Payload) -} -func (o *DetailTransitRouterOK) GetPayload() *rest_model.DetailRouterEnvelope { - return o.Payload -} - -func (o *DetailTransitRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailRouterEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailTransitRouterUnauthorized creates a DetailTransitRouterUnauthorized with default headers values -func NewDetailTransitRouterUnauthorized() *DetailTransitRouterUnauthorized { - return &DetailTransitRouterUnauthorized{} -} - -/* DetailTransitRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailTransitRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailTransitRouterUnauthorized) Error() string { - return fmt.Sprintf("[GET /transit-routers/{id}][%d] detailTransitRouterUnauthorized %+v", 401, o.Payload) -} -func (o *DetailTransitRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailTransitRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailTransitRouterNotFound creates a DetailTransitRouterNotFound with default headers values -func NewDetailTransitRouterNotFound() *DetailTransitRouterNotFound { - return &DetailTransitRouterNotFound{} -} - -/* DetailTransitRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailTransitRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailTransitRouterNotFound) Error() string { - return fmt.Sprintf("[GET /transit-routers/{id}][%d] detailTransitRouterNotFound %+v", 404, o.Payload) -} -func (o *DetailTransitRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailTransitRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/list_routers_parameters.go b/rest_management_api_client/router/list_routers_parameters.go deleted file mode 100644 index a59ba4fc4..000000000 --- a/rest_management_api_client/router/list_routers_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListRoutersParams creates a new ListRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListRoutersParams() *ListRoutersParams { - return &ListRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListRoutersParamsWithTimeout creates a new ListRoutersParams object -// with the ability to set a timeout on a request. -func NewListRoutersParamsWithTimeout(timeout time.Duration) *ListRoutersParams { - return &ListRoutersParams{ - timeout: timeout, - } -} - -// NewListRoutersParamsWithContext creates a new ListRoutersParams object -// with the ability to set a context for a request. -func NewListRoutersParamsWithContext(ctx context.Context) *ListRoutersParams { - return &ListRoutersParams{ - Context: ctx, - } -} - -// NewListRoutersParamsWithHTTPClient creates a new ListRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListRoutersParamsWithHTTPClient(client *http.Client) *ListRoutersParams { - return &ListRoutersParams{ - HTTPClient: client, - } -} - -/* ListRoutersParams contains all the parameters to send to the API endpoint - for the list routers operation. - - Typically these are written to a http.Request. -*/ -type ListRoutersParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRoutersParams) WithDefaults() *ListRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list routers params -func (o *ListRoutersParams) WithTimeout(timeout time.Duration) *ListRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list routers params -func (o *ListRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list routers params -func (o *ListRoutersParams) WithContext(ctx context.Context) *ListRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list routers params -func (o *ListRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list routers params -func (o *ListRoutersParams) WithHTTPClient(client *http.Client) *ListRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list routers params -func (o *ListRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list routers params -func (o *ListRoutersParams) WithFilter(filter *string) *ListRoutersParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list routers params -func (o *ListRoutersParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list routers params -func (o *ListRoutersParams) WithLimit(limit *int64) *ListRoutersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list routers params -func (o *ListRoutersParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list routers params -func (o *ListRoutersParams) WithOffset(offset *int64) *ListRoutersParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list routers params -func (o *ListRoutersParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/list_routers_responses.go b/rest_management_api_client/router/list_routers_responses.go deleted file mode 100644 index 995386c6f..000000000 --- a/rest_management_api_client/router/list_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListRoutersReader is a Reader for the ListRouters structure. -type ListRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListRoutersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListRoutersOK creates a ListRoutersOK with default headers values -func NewListRoutersOK() *ListRoutersOK { - return &ListRoutersOK{} -} - -/* ListRoutersOK describes a response with status code 200, with default header values. - -A list of specifications -*/ -type ListRoutersOK struct { - Payload *rest_model.ListRoutersEnvelope -} - -func (o *ListRoutersOK) Error() string { - return fmt.Sprintf("[GET /routers][%d] listRoutersOK %+v", 200, o.Payload) -} -func (o *ListRoutersOK) GetPayload() *rest_model.ListRoutersEnvelope { - return o.Payload -} - -func (o *ListRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListRoutersBadRequest creates a ListRoutersBadRequest with default headers values -func NewListRoutersBadRequest() *ListRoutersBadRequest { - return &ListRoutersBadRequest{} -} - -/* ListRoutersBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListRoutersBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListRoutersBadRequest) Error() string { - return fmt.Sprintf("[GET /routers][%d] listRoutersBadRequest %+v", 400, o.Payload) -} -func (o *ListRoutersBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListRoutersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListRoutersUnauthorized creates a ListRoutersUnauthorized with default headers values -func NewListRoutersUnauthorized() *ListRoutersUnauthorized { - return &ListRoutersUnauthorized{} -} - -/* ListRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /routers][%d] listRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/list_transit_routers_parameters.go b/rest_management_api_client/router/list_transit_routers_parameters.go deleted file mode 100644 index 5e4253e90..000000000 --- a/rest_management_api_client/router/list_transit_routers_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListTransitRoutersParams creates a new ListTransitRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListTransitRoutersParams() *ListTransitRoutersParams { - return &ListTransitRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListTransitRoutersParamsWithTimeout creates a new ListTransitRoutersParams object -// with the ability to set a timeout on a request. -func NewListTransitRoutersParamsWithTimeout(timeout time.Duration) *ListTransitRoutersParams { - return &ListTransitRoutersParams{ - timeout: timeout, - } -} - -// NewListTransitRoutersParamsWithContext creates a new ListTransitRoutersParams object -// with the ability to set a context for a request. -func NewListTransitRoutersParamsWithContext(ctx context.Context) *ListTransitRoutersParams { - return &ListTransitRoutersParams{ - Context: ctx, - } -} - -// NewListTransitRoutersParamsWithHTTPClient creates a new ListTransitRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListTransitRoutersParamsWithHTTPClient(client *http.Client) *ListTransitRoutersParams { - return &ListTransitRoutersParams{ - HTTPClient: client, - } -} - -/* ListTransitRoutersParams contains all the parameters to send to the API endpoint - for the list transit routers operation. - - Typically these are written to a http.Request. -*/ -type ListTransitRoutersParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list transit routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTransitRoutersParams) WithDefaults() *ListTransitRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list transit routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTransitRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list transit routers params -func (o *ListTransitRoutersParams) WithTimeout(timeout time.Duration) *ListTransitRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list transit routers params -func (o *ListTransitRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list transit routers params -func (o *ListTransitRoutersParams) WithContext(ctx context.Context) *ListTransitRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list transit routers params -func (o *ListTransitRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list transit routers params -func (o *ListTransitRoutersParams) WithHTTPClient(client *http.Client) *ListTransitRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list transit routers params -func (o *ListTransitRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list transit routers params -func (o *ListTransitRoutersParams) WithFilter(filter *string) *ListTransitRoutersParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list transit routers params -func (o *ListTransitRoutersParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list transit routers params -func (o *ListTransitRoutersParams) WithLimit(limit *int64) *ListTransitRoutersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list transit routers params -func (o *ListTransitRoutersParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list transit routers params -func (o *ListTransitRoutersParams) WithOffset(offset *int64) *ListTransitRoutersParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list transit routers params -func (o *ListTransitRoutersParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListTransitRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/list_transit_routers_responses.go b/rest_management_api_client/router/list_transit_routers_responses.go deleted file mode 100644 index 7b6dd6e7c..000000000 --- a/rest_management_api_client/router/list_transit_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListTransitRoutersReader is a Reader for the ListTransitRouters structure. -type ListTransitRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListTransitRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListTransitRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListTransitRoutersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListTransitRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListTransitRoutersOK creates a ListTransitRoutersOK with default headers values -func NewListTransitRoutersOK() *ListTransitRoutersOK { - return &ListTransitRoutersOK{} -} - -/* ListTransitRoutersOK describes a response with status code 200, with default header values. - -A list of specifications -*/ -type ListTransitRoutersOK struct { - Payload *rest_model.ListRoutersEnvelope -} - -func (o *ListTransitRoutersOK) Error() string { - return fmt.Sprintf("[GET /transit-routers][%d] listTransitRoutersOK %+v", 200, o.Payload) -} -func (o *ListTransitRoutersOK) GetPayload() *rest_model.ListRoutersEnvelope { - return o.Payload -} - -func (o *ListTransitRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListTransitRoutersBadRequest creates a ListTransitRoutersBadRequest with default headers values -func NewListTransitRoutersBadRequest() *ListTransitRoutersBadRequest { - return &ListTransitRoutersBadRequest{} -} - -/* ListTransitRoutersBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListTransitRoutersBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListTransitRoutersBadRequest) Error() string { - return fmt.Sprintf("[GET /transit-routers][%d] listTransitRoutersBadRequest %+v", 400, o.Payload) -} -func (o *ListTransitRoutersBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListTransitRoutersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListTransitRoutersUnauthorized creates a ListTransitRoutersUnauthorized with default headers values -func NewListTransitRoutersUnauthorized() *ListTransitRoutersUnauthorized { - return &ListTransitRoutersUnauthorized{} -} - -/* ListTransitRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListTransitRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListTransitRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /transit-routers][%d] listTransitRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListTransitRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListTransitRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/patch_router_parameters.go b/rest_management_api_client/router/patch_router_parameters.go deleted file mode 100644 index cf3594ef7..000000000 --- a/rest_management_api_client/router/patch_router_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchRouterParams creates a new PatchRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchRouterParams() *PatchRouterParams { - return &PatchRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchRouterParamsWithTimeout creates a new PatchRouterParams object -// with the ability to set a timeout on a request. -func NewPatchRouterParamsWithTimeout(timeout time.Duration) *PatchRouterParams { - return &PatchRouterParams{ - timeout: timeout, - } -} - -// NewPatchRouterParamsWithContext creates a new PatchRouterParams object -// with the ability to set a context for a request. -func NewPatchRouterParamsWithContext(ctx context.Context) *PatchRouterParams { - return &PatchRouterParams{ - Context: ctx, - } -} - -// NewPatchRouterParamsWithHTTPClient creates a new PatchRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchRouterParamsWithHTTPClient(client *http.Client) *PatchRouterParams { - return &PatchRouterParams{ - HTTPClient: client, - } -} - -/* PatchRouterParams contains all the parameters to send to the API endpoint - for the patch router operation. - - Typically these are written to a http.Request. -*/ -type PatchRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Router. - - A router patch object - */ - Router *rest_model.RouterPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchRouterParams) WithDefaults() *PatchRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch router params -func (o *PatchRouterParams) WithTimeout(timeout time.Duration) *PatchRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch router params -func (o *PatchRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch router params -func (o *PatchRouterParams) WithContext(ctx context.Context) *PatchRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch router params -func (o *PatchRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch router params -func (o *PatchRouterParams) WithHTTPClient(client *http.Client) *PatchRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch router params -func (o *PatchRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch router params -func (o *PatchRouterParams) WithID(id string) *PatchRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch router params -func (o *PatchRouterParams) SetID(id string) { - o.ID = id -} - -// WithRouter adds the router to the patch router params -func (o *PatchRouterParams) WithRouter(router *rest_model.RouterPatch) *PatchRouterParams { - o.SetRouter(router) - return o -} - -// SetRouter adds the router to the patch router params -func (o *PatchRouterParams) SetRouter(router *rest_model.RouterPatch) { - o.Router = router -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Router != nil { - if err := r.SetBodyParam(o.Router); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/patch_router_responses.go b/rest_management_api_client/router/patch_router_responses.go deleted file mode 100644 index 9f99192f5..000000000 --- a/rest_management_api_client/router/patch_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchRouterReader is a Reader for the PatchRouter structure. -type PatchRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchRouterOK creates a PatchRouterOK with default headers values -func NewPatchRouterOK() *PatchRouterOK { - return &PatchRouterOK{} -} - -/* PatchRouterOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchRouterOK struct { - Payload *rest_model.Empty -} - -func (o *PatchRouterOK) Error() string { - return fmt.Sprintf("[PATCH /routers/{id}][%d] patchRouterOK %+v", 200, o.Payload) -} -func (o *PatchRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchRouterBadRequest creates a PatchRouterBadRequest with default headers values -func NewPatchRouterBadRequest() *PatchRouterBadRequest { - return &PatchRouterBadRequest{} -} - -/* PatchRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchRouterBadRequest) Error() string { - return fmt.Sprintf("[PATCH /routers/{id}][%d] patchRouterBadRequest %+v", 400, o.Payload) -} -func (o *PatchRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchRouterUnauthorized creates a PatchRouterUnauthorized with default headers values -func NewPatchRouterUnauthorized() *PatchRouterUnauthorized { - return &PatchRouterUnauthorized{} -} - -/* PatchRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchRouterUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /routers/{id}][%d] patchRouterUnauthorized %+v", 401, o.Payload) -} -func (o *PatchRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchRouterNotFound creates a PatchRouterNotFound with default headers values -func NewPatchRouterNotFound() *PatchRouterNotFound { - return &PatchRouterNotFound{} -} - -/* PatchRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchRouterNotFound) Error() string { - return fmt.Sprintf("[PATCH /routers/{id}][%d] patchRouterNotFound %+v", 404, o.Payload) -} -func (o *PatchRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/patch_transit_router_parameters.go b/rest_management_api_client/router/patch_transit_router_parameters.go deleted file mode 100644 index 4755fbc8a..000000000 --- a/rest_management_api_client/router/patch_transit_router_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchTransitRouterParams creates a new PatchTransitRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchTransitRouterParams() *PatchTransitRouterParams { - return &PatchTransitRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchTransitRouterParamsWithTimeout creates a new PatchTransitRouterParams object -// with the ability to set a timeout on a request. -func NewPatchTransitRouterParamsWithTimeout(timeout time.Duration) *PatchTransitRouterParams { - return &PatchTransitRouterParams{ - timeout: timeout, - } -} - -// NewPatchTransitRouterParamsWithContext creates a new PatchTransitRouterParams object -// with the ability to set a context for a request. -func NewPatchTransitRouterParamsWithContext(ctx context.Context) *PatchTransitRouterParams { - return &PatchTransitRouterParams{ - Context: ctx, - } -} - -// NewPatchTransitRouterParamsWithHTTPClient creates a new PatchTransitRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchTransitRouterParamsWithHTTPClient(client *http.Client) *PatchTransitRouterParams { - return &PatchTransitRouterParams{ - HTTPClient: client, - } -} - -/* PatchTransitRouterParams contains all the parameters to send to the API endpoint - for the patch transit router operation. - - Typically these are written to a http.Request. -*/ -type PatchTransitRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Router. - - A router patch object - */ - Router *rest_model.RouterPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchTransitRouterParams) WithDefaults() *PatchTransitRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchTransitRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch transit router params -func (o *PatchTransitRouterParams) WithTimeout(timeout time.Duration) *PatchTransitRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch transit router params -func (o *PatchTransitRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch transit router params -func (o *PatchTransitRouterParams) WithContext(ctx context.Context) *PatchTransitRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch transit router params -func (o *PatchTransitRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch transit router params -func (o *PatchTransitRouterParams) WithHTTPClient(client *http.Client) *PatchTransitRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch transit router params -func (o *PatchTransitRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch transit router params -func (o *PatchTransitRouterParams) WithID(id string) *PatchTransitRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch transit router params -func (o *PatchTransitRouterParams) SetID(id string) { - o.ID = id -} - -// WithRouter adds the router to the patch transit router params -func (o *PatchTransitRouterParams) WithRouter(router *rest_model.RouterPatch) *PatchTransitRouterParams { - o.SetRouter(router) - return o -} - -// SetRouter adds the router to the patch transit router params -func (o *PatchTransitRouterParams) SetRouter(router *rest_model.RouterPatch) { - o.Router = router -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Router != nil { - if err := r.SetBodyParam(o.Router); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/patch_transit_router_responses.go b/rest_management_api_client/router/patch_transit_router_responses.go deleted file mode 100644 index 0c492b0b8..000000000 --- a/rest_management_api_client/router/patch_transit_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchTransitRouterReader is a Reader for the PatchTransitRouter structure. -type PatchTransitRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchTransitRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchTransitRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchTransitRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchTransitRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchTransitRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchTransitRouterOK creates a PatchTransitRouterOK with default headers values -func NewPatchTransitRouterOK() *PatchTransitRouterOK { - return &PatchTransitRouterOK{} -} - -/* PatchTransitRouterOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchTransitRouterOK struct { - Payload *rest_model.Empty -} - -func (o *PatchTransitRouterOK) Error() string { - return fmt.Sprintf("[PATCH /transit-routers/{id}][%d] patchTransitRouterOK %+v", 200, o.Payload) -} -func (o *PatchTransitRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchTransitRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchTransitRouterBadRequest creates a PatchTransitRouterBadRequest with default headers values -func NewPatchTransitRouterBadRequest() *PatchTransitRouterBadRequest { - return &PatchTransitRouterBadRequest{} -} - -/* PatchTransitRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchTransitRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchTransitRouterBadRequest) Error() string { - return fmt.Sprintf("[PATCH /transit-routers/{id}][%d] patchTransitRouterBadRequest %+v", 400, o.Payload) -} -func (o *PatchTransitRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchTransitRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchTransitRouterUnauthorized creates a PatchTransitRouterUnauthorized with default headers values -func NewPatchTransitRouterUnauthorized() *PatchTransitRouterUnauthorized { - return &PatchTransitRouterUnauthorized{} -} - -/* PatchTransitRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchTransitRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchTransitRouterUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /transit-routers/{id}][%d] patchTransitRouterUnauthorized %+v", 401, o.Payload) -} -func (o *PatchTransitRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchTransitRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchTransitRouterNotFound creates a PatchTransitRouterNotFound with default headers values -func NewPatchTransitRouterNotFound() *PatchTransitRouterNotFound { - return &PatchTransitRouterNotFound{} -} - -/* PatchTransitRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchTransitRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchTransitRouterNotFound) Error() string { - return fmt.Sprintf("[PATCH /transit-routers/{id}][%d] patchTransitRouterNotFound %+v", 404, o.Payload) -} -func (o *PatchTransitRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchTransitRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/router_client.go b/rest_management_api_client/router/router_client.go deleted file mode 100644 index 137b1ce76..000000000 --- a/rest_management_api_client/router/router_client.go +++ /dev/null @@ -1,581 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new router API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for router API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateRouter(params *CreateRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRouterCreated, error) - - CreateTransitRouter(params *CreateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTransitRouterCreated, error) - - DeleteRouter(params *DeleteRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRouterOK, error) - - DeleteTransitRouter(params *DeleteTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTransitRouterOK, error) - - DetailRouter(params *DetailRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailRouterOK, error) - - DetailTransitRouter(params *DetailTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailTransitRouterOK, error) - - ListRouters(params *ListRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRoutersOK, error) - - ListTransitRouters(params *ListTransitRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTransitRoutersOK, error) - - PatchRouter(params *PatchRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchRouterOK, error) - - PatchTransitRouter(params *PatchTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchTransitRouterOK, error) - - UpdateRouter(params *UpdateRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRouterOK, error) - - UpdateTransitRouter(params *UpdateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTransitRouterOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateRouter creates a router resource - - Create a router resource. Requires admin access. -*/ -func (a *Client) CreateRouter(params *CreateRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateRouterCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateRouterParams() - } - op := &runtime.ClientOperation{ - ID: "createRouter", - Method: "POST", - PathPattern: "/routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateRouterCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateTransitRouter creates a router resource - - Create a router resource. Requires admin access. -*/ -func (a *Client) CreateTransitRouter(params *CreateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTransitRouterCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateTransitRouterParams() - } - op := &runtime.ClientOperation{ - ID: "createTransitRouter", - Method: "POST", - PathPattern: "/transit-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateTransitRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateTransitRouterCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createTransitRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteRouter deletes a router - - Delete a router by id. Requires admin access. -*/ -func (a *Client) DeleteRouter(params *DeleteRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteRouterParams() - } - op := &runtime.ClientOperation{ - ID: "deleteRouter", - Method: "DELETE", - PathPattern: "/routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteTransitRouter deletes a router - - Delete a router by id. Requires admin access. -*/ -func (a *Client) DeleteTransitRouter(params *DeleteTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteTransitRouterParams() - } - op := &runtime.ClientOperation{ - ID: "deleteTransitRouter", - Method: "DELETE", - PathPattern: "/transit-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteTransitRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteTransitRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteTransitRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailRouter retrieves a single router - - Retrieves a single router by id. Requires admin access. -*/ -func (a *Client) DetailRouter(params *DetailRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailRouterParams() - } - op := &runtime.ClientOperation{ - ID: "detailRouter", - Method: "GET", - PathPattern: "/routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailTransitRouter retrieves a single router - - Retrieves a single router by id. Requires admin access. -*/ -func (a *Client) DetailTransitRouter(params *DetailTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailTransitRouterParams() - } - op := &runtime.ClientOperation{ - ID: "detailTransitRouter", - Method: "GET", - PathPattern: "/transit-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailTransitRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailTransitRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailTransitRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListRouters lists routers - - Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListRouters(params *ListRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listRouters", - Method: "GET", - PathPattern: "/routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListTransitRouters lists routers - - Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListTransitRouters(params *ListTransitRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTransitRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListTransitRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listTransitRouters", - Method: "GET", - PathPattern: "/transit-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListTransitRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListTransitRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listTransitRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchRouter updates the supplied fields on a router - - Update the supplied fields on a router. Requires admin access. -*/ -func (a *Client) PatchRouter(params *PatchRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchRouterParams() - } - op := &runtime.ClientOperation{ - ID: "patchRouter", - Method: "PATCH", - PathPattern: "/routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchTransitRouter updates the supplied fields on a router - - Update the supplied fields on a router. Requires admin access. -*/ -func (a *Client) PatchTransitRouter(params *PatchTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchTransitRouterParams() - } - op := &runtime.ClientOperation{ - ID: "patchTransitRouter", - Method: "PATCH", - PathPattern: "/transit-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchTransitRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchTransitRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchTransitRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateRouter updates all fields on a router - - Update all fields on a router by id. Requires admin access. -*/ -func (a *Client) UpdateRouter(params *UpdateRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateRouterParams() - } - op := &runtime.ClientOperation{ - ID: "updateRouter", - Method: "PUT", - PathPattern: "/routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateTransitRouter updates all fields on a router - - Update all fields on a router by id. Requires admin access. -*/ -func (a *Client) UpdateTransitRouter(params *UpdateTransitRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTransitRouterOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateTransitRouterParams() - } - op := &runtime.ClientOperation{ - ID: "updateTransitRouter", - Method: "PUT", - PathPattern: "/transit-routers/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateTransitRouterReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateTransitRouterOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateTransitRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/router/update_router_parameters.go b/rest_management_api_client/router/update_router_parameters.go deleted file mode 100644 index 81da0b36c..000000000 --- a/rest_management_api_client/router/update_router_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateRouterParams creates a new UpdateRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateRouterParams() *UpdateRouterParams { - return &UpdateRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateRouterParamsWithTimeout creates a new UpdateRouterParams object -// with the ability to set a timeout on a request. -func NewUpdateRouterParamsWithTimeout(timeout time.Duration) *UpdateRouterParams { - return &UpdateRouterParams{ - timeout: timeout, - } -} - -// NewUpdateRouterParamsWithContext creates a new UpdateRouterParams object -// with the ability to set a context for a request. -func NewUpdateRouterParamsWithContext(ctx context.Context) *UpdateRouterParams { - return &UpdateRouterParams{ - Context: ctx, - } -} - -// NewUpdateRouterParamsWithHTTPClient creates a new UpdateRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateRouterParamsWithHTTPClient(client *http.Client) *UpdateRouterParams { - return &UpdateRouterParams{ - HTTPClient: client, - } -} - -/* UpdateRouterParams contains all the parameters to send to the API endpoint - for the update router operation. - - Typically these are written to a http.Request. -*/ -type UpdateRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Router. - - A router update object - */ - Router *rest_model.RouterUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateRouterParams) WithDefaults() *UpdateRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update router params -func (o *UpdateRouterParams) WithTimeout(timeout time.Duration) *UpdateRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update router params -func (o *UpdateRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update router params -func (o *UpdateRouterParams) WithContext(ctx context.Context) *UpdateRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update router params -func (o *UpdateRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update router params -func (o *UpdateRouterParams) WithHTTPClient(client *http.Client) *UpdateRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update router params -func (o *UpdateRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update router params -func (o *UpdateRouterParams) WithID(id string) *UpdateRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update router params -func (o *UpdateRouterParams) SetID(id string) { - o.ID = id -} - -// WithRouter adds the router to the update router params -func (o *UpdateRouterParams) WithRouter(router *rest_model.RouterUpdate) *UpdateRouterParams { - o.SetRouter(router) - return o -} - -// SetRouter adds the router to the update router params -func (o *UpdateRouterParams) SetRouter(router *rest_model.RouterUpdate) { - o.Router = router -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Router != nil { - if err := r.SetBodyParam(o.Router); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/update_router_responses.go b/rest_management_api_client/router/update_router_responses.go deleted file mode 100644 index f15162b47..000000000 --- a/rest_management_api_client/router/update_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateRouterReader is a Reader for the UpdateRouter structure. -type UpdateRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateRouterOK creates a UpdateRouterOK with default headers values -func NewUpdateRouterOK() *UpdateRouterOK { - return &UpdateRouterOK{} -} - -/* UpdateRouterOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateRouterOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateRouterOK) Error() string { - return fmt.Sprintf("[PUT /routers/{id}][%d] updateRouterOK %+v", 200, o.Payload) -} -func (o *UpdateRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRouterBadRequest creates a UpdateRouterBadRequest with default headers values -func NewUpdateRouterBadRequest() *UpdateRouterBadRequest { - return &UpdateRouterBadRequest{} -} - -/* UpdateRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateRouterBadRequest) Error() string { - return fmt.Sprintf("[PUT /routers/{id}][%d] updateRouterBadRequest %+v", 400, o.Payload) -} -func (o *UpdateRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRouterUnauthorized creates a UpdateRouterUnauthorized with default headers values -func NewUpdateRouterUnauthorized() *UpdateRouterUnauthorized { - return &UpdateRouterUnauthorized{} -} - -/* UpdateRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateRouterUnauthorized) Error() string { - return fmt.Sprintf("[PUT /routers/{id}][%d] updateRouterUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateRouterNotFound creates a UpdateRouterNotFound with default headers values -func NewUpdateRouterNotFound() *UpdateRouterNotFound { - return &UpdateRouterNotFound{} -} - -/* UpdateRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateRouterNotFound) Error() string { - return fmt.Sprintf("[PUT /routers/{id}][%d] updateRouterNotFound %+v", 404, o.Payload) -} -func (o *UpdateRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/router/update_transit_router_parameters.go b/rest_management_api_client/router/update_transit_router_parameters.go deleted file mode 100644 index 6daea2029..000000000 --- a/rest_management_api_client/router/update_transit_router_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateTransitRouterParams creates a new UpdateTransitRouterParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateTransitRouterParams() *UpdateTransitRouterParams { - return &UpdateTransitRouterParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateTransitRouterParamsWithTimeout creates a new UpdateTransitRouterParams object -// with the ability to set a timeout on a request. -func NewUpdateTransitRouterParamsWithTimeout(timeout time.Duration) *UpdateTransitRouterParams { - return &UpdateTransitRouterParams{ - timeout: timeout, - } -} - -// NewUpdateTransitRouterParamsWithContext creates a new UpdateTransitRouterParams object -// with the ability to set a context for a request. -func NewUpdateTransitRouterParamsWithContext(ctx context.Context) *UpdateTransitRouterParams { - return &UpdateTransitRouterParams{ - Context: ctx, - } -} - -// NewUpdateTransitRouterParamsWithHTTPClient creates a new UpdateTransitRouterParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateTransitRouterParamsWithHTTPClient(client *http.Client) *UpdateTransitRouterParams { - return &UpdateTransitRouterParams{ - HTTPClient: client, - } -} - -/* UpdateTransitRouterParams contains all the parameters to send to the API endpoint - for the update transit router operation. - - Typically these are written to a http.Request. -*/ -type UpdateTransitRouterParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Router. - - A router update object - */ - Router *rest_model.RouterUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTransitRouterParams) WithDefaults() *UpdateTransitRouterParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update transit router params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTransitRouterParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update transit router params -func (o *UpdateTransitRouterParams) WithTimeout(timeout time.Duration) *UpdateTransitRouterParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update transit router params -func (o *UpdateTransitRouterParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update transit router params -func (o *UpdateTransitRouterParams) WithContext(ctx context.Context) *UpdateTransitRouterParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update transit router params -func (o *UpdateTransitRouterParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update transit router params -func (o *UpdateTransitRouterParams) WithHTTPClient(client *http.Client) *UpdateTransitRouterParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update transit router params -func (o *UpdateTransitRouterParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update transit router params -func (o *UpdateTransitRouterParams) WithID(id string) *UpdateTransitRouterParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update transit router params -func (o *UpdateTransitRouterParams) SetID(id string) { - o.ID = id -} - -// WithRouter adds the router to the update transit router params -func (o *UpdateTransitRouterParams) WithRouter(router *rest_model.RouterUpdate) *UpdateTransitRouterParams { - o.SetRouter(router) - return o -} - -// SetRouter adds the router to the update transit router params -func (o *UpdateTransitRouterParams) SetRouter(router *rest_model.RouterUpdate) { - o.Router = router -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateTransitRouterParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Router != nil { - if err := r.SetBodyParam(o.Router); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/router/update_transit_router_responses.go b/rest_management_api_client/router/update_transit_router_responses.go deleted file mode 100644 index b4c53cd30..000000000 --- a/rest_management_api_client/router/update_transit_router_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateTransitRouterReader is a Reader for the UpdateTransitRouter structure. -type UpdateTransitRouterReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateTransitRouterReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateTransitRouterOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateTransitRouterBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateTransitRouterUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateTransitRouterNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateTransitRouterOK creates a UpdateTransitRouterOK with default headers values -func NewUpdateTransitRouterOK() *UpdateTransitRouterOK { - return &UpdateTransitRouterOK{} -} - -/* UpdateTransitRouterOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateTransitRouterOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateTransitRouterOK) Error() string { - return fmt.Sprintf("[PUT /transit-routers/{id}][%d] updateTransitRouterOK %+v", 200, o.Payload) -} -func (o *UpdateTransitRouterOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateTransitRouterOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTransitRouterBadRequest creates a UpdateTransitRouterBadRequest with default headers values -func NewUpdateTransitRouterBadRequest() *UpdateTransitRouterBadRequest { - return &UpdateTransitRouterBadRequest{} -} - -/* UpdateTransitRouterBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateTransitRouterBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateTransitRouterBadRequest) Error() string { - return fmt.Sprintf("[PUT /transit-routers/{id}][%d] updateTransitRouterBadRequest %+v", 400, o.Payload) -} -func (o *UpdateTransitRouterBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateTransitRouterBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTransitRouterUnauthorized creates a UpdateTransitRouterUnauthorized with default headers values -func NewUpdateTransitRouterUnauthorized() *UpdateTransitRouterUnauthorized { - return &UpdateTransitRouterUnauthorized{} -} - -/* UpdateTransitRouterUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateTransitRouterUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateTransitRouterUnauthorized) Error() string { - return fmt.Sprintf("[PUT /transit-routers/{id}][%d] updateTransitRouterUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateTransitRouterUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateTransitRouterUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTransitRouterNotFound creates a UpdateTransitRouterNotFound with default headers values -func NewUpdateTransitRouterNotFound() *UpdateTransitRouterNotFound { - return &UpdateTransitRouterNotFound{} -} - -/* UpdateTransitRouterNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateTransitRouterNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateTransitRouterNotFound) Error() string { - return fmt.Sprintf("[PUT /transit-routers/{id}][%d] updateTransitRouterNotFound %+v", 404, o.Payload) -} -func (o *UpdateTransitRouterNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateTransitRouterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/create_service_parameters.go b/rest_management_api_client/service/create_service_parameters.go deleted file mode 100644 index da6a57085..000000000 --- a/rest_management_api_client/service/create_service_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateServiceParams creates a new CreateServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateServiceParams() *CreateServiceParams { - return &CreateServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateServiceParamsWithTimeout creates a new CreateServiceParams object -// with the ability to set a timeout on a request. -func NewCreateServiceParamsWithTimeout(timeout time.Duration) *CreateServiceParams { - return &CreateServiceParams{ - timeout: timeout, - } -} - -// NewCreateServiceParamsWithContext creates a new CreateServiceParams object -// with the ability to set a context for a request. -func NewCreateServiceParamsWithContext(ctx context.Context) *CreateServiceParams { - return &CreateServiceParams{ - Context: ctx, - } -} - -// NewCreateServiceParamsWithHTTPClient creates a new CreateServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateServiceParamsWithHTTPClient(client *http.Client) *CreateServiceParams { - return &CreateServiceParams{ - HTTPClient: client, - } -} - -/* CreateServiceParams contains all the parameters to send to the API endpoint - for the create service operation. - - Typically these are written to a http.Request. -*/ -type CreateServiceParams struct { - - /* Service. - - A service to create - */ - Service *rest_model.ServiceCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServiceParams) WithDefaults() *CreateServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create service params -func (o *CreateServiceParams) WithTimeout(timeout time.Duration) *CreateServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create service params -func (o *CreateServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create service params -func (o *CreateServiceParams) WithContext(ctx context.Context) *CreateServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create service params -func (o *CreateServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create service params -func (o *CreateServiceParams) WithHTTPClient(client *http.Client) *CreateServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create service params -func (o *CreateServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithService adds the service to the create service params -func (o *CreateServiceParams) WithService(service *rest_model.ServiceCreate) *CreateServiceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the create service params -func (o *CreateServiceParams) SetService(service *rest_model.ServiceCreate) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Service != nil { - if err := r.SetBodyParam(o.Service); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/create_service_responses.go b/rest_management_api_client/service/create_service_responses.go deleted file mode 100644 index c0cca480f..000000000 --- a/rest_management_api_client/service/create_service_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateServiceReader is a Reader for the CreateService structure. -type CreateServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateServiceCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateServiceCreated creates a CreateServiceCreated with default headers values -func NewCreateServiceCreated() *CreateServiceCreated { - return &CreateServiceCreated{} -} - -/* CreateServiceCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateServiceCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateServiceCreated) Error() string { - return fmt.Sprintf("[POST /services][%d] createServiceCreated %+v", 201, o.Payload) -} -func (o *CreateServiceCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateServiceCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceBadRequest creates a CreateServiceBadRequest with default headers values -func NewCreateServiceBadRequest() *CreateServiceBadRequest { - return &CreateServiceBadRequest{} -} - -/* CreateServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateServiceBadRequest) Error() string { - return fmt.Sprintf("[POST /services][%d] createServiceBadRequest %+v", 400, o.Payload) -} -func (o *CreateServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceUnauthorized creates a CreateServiceUnauthorized with default headers values -func NewCreateServiceUnauthorized() *CreateServiceUnauthorized { - return &CreateServiceUnauthorized{} -} - -/* CreateServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateServiceUnauthorized) Error() string { - return fmt.Sprintf("[POST /services][%d] createServiceUnauthorized %+v", 401, o.Payload) -} -func (o *CreateServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/delete_service_parameters.go b/rest_management_api_client/service/delete_service_parameters.go deleted file mode 100644 index 5eb86ff71..000000000 --- a/rest_management_api_client/service/delete_service_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceParams creates a new DeleteServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteServiceParams() *DeleteServiceParams { - return &DeleteServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteServiceParamsWithTimeout creates a new DeleteServiceParams object -// with the ability to set a timeout on a request. -func NewDeleteServiceParamsWithTimeout(timeout time.Duration) *DeleteServiceParams { - return &DeleteServiceParams{ - timeout: timeout, - } -} - -// NewDeleteServiceParamsWithContext creates a new DeleteServiceParams object -// with the ability to set a context for a request. -func NewDeleteServiceParamsWithContext(ctx context.Context) *DeleteServiceParams { - return &DeleteServiceParams{ - Context: ctx, - } -} - -// NewDeleteServiceParamsWithHTTPClient creates a new DeleteServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteServiceParamsWithHTTPClient(client *http.Client) *DeleteServiceParams { - return &DeleteServiceParams{ - HTTPClient: client, - } -} - -/* DeleteServiceParams contains all the parameters to send to the API endpoint - for the delete service operation. - - Typically these are written to a http.Request. -*/ -type DeleteServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServiceParams) WithDefaults() *DeleteServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete service params -func (o *DeleteServiceParams) WithTimeout(timeout time.Duration) *DeleteServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete service params -func (o *DeleteServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete service params -func (o *DeleteServiceParams) WithContext(ctx context.Context) *DeleteServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete service params -func (o *DeleteServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete service params -func (o *DeleteServiceParams) WithHTTPClient(client *http.Client) *DeleteServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete service params -func (o *DeleteServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete service params -func (o *DeleteServiceParams) WithID(id string) *DeleteServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete service params -func (o *DeleteServiceParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/delete_service_responses.go b/rest_management_api_client/service/delete_service_responses.go deleted file mode 100644 index 400e12b78..000000000 --- a/rest_management_api_client/service/delete_service_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServiceReader is a Reader for the DeleteService structure. -type DeleteServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteServiceConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteServiceOK creates a DeleteServiceOK with default headers values -func NewDeleteServiceOK() *DeleteServiceOK { - return &DeleteServiceOK{} -} - -/* DeleteServiceOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteServiceOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteServiceOK) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceOK %+v", 200, o.Payload) -} -func (o *DeleteServiceOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceBadRequest creates a DeleteServiceBadRequest with default headers values -func NewDeleteServiceBadRequest() *DeleteServiceBadRequest { - return &DeleteServiceBadRequest{} -} - -/* DeleteServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceBadRequest) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceBadRequest %+v", 400, o.Payload) -} -func (o *DeleteServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceUnauthorized creates a DeleteServiceUnauthorized with default headers values -func NewDeleteServiceUnauthorized() *DeleteServiceUnauthorized { - return &DeleteServiceUnauthorized{} -} - -/* DeleteServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceConflict creates a DeleteServiceConflict with default headers values -func NewDeleteServiceConflict() *DeleteServiceConflict { - return &DeleteServiceConflict{} -} - -/* DeleteServiceConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteServiceConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceConflict) Error() string { - return fmt.Sprintf("[DELETE /services/{id}][%d] deleteServiceConflict %+v", 409, o.Payload) -} -func (o *DeleteServiceConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/detail_service_parameters.go b/rest_management_api_client/service/detail_service_parameters.go deleted file mode 100644 index 850a20228..000000000 --- a/rest_management_api_client/service/detail_service_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailServiceParams creates a new DetailServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailServiceParams() *DetailServiceParams { - return &DetailServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailServiceParamsWithTimeout creates a new DetailServiceParams object -// with the ability to set a timeout on a request. -func NewDetailServiceParamsWithTimeout(timeout time.Duration) *DetailServiceParams { - return &DetailServiceParams{ - timeout: timeout, - } -} - -// NewDetailServiceParamsWithContext creates a new DetailServiceParams object -// with the ability to set a context for a request. -func NewDetailServiceParamsWithContext(ctx context.Context) *DetailServiceParams { - return &DetailServiceParams{ - Context: ctx, - } -} - -// NewDetailServiceParamsWithHTTPClient creates a new DetailServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailServiceParamsWithHTTPClient(client *http.Client) *DetailServiceParams { - return &DetailServiceParams{ - HTTPClient: client, - } -} - -/* DetailServiceParams contains all the parameters to send to the API endpoint - for the detail service operation. - - Typically these are written to a http.Request. -*/ -type DetailServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServiceParams) WithDefaults() *DetailServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail service params -func (o *DetailServiceParams) WithTimeout(timeout time.Duration) *DetailServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail service params -func (o *DetailServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail service params -func (o *DetailServiceParams) WithContext(ctx context.Context) *DetailServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail service params -func (o *DetailServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail service params -func (o *DetailServiceParams) WithHTTPClient(client *http.Client) *DetailServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail service params -func (o *DetailServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail service params -func (o *DetailServiceParams) WithID(id string) *DetailServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail service params -func (o *DetailServiceParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/detail_service_responses.go b/rest_management_api_client/service/detail_service_responses.go deleted file mode 100644 index d93778216..000000000 --- a/rest_management_api_client/service/detail_service_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailServiceReader is a Reader for the DetailService structure. -type DetailServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailServiceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailServiceOK creates a DetailServiceOK with default headers values -func NewDetailServiceOK() *DetailServiceOK { - return &DetailServiceOK{} -} - -/* DetailServiceOK describes a response with status code 200, with default header values. - -A single service -*/ -type DetailServiceOK struct { - Payload *rest_model.DetailServiceEnvelope -} - -func (o *DetailServiceOK) Error() string { - return fmt.Sprintf("[GET /services/{id}][%d] detailServiceOK %+v", 200, o.Payload) -} -func (o *DetailServiceOK) GetPayload() *rest_model.DetailServiceEnvelope { - return o.Payload -} - -func (o *DetailServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailServiceEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServiceUnauthorized creates a DetailServiceUnauthorized with default headers values -func NewDetailServiceUnauthorized() *DetailServiceUnauthorized { - return &DetailServiceUnauthorized{} -} - -/* DetailServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServiceUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}][%d] detailServiceUnauthorized %+v", 401, o.Payload) -} -func (o *DetailServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServiceNotFound creates a DetailServiceNotFound with default headers values -func NewDetailServiceNotFound() *DetailServiceNotFound { - return &DetailServiceNotFound{} -} - -/* DetailServiceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailServiceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServiceNotFound) Error() string { - return fmt.Sprintf("[GET /services/{id}][%d] detailServiceNotFound %+v", 404, o.Payload) -} -func (o *DetailServiceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_service_config_parameters.go b/rest_management_api_client/service/list_service_config_parameters.go deleted file mode 100644 index 88c117911..000000000 --- a/rest_management_api_client/service/list_service_config_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceConfigParams creates a new ListServiceConfigParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceConfigParams() *ListServiceConfigParams { - return &ListServiceConfigParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceConfigParamsWithTimeout creates a new ListServiceConfigParams object -// with the ability to set a timeout on a request. -func NewListServiceConfigParamsWithTimeout(timeout time.Duration) *ListServiceConfigParams { - return &ListServiceConfigParams{ - timeout: timeout, - } -} - -// NewListServiceConfigParamsWithContext creates a new ListServiceConfigParams object -// with the ability to set a context for a request. -func NewListServiceConfigParamsWithContext(ctx context.Context) *ListServiceConfigParams { - return &ListServiceConfigParams{ - Context: ctx, - } -} - -// NewListServiceConfigParamsWithHTTPClient creates a new ListServiceConfigParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceConfigParamsWithHTTPClient(client *http.Client) *ListServiceConfigParams { - return &ListServiceConfigParams{ - HTTPClient: client, - } -} - -/* ListServiceConfigParams contains all the parameters to send to the API endpoint - for the list service config operation. - - Typically these are written to a http.Request. -*/ -type ListServiceConfigParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceConfigParams) WithDefaults() *ListServiceConfigParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service config params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceConfigParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service config params -func (o *ListServiceConfigParams) WithTimeout(timeout time.Duration) *ListServiceConfigParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service config params -func (o *ListServiceConfigParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service config params -func (o *ListServiceConfigParams) WithContext(ctx context.Context) *ListServiceConfigParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service config params -func (o *ListServiceConfigParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service config params -func (o *ListServiceConfigParams) WithHTTPClient(client *http.Client) *ListServiceConfigParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service config params -func (o *ListServiceConfigParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service config params -func (o *ListServiceConfigParams) WithFilter(filter *string) *ListServiceConfigParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service config params -func (o *ListServiceConfigParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service config params -func (o *ListServiceConfigParams) WithID(id string) *ListServiceConfigParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service config params -func (o *ListServiceConfigParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service config params -func (o *ListServiceConfigParams) WithLimit(limit *int64) *ListServiceConfigParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service config params -func (o *ListServiceConfigParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service config params -func (o *ListServiceConfigParams) WithOffset(offset *int64) *ListServiceConfigParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service config params -func (o *ListServiceConfigParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceConfigParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/list_service_config_responses.go b/rest_management_api_client/service/list_service_config_responses.go deleted file mode 100644 index 59662e8c8..000000000 --- a/rest_management_api_client/service/list_service_config_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceConfigReader is a Reader for the ListServiceConfig structure. -type ListServiceConfigReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceConfigOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceConfigBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceConfigUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceConfigOK creates a ListServiceConfigOK with default headers values -func NewListServiceConfigOK() *ListServiceConfigOK { - return &ListServiceConfigOK{} -} - -/* ListServiceConfigOK describes a response with status code 200, with default header values. - -A list of configs -*/ -type ListServiceConfigOK struct { - Payload *rest_model.ListConfigsEnvelope -} - -func (o *ListServiceConfigOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/configs][%d] listServiceConfigOK %+v", 200, o.Payload) -} -func (o *ListServiceConfigOK) GetPayload() *rest_model.ListConfigsEnvelope { - return o.Payload -} - -func (o *ListServiceConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListConfigsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceConfigBadRequest creates a ListServiceConfigBadRequest with default headers values -func NewListServiceConfigBadRequest() *ListServiceConfigBadRequest { - return &ListServiceConfigBadRequest{} -} - -/* ListServiceConfigBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceConfigBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceConfigBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/configs][%d] listServiceConfigBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceConfigBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceConfigUnauthorized creates a ListServiceConfigUnauthorized with default headers values -func NewListServiceConfigUnauthorized() *ListServiceConfigUnauthorized { - return &ListServiceConfigUnauthorized{} -} - -/* ListServiceConfigUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceConfigUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceConfigUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/configs][%d] listServiceConfigUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceConfigUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceConfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_service_edge_routers_parameters.go b/rest_management_api_client/service/list_service_edge_routers_parameters.go deleted file mode 100644 index f336134ff..000000000 --- a/rest_management_api_client/service/list_service_edge_routers_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceEdgeRoutersParams creates a new ListServiceEdgeRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceEdgeRoutersParams() *ListServiceEdgeRoutersParams { - return &ListServiceEdgeRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceEdgeRoutersParamsWithTimeout creates a new ListServiceEdgeRoutersParams object -// with the ability to set a timeout on a request. -func NewListServiceEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRoutersParams { - return &ListServiceEdgeRoutersParams{ - timeout: timeout, - } -} - -// NewListServiceEdgeRoutersParamsWithContext creates a new ListServiceEdgeRoutersParams object -// with the ability to set a context for a request. -func NewListServiceEdgeRoutersParamsWithContext(ctx context.Context) *ListServiceEdgeRoutersParams { - return &ListServiceEdgeRoutersParams{ - Context: ctx, - } -} - -// NewListServiceEdgeRoutersParamsWithHTTPClient creates a new ListServiceEdgeRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRoutersParams { - return &ListServiceEdgeRoutersParams{ - HTTPClient: client, - } -} - -/* ListServiceEdgeRoutersParams contains all the parameters to send to the API endpoint - for the list service edge routers operation. - - Typically these are written to a http.Request. -*/ -type ListServiceEdgeRoutersParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRoutersParams) WithDefaults() *ListServiceEdgeRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithTimeout(timeout time.Duration) *ListServiceEdgeRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithContext(ctx context.Context) *ListServiceEdgeRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithHTTPClient(client *http.Client) *ListServiceEdgeRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithFilter(filter *string) *ListServiceEdgeRoutersParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithID(id string) *ListServiceEdgeRoutersParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithLimit(limit *int64) *ListServiceEdgeRoutersParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) WithOffset(offset *int64) *ListServiceEdgeRoutersParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service edge routers params -func (o *ListServiceEdgeRoutersParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/list_service_edge_routers_responses.go b/rest_management_api_client/service/list_service_edge_routers_responses.go deleted file mode 100644 index 230d5c7ea..000000000 --- a/rest_management_api_client/service/list_service_edge_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRoutersReader is a Reader for the ListServiceEdgeRouters structure. -type ListServiceEdgeRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceEdgeRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceEdgeRoutersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceEdgeRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceEdgeRoutersOK creates a ListServiceEdgeRoutersOK with default headers values -func NewListServiceEdgeRoutersOK() *ListServiceEdgeRoutersOK { - return &ListServiceEdgeRoutersOK{} -} - -/* ListServiceEdgeRoutersOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type ListServiceEdgeRoutersOK struct { - Payload *rest_model.ListEdgeRoutersEnvelope -} - -func (o *ListServiceEdgeRoutersOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/edge-routers][%d] listServiceEdgeRoutersOK %+v", 200, o.Payload) -} -func (o *ListServiceEdgeRoutersOK) GetPayload() *rest_model.ListEdgeRoutersEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRoutersBadRequest creates a ListServiceEdgeRoutersBadRequest with default headers values -func NewListServiceEdgeRoutersBadRequest() *ListServiceEdgeRoutersBadRequest { - return &ListServiceEdgeRoutersBadRequest{} -} - -/* ListServiceEdgeRoutersBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceEdgeRoutersBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRoutersBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/edge-routers][%d] listServiceEdgeRoutersBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceEdgeRoutersBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRoutersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRoutersUnauthorized creates a ListServiceEdgeRoutersUnauthorized with default headers values -func NewListServiceEdgeRoutersUnauthorized() *ListServiceEdgeRoutersUnauthorized { - return &ListServiceEdgeRoutersUnauthorized{} -} - -/* ListServiceEdgeRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceEdgeRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/edge-routers][%d] listServiceEdgeRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceEdgeRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_service_identities_parameters.go b/rest_management_api_client/service/list_service_identities_parameters.go deleted file mode 100644 index c3da80825..000000000 --- a/rest_management_api_client/service/list_service_identities_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceIdentitiesParams creates a new ListServiceIdentitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceIdentitiesParams() *ListServiceIdentitiesParams { - return &ListServiceIdentitiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceIdentitiesParamsWithTimeout creates a new ListServiceIdentitiesParams object -// with the ability to set a timeout on a request. -func NewListServiceIdentitiesParamsWithTimeout(timeout time.Duration) *ListServiceIdentitiesParams { - return &ListServiceIdentitiesParams{ - timeout: timeout, - } -} - -// NewListServiceIdentitiesParamsWithContext creates a new ListServiceIdentitiesParams object -// with the ability to set a context for a request. -func NewListServiceIdentitiesParamsWithContext(ctx context.Context) *ListServiceIdentitiesParams { - return &ListServiceIdentitiesParams{ - Context: ctx, - } -} - -// NewListServiceIdentitiesParamsWithHTTPClient creates a new ListServiceIdentitiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceIdentitiesParamsWithHTTPClient(client *http.Client) *ListServiceIdentitiesParams { - return &ListServiceIdentitiesParams{ - HTTPClient: client, - } -} - -/* ListServiceIdentitiesParams contains all the parameters to send to the API endpoint - for the list service identities operation. - - Typically these are written to a http.Request. -*/ -type ListServiceIdentitiesParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceIdentitiesParams) WithDefaults() *ListServiceIdentitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceIdentitiesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service identities params -func (o *ListServiceIdentitiesParams) WithTimeout(timeout time.Duration) *ListServiceIdentitiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service identities params -func (o *ListServiceIdentitiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service identities params -func (o *ListServiceIdentitiesParams) WithContext(ctx context.Context) *ListServiceIdentitiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service identities params -func (o *ListServiceIdentitiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service identities params -func (o *ListServiceIdentitiesParams) WithHTTPClient(client *http.Client) *ListServiceIdentitiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service identities params -func (o *ListServiceIdentitiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service identities params -func (o *ListServiceIdentitiesParams) WithFilter(filter *string) *ListServiceIdentitiesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service identities params -func (o *ListServiceIdentitiesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service identities params -func (o *ListServiceIdentitiesParams) WithID(id string) *ListServiceIdentitiesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service identities params -func (o *ListServiceIdentitiesParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service identities params -func (o *ListServiceIdentitiesParams) WithLimit(limit *int64) *ListServiceIdentitiesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service identities params -func (o *ListServiceIdentitiesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service identities params -func (o *ListServiceIdentitiesParams) WithOffset(offset *int64) *ListServiceIdentitiesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service identities params -func (o *ListServiceIdentitiesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/list_service_identities_responses.go b/rest_management_api_client/service/list_service_identities_responses.go deleted file mode 100644 index 0ed5ad895..000000000 --- a/rest_management_api_client/service/list_service_identities_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceIdentitiesReader is a Reader for the ListServiceIdentities structure. -type ListServiceIdentitiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceIdentitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceIdentitiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceIdentitiesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceIdentitiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceIdentitiesOK creates a ListServiceIdentitiesOK with default headers values -func NewListServiceIdentitiesOK() *ListServiceIdentitiesOK { - return &ListServiceIdentitiesOK{} -} - -/* ListServiceIdentitiesOK describes a response with status code 200, with default header values. - -A list of identities -*/ -type ListServiceIdentitiesOK struct { - Payload *rest_model.ListIdentitiesEnvelope -} - -func (o *ListServiceIdentitiesOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/identities][%d] listServiceIdentitiesOK %+v", 200, o.Payload) -} -func (o *ListServiceIdentitiesOK) GetPayload() *rest_model.ListIdentitiesEnvelope { - return o.Payload -} - -func (o *ListServiceIdentitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListIdentitiesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceIdentitiesBadRequest creates a ListServiceIdentitiesBadRequest with default headers values -func NewListServiceIdentitiesBadRequest() *ListServiceIdentitiesBadRequest { - return &ListServiceIdentitiesBadRequest{} -} - -/* ListServiceIdentitiesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceIdentitiesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceIdentitiesBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/identities][%d] listServiceIdentitiesBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceIdentitiesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceIdentitiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceIdentitiesUnauthorized creates a ListServiceIdentitiesUnauthorized with default headers values -func NewListServiceIdentitiesUnauthorized() *ListServiceIdentitiesUnauthorized { - return &ListServiceIdentitiesUnauthorized{} -} - -/* ListServiceIdentitiesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceIdentitiesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceIdentitiesUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/identities][%d] listServiceIdentitiesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceIdentitiesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceIdentitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_service_service_edge_router_policies_parameters.go b/rest_management_api_client/service/list_service_service_edge_router_policies_parameters.go deleted file mode 100644 index bdde461f5..000000000 --- a/rest_management_api_client/service/list_service_service_edge_router_policies_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceServiceEdgeRouterPoliciesParams creates a new ListServiceServiceEdgeRouterPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceServiceEdgeRouterPoliciesParams() *ListServiceServiceEdgeRouterPoliciesParams { - return &ListServiceServiceEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceServiceEdgeRouterPoliciesParamsWithTimeout creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the ability to set a timeout on a request. -func NewListServiceServiceEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListServiceServiceEdgeRouterPoliciesParams { - return &ListServiceServiceEdgeRouterPoliciesParams{ - timeout: timeout, - } -} - -// NewListServiceServiceEdgeRouterPoliciesParamsWithContext creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the ability to set a context for a request. -func NewListServiceServiceEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListServiceServiceEdgeRouterPoliciesParams { - return &ListServiceServiceEdgeRouterPoliciesParams{ - Context: ctx, - } -} - -// NewListServiceServiceEdgeRouterPoliciesParamsWithHTTPClient creates a new ListServiceServiceEdgeRouterPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceServiceEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListServiceServiceEdgeRouterPoliciesParams { - return &ListServiceServiceEdgeRouterPoliciesParams{ - HTTPClient: client, - } -} - -/* ListServiceServiceEdgeRouterPoliciesParams contains all the parameters to send to the API endpoint - for the list service service edge router policies operation. - - Typically these are written to a http.Request. -*/ -type ListServiceServiceEdgeRouterPoliciesParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service service edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithDefaults() *ListServiceServiceEdgeRouterPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service service edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithTimeout(timeout time.Duration) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithContext(ctx context.Context) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithHTTPClient(client *http.Client) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithFilter(filter *string) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithID(id string) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithLimit(limit *int64) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) WithOffset(offset *int64) *ListServiceServiceEdgeRouterPoliciesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service service edge router policies params -func (o *ListServiceServiceEdgeRouterPoliciesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceServiceEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/list_service_service_edge_router_policies_responses.go b/rest_management_api_client/service/list_service_service_edge_router_policies_responses.go deleted file mode 100644 index 5e28dfa9d..000000000 --- a/rest_management_api_client/service/list_service_service_edge_router_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceServiceEdgeRouterPoliciesReader is a Reader for the ListServiceServiceEdgeRouterPolicies structure. -type ListServiceServiceEdgeRouterPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceServiceEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceServiceEdgeRouterPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceServiceEdgeRouterPoliciesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceServiceEdgeRouterPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceServiceEdgeRouterPoliciesOK creates a ListServiceServiceEdgeRouterPoliciesOK with default headers values -func NewListServiceServiceEdgeRouterPoliciesOK() *ListServiceServiceEdgeRouterPoliciesOK { - return &ListServiceServiceEdgeRouterPoliciesOK{} -} - -/* ListServiceServiceEdgeRouterPoliciesOK describes a response with status code 200, with default header values. - -A list of service edge router policies -*/ -type ListServiceServiceEdgeRouterPoliciesOK struct { - Payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope -} - -func (o *ListServiceServiceEdgeRouterPoliciesOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/service-edge-router-policies][%d] listServiceServiceEdgeRouterPoliciesOK %+v", 200, o.Payload) -} -func (o *ListServiceServiceEdgeRouterPoliciesOK) GetPayload() *rest_model.ListServiceEdgeRouterPoliciesEnvelope { - return o.Payload -} - -func (o *ListServiceServiceEdgeRouterPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServiceEdgeRouterPoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceServiceEdgeRouterPoliciesBadRequest creates a ListServiceServiceEdgeRouterPoliciesBadRequest with default headers values -func NewListServiceServiceEdgeRouterPoliciesBadRequest() *ListServiceServiceEdgeRouterPoliciesBadRequest { - return &ListServiceServiceEdgeRouterPoliciesBadRequest{} -} - -/* ListServiceServiceEdgeRouterPoliciesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceServiceEdgeRouterPoliciesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceServiceEdgeRouterPoliciesBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/service-edge-router-policies][%d] listServiceServiceEdgeRouterPoliciesBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceServiceEdgeRouterPoliciesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceServiceEdgeRouterPoliciesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceServiceEdgeRouterPoliciesUnauthorized creates a ListServiceServiceEdgeRouterPoliciesUnauthorized with default headers values -func NewListServiceServiceEdgeRouterPoliciesUnauthorized() *ListServiceServiceEdgeRouterPoliciesUnauthorized { - return &ListServiceServiceEdgeRouterPoliciesUnauthorized{} -} - -/* ListServiceServiceEdgeRouterPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceServiceEdgeRouterPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceServiceEdgeRouterPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/service-edge-router-policies][%d] listServiceServiceEdgeRouterPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceServiceEdgeRouterPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceServiceEdgeRouterPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_service_service_policies_parameters.go b/rest_management_api_client/service/list_service_service_policies_parameters.go deleted file mode 100644 index 23929a9ff..000000000 --- a/rest_management_api_client/service/list_service_service_policies_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceServicePoliciesParams creates a new ListServiceServicePoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceServicePoliciesParams() *ListServiceServicePoliciesParams { - return &ListServiceServicePoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceServicePoliciesParamsWithTimeout creates a new ListServiceServicePoliciesParams object -// with the ability to set a timeout on a request. -func NewListServiceServicePoliciesParamsWithTimeout(timeout time.Duration) *ListServiceServicePoliciesParams { - return &ListServiceServicePoliciesParams{ - timeout: timeout, - } -} - -// NewListServiceServicePoliciesParamsWithContext creates a new ListServiceServicePoliciesParams object -// with the ability to set a context for a request. -func NewListServiceServicePoliciesParamsWithContext(ctx context.Context) *ListServiceServicePoliciesParams { - return &ListServiceServicePoliciesParams{ - Context: ctx, - } -} - -// NewListServiceServicePoliciesParamsWithHTTPClient creates a new ListServiceServicePoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceServicePoliciesParamsWithHTTPClient(client *http.Client) *ListServiceServicePoliciesParams { - return &ListServiceServicePoliciesParams{ - HTTPClient: client, - } -} - -/* ListServiceServicePoliciesParams contains all the parameters to send to the API endpoint - for the list service service policies operation. - - Typically these are written to a http.Request. -*/ -type ListServiceServicePoliciesParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service service policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceServicePoliciesParams) WithDefaults() *ListServiceServicePoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service service policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceServicePoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithTimeout(timeout time.Duration) *ListServiceServicePoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithContext(ctx context.Context) *ListServiceServicePoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithHTTPClient(client *http.Client) *ListServiceServicePoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithFilter(filter *string) *ListServiceServicePoliciesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithID(id string) *ListServiceServicePoliciesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithLimit(limit *int64) *ListServiceServicePoliciesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service service policies params -func (o *ListServiceServicePoliciesParams) WithOffset(offset *int64) *ListServiceServicePoliciesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service service policies params -func (o *ListServiceServicePoliciesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceServicePoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/list_service_service_policies_responses.go b/rest_management_api_client/service/list_service_service_policies_responses.go deleted file mode 100644 index f7693fdc1..000000000 --- a/rest_management_api_client/service/list_service_service_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceServicePoliciesReader is a Reader for the ListServiceServicePolicies structure. -type ListServiceServicePoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceServicePoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceServicePoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceServicePoliciesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceServicePoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceServicePoliciesOK creates a ListServiceServicePoliciesOK with default headers values -func NewListServiceServicePoliciesOK() *ListServiceServicePoliciesOK { - return &ListServiceServicePoliciesOK{} -} - -/* ListServiceServicePoliciesOK describes a response with status code 200, with default header values. - -A list of service policies -*/ -type ListServiceServicePoliciesOK struct { - Payload *rest_model.ListServicePoliciesEnvelope -} - -func (o *ListServiceServicePoliciesOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/service-policies][%d] listServiceServicePoliciesOK %+v", 200, o.Payload) -} -func (o *ListServiceServicePoliciesOK) GetPayload() *rest_model.ListServicePoliciesEnvelope { - return o.Payload -} - -func (o *ListServiceServicePoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicePoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceServicePoliciesBadRequest creates a ListServiceServicePoliciesBadRequest with default headers values -func NewListServiceServicePoliciesBadRequest() *ListServiceServicePoliciesBadRequest { - return &ListServiceServicePoliciesBadRequest{} -} - -/* ListServiceServicePoliciesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceServicePoliciesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceServicePoliciesBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/service-policies][%d] listServiceServicePoliciesBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceServicePoliciesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceServicePoliciesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceServicePoliciesUnauthorized creates a ListServiceServicePoliciesUnauthorized with default headers values -func NewListServiceServicePoliciesUnauthorized() *ListServiceServicePoliciesUnauthorized { - return &ListServiceServicePoliciesUnauthorized{} -} - -/* ListServiceServicePoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceServicePoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceServicePoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/service-policies][%d] listServiceServicePoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceServicePoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceServicePoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_service_terminators_parameters.go b/rest_management_api_client/service/list_service_terminators_parameters.go deleted file mode 100644 index c6024e506..000000000 --- a/rest_management_api_client/service/list_service_terminators_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceTerminatorsParams creates a new ListServiceTerminatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceTerminatorsParams() *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceTerminatorsParamsWithTimeout creates a new ListServiceTerminatorsParams object -// with the ability to set a timeout on a request. -func NewListServiceTerminatorsParamsWithTimeout(timeout time.Duration) *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - timeout: timeout, - } -} - -// NewListServiceTerminatorsParamsWithContext creates a new ListServiceTerminatorsParams object -// with the ability to set a context for a request. -func NewListServiceTerminatorsParamsWithContext(ctx context.Context) *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - Context: ctx, - } -} - -// NewListServiceTerminatorsParamsWithHTTPClient creates a new ListServiceTerminatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceTerminatorsParamsWithHTTPClient(client *http.Client) *ListServiceTerminatorsParams { - return &ListServiceTerminatorsParams{ - HTTPClient: client, - } -} - -/* ListServiceTerminatorsParams contains all the parameters to send to the API endpoint - for the list service terminators operation. - - Typically these are written to a http.Request. -*/ -type ListServiceTerminatorsParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service terminators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceTerminatorsParams) WithDefaults() *ListServiceTerminatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service terminators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceTerminatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service terminators params -func (o *ListServiceTerminatorsParams) WithTimeout(timeout time.Duration) *ListServiceTerminatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service terminators params -func (o *ListServiceTerminatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service terminators params -func (o *ListServiceTerminatorsParams) WithContext(ctx context.Context) *ListServiceTerminatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service terminators params -func (o *ListServiceTerminatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service terminators params -func (o *ListServiceTerminatorsParams) WithHTTPClient(client *http.Client) *ListServiceTerminatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service terminators params -func (o *ListServiceTerminatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service terminators params -func (o *ListServiceTerminatorsParams) WithFilter(filter *string) *ListServiceTerminatorsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service terminators params -func (o *ListServiceTerminatorsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service terminators params -func (o *ListServiceTerminatorsParams) WithID(id string) *ListServiceTerminatorsParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service terminators params -func (o *ListServiceTerminatorsParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service terminators params -func (o *ListServiceTerminatorsParams) WithLimit(limit *int64) *ListServiceTerminatorsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service terminators params -func (o *ListServiceTerminatorsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service terminators params -func (o *ListServiceTerminatorsParams) WithOffset(offset *int64) *ListServiceTerminatorsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service terminators params -func (o *ListServiceTerminatorsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceTerminatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/list_service_terminators_responses.go b/rest_management_api_client/service/list_service_terminators_responses.go deleted file mode 100644 index 294800848..000000000 --- a/rest_management_api_client/service/list_service_terminators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceTerminatorsReader is a Reader for the ListServiceTerminators structure. -type ListServiceTerminatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceTerminatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceTerminatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceTerminatorsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceTerminatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceTerminatorsOK creates a ListServiceTerminatorsOK with default headers values -func NewListServiceTerminatorsOK() *ListServiceTerminatorsOK { - return &ListServiceTerminatorsOK{} -} - -/* ListServiceTerminatorsOK describes a response with status code 200, with default header values. - -A list of terminators -*/ -type ListServiceTerminatorsOK struct { - Payload *rest_model.ListTerminatorsEnvelope -} - -func (o *ListServiceTerminatorsOK) Error() string { - return fmt.Sprintf("[GET /services/{id}/terminators][%d] listServiceTerminatorsOK %+v", 200, o.Payload) -} -func (o *ListServiceTerminatorsOK) GetPayload() *rest_model.ListTerminatorsEnvelope { - return o.Payload -} - -func (o *ListServiceTerminatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListTerminatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceTerminatorsBadRequest creates a ListServiceTerminatorsBadRequest with default headers values -func NewListServiceTerminatorsBadRequest() *ListServiceTerminatorsBadRequest { - return &ListServiceTerminatorsBadRequest{} -} - -/* ListServiceTerminatorsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceTerminatorsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceTerminatorsBadRequest) Error() string { - return fmt.Sprintf("[GET /services/{id}/terminators][%d] listServiceTerminatorsBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceTerminatorsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceTerminatorsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceTerminatorsUnauthorized creates a ListServiceTerminatorsUnauthorized with default headers values -func NewListServiceTerminatorsUnauthorized() *ListServiceTerminatorsUnauthorized { - return &ListServiceTerminatorsUnauthorized{} -} - -/* ListServiceTerminatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceTerminatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceTerminatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /services/{id}/terminators][%d] listServiceTerminatorsUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceTerminatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceTerminatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/list_services_parameters.go b/rest_management_api_client/service/list_services_parameters.go deleted file mode 100644 index d70f664bf..000000000 --- a/rest_management_api_client/service/list_services_parameters.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicesParams creates a new ListServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServicesParams() *ListServicesParams { - return &ListServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicesParamsWithTimeout creates a new ListServicesParams object -// with the ability to set a timeout on a request. -func NewListServicesParamsWithTimeout(timeout time.Duration) *ListServicesParams { - return &ListServicesParams{ - timeout: timeout, - } -} - -// NewListServicesParamsWithContext creates a new ListServicesParams object -// with the ability to set a context for a request. -func NewListServicesParamsWithContext(ctx context.Context) *ListServicesParams { - return &ListServicesParams{ - Context: ctx, - } -} - -// NewListServicesParamsWithHTTPClient creates a new ListServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicesParamsWithHTTPClient(client *http.Client) *ListServicesParams { - return &ListServicesParams{ - HTTPClient: client, - } -} - -/* ListServicesParams contains all the parameters to send to the API endpoint - for the list services operation. - - Typically these are written to a http.Request. -*/ -type ListServicesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - // RoleFilter. - RoleFilter []string - - // RoleSemantic. - RoleSemantic *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) WithDefaults() *ListServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list services params -func (o *ListServicesParams) WithTimeout(timeout time.Duration) *ListServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list services params -func (o *ListServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list services params -func (o *ListServicesParams) WithContext(ctx context.Context) *ListServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list services params -func (o *ListServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) WithHTTPClient(client *http.Client) *ListServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list services params -func (o *ListServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list services params -func (o *ListServicesParams) WithFilter(filter *string) *ListServicesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list services params -func (o *ListServicesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list services params -func (o *ListServicesParams) WithLimit(limit *int64) *ListServicesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list services params -func (o *ListServicesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list services params -func (o *ListServicesParams) WithOffset(offset *int64) *ListServicesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list services params -func (o *ListServicesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithRoleFilter adds the roleFilter to the list services params -func (o *ListServicesParams) WithRoleFilter(roleFilter []string) *ListServicesParams { - o.SetRoleFilter(roleFilter) - return o -} - -// SetRoleFilter adds the roleFilter to the list services params -func (o *ListServicesParams) SetRoleFilter(roleFilter []string) { - o.RoleFilter = roleFilter -} - -// WithRoleSemantic adds the roleSemantic to the list services params -func (o *ListServicesParams) WithRoleSemantic(roleSemantic *string) *ListServicesParams { - o.SetRoleSemantic(roleSemantic) - return o -} - -// SetRoleSemantic adds the roleSemantic to the list services params -func (o *ListServicesParams) SetRoleSemantic(roleSemantic *string) { - o.RoleSemantic = roleSemantic -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if o.RoleFilter != nil { - - // binding items for roleFilter - joinedRoleFilter := o.bindParamRoleFilter(reg) - - // query array param roleFilter - if err := r.SetQueryParam("roleFilter", joinedRoleFilter...); err != nil { - return err - } - } - - if o.RoleSemantic != nil { - - // query param roleSemantic - var qrRoleSemantic string - - if o.RoleSemantic != nil { - qrRoleSemantic = *o.RoleSemantic - } - qRoleSemantic := qrRoleSemantic - if qRoleSemantic != "" { - - if err := r.SetQueryParam("roleSemantic", qRoleSemantic); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParamListServices binds the parameter roleFilter -func (o *ListServicesParams) bindParamRoleFilter(formats strfmt.Registry) []string { - roleFilterIR := o.RoleFilter - - var roleFilterIC []string - for _, roleFilterIIR := range roleFilterIR { // explode []string - - roleFilterIIV := roleFilterIIR // string as string - roleFilterIC = append(roleFilterIC, roleFilterIIV) - } - - // items.CollectionFormat: "multi" - roleFilterIS := swag.JoinByFormat(roleFilterIC, "multi") - - return roleFilterIS -} diff --git a/rest_management_api_client/service/list_services_responses.go b/rest_management_api_client/service/list_services_responses.go deleted file mode 100644 index 491f48a56..000000000 --- a/rest_management_api_client/service/list_services_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServicesReader is a Reader for the ListServices structure. -type ListServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServicesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServicesOK creates a ListServicesOK with default headers values -func NewListServicesOK() *ListServicesOK { - return &ListServicesOK{} -} - -/* ListServicesOK describes a response with status code 200, with default header values. - -A list of services -*/ -type ListServicesOK struct { - Payload *rest_model.ListServicesEnvelope -} - -func (o *ListServicesOK) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesOK %+v", 200, o.Payload) -} -func (o *ListServicesOK) GetPayload() *rest_model.ListServicesEnvelope { - return o.Payload -} - -func (o *ListServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicesBadRequest creates a ListServicesBadRequest with default headers values -func NewListServicesBadRequest() *ListServicesBadRequest { - return &ListServicesBadRequest{} -} - -/* ListServicesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServicesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicesBadRequest) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesBadRequest %+v", 400, o.Payload) -} -func (o *ListServicesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicesUnauthorized creates a ListServicesUnauthorized with default headers values -func NewListServicesUnauthorized() *ListServicesUnauthorized { - return &ListServicesUnauthorized{} -} - -/* ListServicesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServicesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /services][%d] listServicesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/patch_service_parameters.go b/rest_management_api_client/service/patch_service_parameters.go deleted file mode 100644 index 0a57ec77d..000000000 --- a/rest_management_api_client/service/patch_service_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServiceParams creates a new PatchServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchServiceParams() *PatchServiceParams { - return &PatchServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchServiceParamsWithTimeout creates a new PatchServiceParams object -// with the ability to set a timeout on a request. -func NewPatchServiceParamsWithTimeout(timeout time.Duration) *PatchServiceParams { - return &PatchServiceParams{ - timeout: timeout, - } -} - -// NewPatchServiceParamsWithContext creates a new PatchServiceParams object -// with the ability to set a context for a request. -func NewPatchServiceParamsWithContext(ctx context.Context) *PatchServiceParams { - return &PatchServiceParams{ - Context: ctx, - } -} - -// NewPatchServiceParamsWithHTTPClient creates a new PatchServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchServiceParamsWithHTTPClient(client *http.Client) *PatchServiceParams { - return &PatchServiceParams{ - HTTPClient: client, - } -} - -/* PatchServiceParams contains all the parameters to send to the API endpoint - for the patch service operation. - - Typically these are written to a http.Request. -*/ -type PatchServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Service. - - A service patch object - */ - Service *rest_model.ServicePatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServiceParams) WithDefaults() *PatchServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch service params -func (o *PatchServiceParams) WithTimeout(timeout time.Duration) *PatchServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch service params -func (o *PatchServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch service params -func (o *PatchServiceParams) WithContext(ctx context.Context) *PatchServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch service params -func (o *PatchServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch service params -func (o *PatchServiceParams) WithHTTPClient(client *http.Client) *PatchServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch service params -func (o *PatchServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch service params -func (o *PatchServiceParams) WithID(id string) *PatchServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch service params -func (o *PatchServiceParams) SetID(id string) { - o.ID = id -} - -// WithService adds the service to the patch service params -func (o *PatchServiceParams) WithService(service *rest_model.ServicePatch) *PatchServiceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the patch service params -func (o *PatchServiceParams) SetService(service *rest_model.ServicePatch) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Service != nil { - if err := r.SetBodyParam(o.Service); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/patch_service_responses.go b/rest_management_api_client/service/patch_service_responses.go deleted file mode 100644 index abec63fd2..000000000 --- a/rest_management_api_client/service/patch_service_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchServiceReader is a Reader for the PatchService structure. -type PatchServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchServiceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchServiceOK creates a PatchServiceOK with default headers values -func NewPatchServiceOK() *PatchServiceOK { - return &PatchServiceOK{} -} - -/* PatchServiceOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchServiceOK struct { - Payload *rest_model.Empty -} - -func (o *PatchServiceOK) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceOK %+v", 200, o.Payload) -} -func (o *PatchServiceOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceBadRequest creates a PatchServiceBadRequest with default headers values -func NewPatchServiceBadRequest() *PatchServiceBadRequest { - return &PatchServiceBadRequest{} -} - -/* PatchServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceBadRequest) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceBadRequest %+v", 400, o.Payload) -} -func (o *PatchServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceUnauthorized creates a PatchServiceUnauthorized with default headers values -func NewPatchServiceUnauthorized() *PatchServiceUnauthorized { - return &PatchServiceUnauthorized{} -} - -/* PatchServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceUnauthorized %+v", 401, o.Payload) -} -func (o *PatchServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceNotFound creates a PatchServiceNotFound with default headers values -func NewPatchServiceNotFound() *PatchServiceNotFound { - return &PatchServiceNotFound{} -} - -/* PatchServiceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchServiceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceNotFound) Error() string { - return fmt.Sprintf("[PATCH /services/{id}][%d] patchServiceNotFound %+v", 404, o.Payload) -} -func (o *PatchServiceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service/service_client.go b/rest_management_api_client/service/service_client.go deleted file mode 100644 index 9c5834cd3..000000000 --- a/rest_management_api_client/service/service_client.go +++ /dev/null @@ -1,586 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceCreated, error) - - DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) - - DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceOK, error) - - ListServiceConfig(params *ListServiceConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceConfigOK, error) - - ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRoutersOK, error) - - ListServiceIdentities(params *ListServiceIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceIdentitiesOK, error) - - ListServiceServiceEdgeRouterPolicies(params *ListServiceServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServiceEdgeRouterPoliciesOK, error) - - ListServiceServicePolicies(params *ListServiceServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServicePoliciesOK, error) - - ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceTerminatorsOK, error) - - ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) - - PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceOK, error) - - UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateService creates a services resource - - Create a services resource. Requires admin access. -*/ -func (a *Client) CreateService(params *CreateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateServiceParams() - } - op := &runtime.ClientOperation{ - ID: "createService", - Method: "POST", - PathPattern: "/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateServiceCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteService deletes a service - - Delete a service by id. Requires admin access. -*/ -func (a *Client) DeleteService(params *DeleteServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteServiceParams() - } - op := &runtime.ClientOperation{ - ID: "deleteService", - Method: "DELETE", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailService retrieves a single service - - Retrieves a single service by id. Requires admin access. -*/ -func (a *Client) DetailService(params *DetailServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailServiceParams() - } - op := &runtime.ClientOperation{ - ID: "detailService", - Method: "GET", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceConfig lists configs associated to a specific service - - Retrieves a list of config resources associated to a specific service; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceConfig(params *ListServiceConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceConfigOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceConfigParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceConfig", - Method: "GET", - PathPattern: "/services/{id}/configs", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceConfigReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceConfigOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceEdgeRouters lists accessible edge routers - - Retrieves a list of edge-routers that may be used to access the given service. Supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceEdgeRouters(params *ListServiceEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceEdgeRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceEdgeRouters", - Method: "GET", - PathPattern: "/services/{id}/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceEdgeRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceEdgeRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceIdentities lists identities with access - - Retrieves a list of identities that have access to this service. Supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceIdentities(params *ListServiceIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceIdentitiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceIdentitiesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceIdentities", - Method: "GET", - PathPattern: "/services/{id}/identities", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceIdentitiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceIdentitiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceServiceEdgeRouterPolicies lists service edge router policies that affect a specific service - - Retrieves a list of service edge router policy resources that affect a specific service; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceServiceEdgeRouterPolicies(params *ListServiceServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServiceEdgeRouterPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceServiceEdgeRouterPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceServiceEdgeRouterPolicies", - Method: "GET", - PathPattern: "/services/{id}/service-edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceServiceEdgeRouterPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceServiceEdgeRouterPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceServiceEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceServicePolicies lists service policies that affect a specific service - - Retrieves a list of service policy resources that affect specific service; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceServicePolicies(params *ListServiceServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceServicePoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceServicePoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceServicePolicies", - Method: "GET", - PathPattern: "/services/{id}/service-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceServicePoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceServicePoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceServicePolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceTerminators lists of terminators assigned to a service - - Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. - -*/ -func (a *Client) ListServiceTerminators(params *ListServiceTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceTerminatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceTerminatorsParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceTerminators", - Method: "GET", - PathPattern: "/services/{id}/terminators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceTerminatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceTerminatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceTerminators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServices lists services - - Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServices(params *ListServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicesParams() - } - op := &runtime.ClientOperation{ - ID: "listServices", - Method: "GET", - PathPattern: "/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchService updates the supplied fields on a service - - Update the supplied fields on a service. Requires admin access. -*/ -func (a *Client) PatchService(params *PatchServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchServiceParams() - } - op := &runtime.ClientOperation{ - ID: "patchService", - Method: "PATCH", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateService updates all fields on a service - - Update all fields on a service by id. Requires admin access. -*/ -func (a *Client) UpdateService(params *UpdateServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateServiceParams() - } - op := &runtime.ClientOperation{ - ID: "updateService", - Method: "PUT", - PathPattern: "/services/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateServiceReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateServiceOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateService: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/service/update_service_parameters.go b/rest_management_api_client/service/update_service_parameters.go deleted file mode 100644 index 1f4f628c0..000000000 --- a/rest_management_api_client/service/update_service_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServiceParams creates a new UpdateServiceParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateServiceParams() *UpdateServiceParams { - return &UpdateServiceParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateServiceParamsWithTimeout creates a new UpdateServiceParams object -// with the ability to set a timeout on a request. -func NewUpdateServiceParamsWithTimeout(timeout time.Duration) *UpdateServiceParams { - return &UpdateServiceParams{ - timeout: timeout, - } -} - -// NewUpdateServiceParamsWithContext creates a new UpdateServiceParams object -// with the ability to set a context for a request. -func NewUpdateServiceParamsWithContext(ctx context.Context) *UpdateServiceParams { - return &UpdateServiceParams{ - Context: ctx, - } -} - -// NewUpdateServiceParamsWithHTTPClient creates a new UpdateServiceParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateServiceParamsWithHTTPClient(client *http.Client) *UpdateServiceParams { - return &UpdateServiceParams{ - HTTPClient: client, - } -} - -/* UpdateServiceParams contains all the parameters to send to the API endpoint - for the update service operation. - - Typically these are written to a http.Request. -*/ -type UpdateServiceParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Service. - - A service update object - */ - Service *rest_model.ServiceUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServiceParams) WithDefaults() *UpdateServiceParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update service params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServiceParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update service params -func (o *UpdateServiceParams) WithTimeout(timeout time.Duration) *UpdateServiceParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update service params -func (o *UpdateServiceParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update service params -func (o *UpdateServiceParams) WithContext(ctx context.Context) *UpdateServiceParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update service params -func (o *UpdateServiceParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update service params -func (o *UpdateServiceParams) WithHTTPClient(client *http.Client) *UpdateServiceParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update service params -func (o *UpdateServiceParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update service params -func (o *UpdateServiceParams) WithID(id string) *UpdateServiceParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update service params -func (o *UpdateServiceParams) SetID(id string) { - o.ID = id -} - -// WithService adds the service to the update service params -func (o *UpdateServiceParams) WithService(service *rest_model.ServiceUpdate) *UpdateServiceParams { - o.SetService(service) - return o -} - -// SetService adds the service to the update service params -func (o *UpdateServiceParams) SetService(service *rest_model.ServiceUpdate) { - o.Service = service -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateServiceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Service != nil { - if err := r.SetBodyParam(o.Service); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service/update_service_responses.go b/rest_management_api_client/service/update_service_responses.go deleted file mode 100644 index bee4a5482..000000000 --- a/rest_management_api_client/service/update_service_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServiceReader is a Reader for the UpdateService structure. -type UpdateServiceReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateServiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateServiceOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateServiceBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateServiceUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateServiceNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateServiceOK creates a UpdateServiceOK with default headers values -func NewUpdateServiceOK() *UpdateServiceOK { - return &UpdateServiceOK{} -} - -/* UpdateServiceOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateServiceOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateServiceOK) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceOK %+v", 200, o.Payload) -} -func (o *UpdateServiceOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateServiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceBadRequest creates a UpdateServiceBadRequest with default headers values -func NewUpdateServiceBadRequest() *UpdateServiceBadRequest { - return &UpdateServiceBadRequest{} -} - -/* UpdateServiceBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateServiceBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceBadRequest) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceBadRequest %+v", 400, o.Payload) -} -func (o *UpdateServiceBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceUnauthorized creates a UpdateServiceUnauthorized with default headers values -func NewUpdateServiceUnauthorized() *UpdateServiceUnauthorized { - return &UpdateServiceUnauthorized{} -} - -/* UpdateServiceUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateServiceUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceUnauthorized) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateServiceUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceNotFound creates a UpdateServiceNotFound with default headers values -func NewUpdateServiceNotFound() *UpdateServiceNotFound { - return &UpdateServiceNotFound{} -} - -/* UpdateServiceNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateServiceNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceNotFound) Error() string { - return fmt.Sprintf("[PUT /services/{id}][%d] updateServiceNotFound %+v", 404, o.Payload) -} -func (o *UpdateServiceNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_parameters.go b/rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_parameters.go deleted file mode 100644 index d73b168e9..000000000 --- a/rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateServiceEdgeRouterPolicyParams creates a new CreateServiceEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateServiceEdgeRouterPolicyParams() *CreateServiceEdgeRouterPolicyParams { - return &CreateServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateServiceEdgeRouterPolicyParamsWithTimeout creates a new CreateServiceEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewCreateServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *CreateServiceEdgeRouterPolicyParams { - return &CreateServiceEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewCreateServiceEdgeRouterPolicyParamsWithContext creates a new CreateServiceEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewCreateServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *CreateServiceEdgeRouterPolicyParams { - return &CreateServiceEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewCreateServiceEdgeRouterPolicyParamsWithHTTPClient creates a new CreateServiceEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *CreateServiceEdgeRouterPolicyParams { - return &CreateServiceEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* CreateServiceEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the create service edge router policy operation. - - Typically these are written to a http.Request. -*/ -type CreateServiceEdgeRouterPolicyParams struct { - - /* Policy. - - A service edge router policy to create - */ - Policy *rest_model.ServiceEdgeRouterPolicyCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServiceEdgeRouterPolicyParams) WithDefaults() *CreateServiceEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServiceEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *CreateServiceEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) WithContext(ctx context.Context) *CreateServiceEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *CreateServiceEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPolicy adds the policy to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) WithPolicy(policy *rest_model.ServiceEdgeRouterPolicyCreate) *CreateServiceEdgeRouterPolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the create service edge router policy params -func (o *CreateServiceEdgeRouterPolicyParams) SetPolicy(policy *rest_model.ServiceEdgeRouterPolicyCreate) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_responses.go b/rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_responses.go deleted file mode 100644 index 41b92ca42..000000000 --- a/rest_management_api_client/service_edge_router_policy/create_service_edge_router_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateServiceEdgeRouterPolicyReader is a Reader for the CreateServiceEdgeRouterPolicy structure. -type CreateServiceEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateServiceEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateServiceEdgeRouterPolicyCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateServiceEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateServiceEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateServiceEdgeRouterPolicyCreated creates a CreateServiceEdgeRouterPolicyCreated with default headers values -func NewCreateServiceEdgeRouterPolicyCreated() *CreateServiceEdgeRouterPolicyCreated { - return &CreateServiceEdgeRouterPolicyCreated{} -} - -/* CreateServiceEdgeRouterPolicyCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateServiceEdgeRouterPolicyCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateServiceEdgeRouterPolicyCreated) Error() string { - return fmt.Sprintf("[POST /service-edge-router-policies][%d] createServiceEdgeRouterPolicyCreated %+v", 201, o.Payload) -} -func (o *CreateServiceEdgeRouterPolicyCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateServiceEdgeRouterPolicyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceEdgeRouterPolicyBadRequest creates a CreateServiceEdgeRouterPolicyBadRequest with default headers values -func NewCreateServiceEdgeRouterPolicyBadRequest() *CreateServiceEdgeRouterPolicyBadRequest { - return &CreateServiceEdgeRouterPolicyBadRequest{} -} - -/* CreateServiceEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateServiceEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateServiceEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[POST /service-edge-router-policies][%d] createServiceEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *CreateServiceEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateServiceEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceEdgeRouterPolicyUnauthorized creates a CreateServiceEdgeRouterPolicyUnauthorized with default headers values -func NewCreateServiceEdgeRouterPolicyUnauthorized() *CreateServiceEdgeRouterPolicyUnauthorized { - return &CreateServiceEdgeRouterPolicyUnauthorized{} -} - -/* CreateServiceEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateServiceEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateServiceEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[POST /service-edge-router-policies][%d] createServiceEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *CreateServiceEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateServiceEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_parameters.go b/rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_parameters.go deleted file mode 100644 index 6f8c943ab..000000000 --- a/rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceEdgeRouterPolicyParams creates a new DeleteServiceEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteServiceEdgeRouterPolicyParams() *DeleteServiceEdgeRouterPolicyParams { - return &DeleteServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteServiceEdgeRouterPolicyParamsWithTimeout creates a new DeleteServiceEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewDeleteServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DeleteServiceEdgeRouterPolicyParams { - return &DeleteServiceEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewDeleteServiceEdgeRouterPolicyParamsWithContext creates a new DeleteServiceEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewDeleteServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *DeleteServiceEdgeRouterPolicyParams { - return &DeleteServiceEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewDeleteServiceEdgeRouterPolicyParamsWithHTTPClient creates a new DeleteServiceEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DeleteServiceEdgeRouterPolicyParams { - return &DeleteServiceEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* DeleteServiceEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the delete service edge router policy operation. - - Typically these are written to a http.Request. -*/ -type DeleteServiceEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServiceEdgeRouterPolicyParams) WithDefaults() *DeleteServiceEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServiceEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *DeleteServiceEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) WithContext(ctx context.Context) *DeleteServiceEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *DeleteServiceEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) WithID(id string) *DeleteServiceEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete service edge router policy params -func (o *DeleteServiceEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_responses.go b/rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_responses.go deleted file mode 100644 index e76ece9b9..000000000 --- a/rest_management_api_client/service_edge_router_policy/delete_service_edge_router_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServiceEdgeRouterPolicyReader is a Reader for the DeleteServiceEdgeRouterPolicy structure. -type DeleteServiceEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteServiceEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteServiceEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteServiceEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteServiceEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteServiceEdgeRouterPolicyConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteServiceEdgeRouterPolicyOK creates a DeleteServiceEdgeRouterPolicyOK with default headers values -func NewDeleteServiceEdgeRouterPolicyOK() *DeleteServiceEdgeRouterPolicyOK { - return &DeleteServiceEdgeRouterPolicyOK{} -} - -/* DeleteServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteServiceEdgeRouterPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteServiceEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[DELETE /service-edge-router-policies/{id}][%d] deleteServiceEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *DeleteServiceEdgeRouterPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteServiceEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceEdgeRouterPolicyBadRequest creates a DeleteServiceEdgeRouterPolicyBadRequest with default headers values -func NewDeleteServiceEdgeRouterPolicyBadRequest() *DeleteServiceEdgeRouterPolicyBadRequest { - return &DeleteServiceEdgeRouterPolicyBadRequest{} -} - -/* DeleteServiceEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteServiceEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[DELETE /service-edge-router-policies/{id}][%d] deleteServiceEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *DeleteServiceEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceEdgeRouterPolicyUnauthorized creates a DeleteServiceEdgeRouterPolicyUnauthorized with default headers values -func NewDeleteServiceEdgeRouterPolicyUnauthorized() *DeleteServiceEdgeRouterPolicyUnauthorized { - return &DeleteServiceEdgeRouterPolicyUnauthorized{} -} - -/* DeleteServiceEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteServiceEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /service-edge-router-policies/{id}][%d] deleteServiceEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteServiceEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServiceEdgeRouterPolicyConflict creates a DeleteServiceEdgeRouterPolicyConflict with default headers values -func NewDeleteServiceEdgeRouterPolicyConflict() *DeleteServiceEdgeRouterPolicyConflict { - return &DeleteServiceEdgeRouterPolicyConflict{} -} - -/* DeleteServiceEdgeRouterPolicyConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteServiceEdgeRouterPolicyConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServiceEdgeRouterPolicyConflict) Error() string { - return fmt.Sprintf("[DELETE /service-edge-router-policies/{id}][%d] deleteServiceEdgeRouterPolicyConflict %+v", 409, o.Payload) -} -func (o *DeleteServiceEdgeRouterPolicyConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServiceEdgeRouterPolicyConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_parameters.go b/rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_parameters.go deleted file mode 100644 index 72ff7c247..000000000 --- a/rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailServiceEdgeRouterPolicyParams creates a new DetailServiceEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailServiceEdgeRouterPolicyParams() *DetailServiceEdgeRouterPolicyParams { - return &DetailServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailServiceEdgeRouterPolicyParamsWithTimeout creates a new DetailServiceEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewDetailServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *DetailServiceEdgeRouterPolicyParams { - return &DetailServiceEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewDetailServiceEdgeRouterPolicyParamsWithContext creates a new DetailServiceEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewDetailServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *DetailServiceEdgeRouterPolicyParams { - return &DetailServiceEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewDetailServiceEdgeRouterPolicyParamsWithHTTPClient creates a new DetailServiceEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *DetailServiceEdgeRouterPolicyParams { - return &DetailServiceEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* DetailServiceEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the detail service edge router policy operation. - - Typically these are written to a http.Request. -*/ -type DetailServiceEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServiceEdgeRouterPolicyParams) WithDefaults() *DetailServiceEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServiceEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *DetailServiceEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) WithContext(ctx context.Context) *DetailServiceEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *DetailServiceEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) WithID(id string) *DetailServiceEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail service edge router policy params -func (o *DetailServiceEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_responses.go b/rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_responses.go deleted file mode 100644 index 37714e998..000000000 --- a/rest_management_api_client/service_edge_router_policy/detail_service_edge_router_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailServiceEdgeRouterPolicyReader is a Reader for the DetailServiceEdgeRouterPolicy structure. -type DetailServiceEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailServiceEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailServiceEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailServiceEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailServiceEdgeRouterPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailServiceEdgeRouterPolicyOK creates a DetailServiceEdgeRouterPolicyOK with default headers values -func NewDetailServiceEdgeRouterPolicyOK() *DetailServiceEdgeRouterPolicyOK { - return &DetailServiceEdgeRouterPolicyOK{} -} - -/* DetailServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -A single service edge router policy -*/ -type DetailServiceEdgeRouterPolicyOK struct { - Payload *rest_model.DetailServiceEdgePolicyEnvelope -} - -func (o *DetailServiceEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}][%d] detailServiceEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *DetailServiceEdgeRouterPolicyOK) GetPayload() *rest_model.DetailServiceEdgePolicyEnvelope { - return o.Payload -} - -func (o *DetailServiceEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailServiceEdgePolicyEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServiceEdgeRouterPolicyUnauthorized creates a DetailServiceEdgeRouterPolicyUnauthorized with default headers values -func NewDetailServiceEdgeRouterPolicyUnauthorized() *DetailServiceEdgeRouterPolicyUnauthorized { - return &DetailServiceEdgeRouterPolicyUnauthorized{} -} - -/* DetailServiceEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailServiceEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServiceEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}][%d] detailServiceEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DetailServiceEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServiceEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServiceEdgeRouterPolicyNotFound creates a DetailServiceEdgeRouterPolicyNotFound with default headers values -func NewDetailServiceEdgeRouterPolicyNotFound() *DetailServiceEdgeRouterPolicyNotFound { - return &DetailServiceEdgeRouterPolicyNotFound{} -} - -/* DetailServiceEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailServiceEdgeRouterPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServiceEdgeRouterPolicyNotFound) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}][%d] detailServiceEdgeRouterPolicyNotFound %+v", 404, o.Payload) -} -func (o *DetailServiceEdgeRouterPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServiceEdgeRouterPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_parameters.go b/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_parameters.go deleted file mode 100644 index 40ab462f8..000000000 --- a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceEdgeRouterPoliciesParams creates a new ListServiceEdgeRouterPoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceEdgeRouterPoliciesParams() *ListServiceEdgeRouterPoliciesParams { - return &ListServiceEdgeRouterPoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceEdgeRouterPoliciesParamsWithTimeout creates a new ListServiceEdgeRouterPoliciesParams object -// with the ability to set a timeout on a request. -func NewListServiceEdgeRouterPoliciesParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRouterPoliciesParams { - return &ListServiceEdgeRouterPoliciesParams{ - timeout: timeout, - } -} - -// NewListServiceEdgeRouterPoliciesParamsWithContext creates a new ListServiceEdgeRouterPoliciesParams object -// with the ability to set a context for a request. -func NewListServiceEdgeRouterPoliciesParamsWithContext(ctx context.Context) *ListServiceEdgeRouterPoliciesParams { - return &ListServiceEdgeRouterPoliciesParams{ - Context: ctx, - } -} - -// NewListServiceEdgeRouterPoliciesParamsWithHTTPClient creates a new ListServiceEdgeRouterPoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceEdgeRouterPoliciesParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRouterPoliciesParams { - return &ListServiceEdgeRouterPoliciesParams{ - HTTPClient: client, - } -} - -/* ListServiceEdgeRouterPoliciesParams contains all the parameters to send to the API endpoint - for the list service edge router policies operation. - - Typically these are written to a http.Request. -*/ -type ListServiceEdgeRouterPoliciesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRouterPoliciesParams) WithDefaults() *ListServiceEdgeRouterPoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service edge router policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRouterPoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) WithTimeout(timeout time.Duration) *ListServiceEdgeRouterPoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) WithContext(ctx context.Context) *ListServiceEdgeRouterPoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) WithHTTPClient(client *http.Client) *ListServiceEdgeRouterPoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) WithFilter(filter *string) *ListServiceEdgeRouterPoliciesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) WithLimit(limit *int64) *ListServiceEdgeRouterPoliciesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) WithOffset(offset *int64) *ListServiceEdgeRouterPoliciesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service edge router policies params -func (o *ListServiceEdgeRouterPoliciesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceEdgeRouterPoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_responses.go b/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_responses.go deleted file mode 100644 index 53bc51aa3..000000000 --- a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRouterPoliciesReader is a Reader for the ListServiceEdgeRouterPolicies structure. -type ListServiceEdgeRouterPoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceEdgeRouterPoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceEdgeRouterPoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServiceEdgeRouterPoliciesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServiceEdgeRouterPoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceEdgeRouterPoliciesOK creates a ListServiceEdgeRouterPoliciesOK with default headers values -func NewListServiceEdgeRouterPoliciesOK() *ListServiceEdgeRouterPoliciesOK { - return &ListServiceEdgeRouterPoliciesOK{} -} - -/* ListServiceEdgeRouterPoliciesOK describes a response with status code 200, with default header values. - -A list of service edge router policies -*/ -type ListServiceEdgeRouterPoliciesOK struct { - Payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope -} - -func (o *ListServiceEdgeRouterPoliciesOK) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies][%d] listServiceEdgeRouterPoliciesOK %+v", 200, o.Payload) -} -func (o *ListServiceEdgeRouterPoliciesOK) GetPayload() *rest_model.ListServiceEdgeRouterPoliciesEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServiceEdgeRouterPoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRouterPoliciesBadRequest creates a ListServiceEdgeRouterPoliciesBadRequest with default headers values -func NewListServiceEdgeRouterPoliciesBadRequest() *ListServiceEdgeRouterPoliciesBadRequest { - return &ListServiceEdgeRouterPoliciesBadRequest{} -} - -/* ListServiceEdgeRouterPoliciesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServiceEdgeRouterPoliciesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRouterPoliciesBadRequest) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies][%d] listServiceEdgeRouterPoliciesBadRequest %+v", 400, o.Payload) -} -func (o *ListServiceEdgeRouterPoliciesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPoliciesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRouterPoliciesUnauthorized creates a ListServiceEdgeRouterPoliciesUnauthorized with default headers values -func NewListServiceEdgeRouterPoliciesUnauthorized() *ListServiceEdgeRouterPoliciesUnauthorized { - return &ListServiceEdgeRouterPoliciesUnauthorized{} -} - -/* ListServiceEdgeRouterPoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceEdgeRouterPoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRouterPoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies][%d] listServiceEdgeRouterPoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceEdgeRouterPoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go b/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go deleted file mode 100644 index 3e1a9c813..000000000 --- a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListServiceEdgeRouterPolicyEdgeRoutersParams creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceEdgeRouterPolicyEdgeRoutersParams() *ListServiceEdgeRouterPolicyEdgeRoutersParams { - return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithTimeout creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the ability to set a timeout on a request. -func NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - timeout: timeout, - } -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithContext creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the ability to set a context for a request. -func NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithContext(ctx context.Context) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - Context: ctx, - } -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceEdgeRouterPolicyEdgeRoutersParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - return &ListServiceEdgeRouterPolicyEdgeRoutersParams{ - HTTPClient: client, - } -} - -/* ListServiceEdgeRouterPolicyEdgeRoutersParams contains all the parameters to send to the API endpoint - for the list service edge router policy edge routers operation. - - Typically these are written to a http.Request. -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service edge router policy edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) WithDefaults() *ListServiceEdgeRouterPolicyEdgeRoutersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service edge router policy edge routers params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) WithTimeout(timeout time.Duration) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) WithContext(ctx context.Context) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) WithHTTPClient(client *http.Client) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) WithID(id string) *ListServiceEdgeRouterPolicyEdgeRoutersParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service edge router policy edge routers params -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go b/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go deleted file mode 100644 index 219d7e815..000000000 --- a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRouterPolicyEdgeRoutersReader is a Reader for the ListServiceEdgeRouterPolicyEdgeRouters structure. -type ListServiceEdgeRouterPolicyEdgeRoutersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceEdgeRouterPolicyEdgeRoutersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceEdgeRouterPolicyEdgeRoutersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListServiceEdgeRouterPolicyEdgeRoutersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListServiceEdgeRouterPolicyEdgeRoutersNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersOK creates a ListServiceEdgeRouterPolicyEdgeRoutersOK with default headers values -func NewListServiceEdgeRouterPolicyEdgeRoutersOK() *ListServiceEdgeRouterPolicyEdgeRoutersOK { - return &ListServiceEdgeRouterPolicyEdgeRoutersOK{} -} - -/* ListServiceEdgeRouterPolicyEdgeRoutersOK describes a response with status code 200, with default header values. - -A list of edge routers -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersOK struct { - Payload *rest_model.ListEdgeRoutersEnvelope -} - -func (o *ListServiceEdgeRouterPolicyEdgeRoutersOK) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}/edge-routers][%d] listServiceEdgeRouterPolicyEdgeRoutersOK %+v", 200, o.Payload) -} -func (o *ListServiceEdgeRouterPolicyEdgeRoutersOK) GetPayload() *rest_model.ListEdgeRoutersEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPolicyEdgeRoutersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListEdgeRoutersEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersUnauthorized creates a ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized with default headers values -func NewListServiceEdgeRouterPolicyEdgeRoutersUnauthorized() *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized { - return &ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized{} -} - -/* ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}/edge-routers][%d] listServiceEdgeRouterPolicyEdgeRoutersUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersNotFound creates a ListServiceEdgeRouterPolicyEdgeRoutersNotFound with default headers values -func NewListServiceEdgeRouterPolicyEdgeRoutersNotFound() *ListServiceEdgeRouterPolicyEdgeRoutersNotFound { - return &ListServiceEdgeRouterPolicyEdgeRoutersNotFound{} -} - -/* ListServiceEdgeRouterPolicyEdgeRoutersNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRouterPolicyEdgeRoutersNotFound) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}/edge-routers][%d] listServiceEdgeRouterPolicyEdgeRoutersNotFound %+v", 404, o.Payload) -} -func (o *ListServiceEdgeRouterPolicyEdgeRoutersNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPolicyEdgeRoutersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go b/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go deleted file mode 100644 index f52664fe9..000000000 --- a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListServiceEdgeRouterPolicyServicesParams creates a new ListServiceEdgeRouterPolicyServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServiceEdgeRouterPolicyServicesParams() *ListServiceEdgeRouterPolicyServicesParams { - return &ListServiceEdgeRouterPolicyServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServiceEdgeRouterPolicyServicesParamsWithTimeout creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the ability to set a timeout on a request. -func NewListServiceEdgeRouterPolicyServicesParamsWithTimeout(timeout time.Duration) *ListServiceEdgeRouterPolicyServicesParams { - return &ListServiceEdgeRouterPolicyServicesParams{ - timeout: timeout, - } -} - -// NewListServiceEdgeRouterPolicyServicesParamsWithContext creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the ability to set a context for a request. -func NewListServiceEdgeRouterPolicyServicesParamsWithContext(ctx context.Context) *ListServiceEdgeRouterPolicyServicesParams { - return &ListServiceEdgeRouterPolicyServicesParams{ - Context: ctx, - } -} - -// NewListServiceEdgeRouterPolicyServicesParamsWithHTTPClient creates a new ListServiceEdgeRouterPolicyServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServiceEdgeRouterPolicyServicesParamsWithHTTPClient(client *http.Client) *ListServiceEdgeRouterPolicyServicesParams { - return &ListServiceEdgeRouterPolicyServicesParams{ - HTTPClient: client, - } -} - -/* ListServiceEdgeRouterPolicyServicesParams contains all the parameters to send to the API endpoint - for the list service edge router policy services operation. - - Typically these are written to a http.Request. -*/ -type ListServiceEdgeRouterPolicyServicesParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service edge router policy services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRouterPolicyServicesParams) WithDefaults() *ListServiceEdgeRouterPolicyServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service edge router policy services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServiceEdgeRouterPolicyServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) WithTimeout(timeout time.Duration) *ListServiceEdgeRouterPolicyServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) WithContext(ctx context.Context) *ListServiceEdgeRouterPolicyServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) WithHTTPClient(client *http.Client) *ListServiceEdgeRouterPolicyServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) WithID(id string) *ListServiceEdgeRouterPolicyServicesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service edge router policy services params -func (o *ListServiceEdgeRouterPolicyServicesParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServiceEdgeRouterPolicyServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_responses.go b/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_responses.go deleted file mode 100644 index 69bfd008c..000000000 --- a/rest_management_api_client/service_edge_router_policy/list_service_edge_router_policy_services_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRouterPolicyServicesReader is a Reader for the ListServiceEdgeRouterPolicyServices structure. -type ListServiceEdgeRouterPolicyServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServiceEdgeRouterPolicyServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServiceEdgeRouterPolicyServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListServiceEdgeRouterPolicyServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListServiceEdgeRouterPolicyServicesNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServiceEdgeRouterPolicyServicesOK creates a ListServiceEdgeRouterPolicyServicesOK with default headers values -func NewListServiceEdgeRouterPolicyServicesOK() *ListServiceEdgeRouterPolicyServicesOK { - return &ListServiceEdgeRouterPolicyServicesOK{} -} - -/* ListServiceEdgeRouterPolicyServicesOK describes a response with status code 200, with default header values. - -A list of services -*/ -type ListServiceEdgeRouterPolicyServicesOK struct { - Payload *rest_model.ListServicesEnvelope -} - -func (o *ListServiceEdgeRouterPolicyServicesOK) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}/services][%d] listServiceEdgeRouterPolicyServicesOK %+v", 200, o.Payload) -} -func (o *ListServiceEdgeRouterPolicyServicesOK) GetPayload() *rest_model.ListServicesEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPolicyServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRouterPolicyServicesUnauthorized creates a ListServiceEdgeRouterPolicyServicesUnauthorized with default headers values -func NewListServiceEdgeRouterPolicyServicesUnauthorized() *ListServiceEdgeRouterPolicyServicesUnauthorized { - return &ListServiceEdgeRouterPolicyServicesUnauthorized{} -} - -/* ListServiceEdgeRouterPolicyServicesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServiceEdgeRouterPolicyServicesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRouterPolicyServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}/services][%d] listServiceEdgeRouterPolicyServicesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServiceEdgeRouterPolicyServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPolicyServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServiceEdgeRouterPolicyServicesNotFound creates a ListServiceEdgeRouterPolicyServicesNotFound with default headers values -func NewListServiceEdgeRouterPolicyServicesNotFound() *ListServiceEdgeRouterPolicyServicesNotFound { - return &ListServiceEdgeRouterPolicyServicesNotFound{} -} - -/* ListServiceEdgeRouterPolicyServicesNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type ListServiceEdgeRouterPolicyServicesNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServiceEdgeRouterPolicyServicesNotFound) Error() string { - return fmt.Sprintf("[GET /service-edge-router-policies/{id}/services][%d] listServiceEdgeRouterPolicyServicesNotFound %+v", 404, o.Payload) -} -func (o *ListServiceEdgeRouterPolicyServicesNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServiceEdgeRouterPolicyServicesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_parameters.go b/rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_parameters.go deleted file mode 100644 index 2aeff9a65..000000000 --- a/rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServiceEdgeRouterPolicyParams creates a new PatchServiceEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchServiceEdgeRouterPolicyParams() *PatchServiceEdgeRouterPolicyParams { - return &PatchServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchServiceEdgeRouterPolicyParamsWithTimeout creates a new PatchServiceEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewPatchServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *PatchServiceEdgeRouterPolicyParams { - return &PatchServiceEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewPatchServiceEdgeRouterPolicyParamsWithContext creates a new PatchServiceEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewPatchServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *PatchServiceEdgeRouterPolicyParams { - return &PatchServiceEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewPatchServiceEdgeRouterPolicyParamsWithHTTPClient creates a new PatchServiceEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *PatchServiceEdgeRouterPolicyParams { - return &PatchServiceEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* PatchServiceEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the patch service edge router policy operation. - - Typically these are written to a http.Request. -*/ -type PatchServiceEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Policy. - - A service edge router policy patch object - */ - Policy *rest_model.ServiceEdgeRouterPolicyPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServiceEdgeRouterPolicyParams) WithDefaults() *PatchServiceEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServiceEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *PatchServiceEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) WithContext(ctx context.Context) *PatchServiceEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *PatchServiceEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) WithID(id string) *PatchServiceEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WithPolicy adds the policy to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) WithPolicy(policy *rest_model.ServiceEdgeRouterPolicyPatch) *PatchServiceEdgeRouterPolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the patch service edge router policy params -func (o *PatchServiceEdgeRouterPolicyParams) SetPolicy(policy *rest_model.ServiceEdgeRouterPolicyPatch) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_responses.go b/rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_responses.go deleted file mode 100644 index f49344583..000000000 --- a/rest_management_api_client/service_edge_router_policy/patch_service_edge_router_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchServiceEdgeRouterPolicyReader is a Reader for the PatchServiceEdgeRouterPolicy structure. -type PatchServiceEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchServiceEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchServiceEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchServiceEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchServiceEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchServiceEdgeRouterPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchServiceEdgeRouterPolicyOK creates a PatchServiceEdgeRouterPolicyOK with default headers values -func NewPatchServiceEdgeRouterPolicyOK() *PatchServiceEdgeRouterPolicyOK { - return &PatchServiceEdgeRouterPolicyOK{} -} - -/* PatchServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchServiceEdgeRouterPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *PatchServiceEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[PATCH /service-edge-router-policies/{id}][%d] patchServiceEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *PatchServiceEdgeRouterPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchServiceEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceEdgeRouterPolicyBadRequest creates a PatchServiceEdgeRouterPolicyBadRequest with default headers values -func NewPatchServiceEdgeRouterPolicyBadRequest() *PatchServiceEdgeRouterPolicyBadRequest { - return &PatchServiceEdgeRouterPolicyBadRequest{} -} - -/* PatchServiceEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchServiceEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[PATCH /service-edge-router-policies/{id}][%d] patchServiceEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *PatchServiceEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceEdgeRouterPolicyUnauthorized creates a PatchServiceEdgeRouterPolicyUnauthorized with default headers values -func NewPatchServiceEdgeRouterPolicyUnauthorized() *PatchServiceEdgeRouterPolicyUnauthorized { - return &PatchServiceEdgeRouterPolicyUnauthorized{} -} - -/* PatchServiceEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchServiceEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /service-edge-router-policies/{id}][%d] patchServiceEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *PatchServiceEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServiceEdgeRouterPolicyNotFound creates a PatchServiceEdgeRouterPolicyNotFound with default headers values -func NewPatchServiceEdgeRouterPolicyNotFound() *PatchServiceEdgeRouterPolicyNotFound { - return &PatchServiceEdgeRouterPolicyNotFound{} -} - -/* PatchServiceEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchServiceEdgeRouterPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServiceEdgeRouterPolicyNotFound) Error() string { - return fmt.Sprintf("[PATCH /service-edge-router-policies/{id}][%d] patchServiceEdgeRouterPolicyNotFound %+v", 404, o.Payload) -} -func (o *PatchServiceEdgeRouterPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServiceEdgeRouterPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/service_edge_router_policy_client.go b/rest_management_api_client/service_edge_router_policy/service_edge_router_policy_client.go deleted file mode 100644 index 9d5a88c89..000000000 --- a/rest_management_api_client/service_edge_router_policy/service_edge_router_policy_client.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service edge router policy API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service edge router policy API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceEdgeRouterPolicyCreated, error) - - DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceEdgeRouterPolicyOK, error) - - DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceEdgeRouterPolicyOK, error) - - ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPoliciesOK, error) - - ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyEdgeRoutersOK, error) - - ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRouterPolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyServicesOK, error) - - PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceEdgeRouterPolicyOK, error) - - UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceEdgeRouterPolicyOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateServiceEdgeRouterPolicy creates a service edge router policy resource - - Create a service edge router policy resource. Requires admin access. -*/ -func (a *Client) CreateServiceEdgeRouterPolicy(params *CreateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServiceEdgeRouterPolicyCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateServiceEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "createServiceEdgeRouterPolicy", - Method: "POST", - PathPattern: "/service-edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateServiceEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateServiceEdgeRouterPolicyCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createServiceEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteServiceEdgeRouterPolicy deletes a service edge policy - - Delete a service edge policy by id. Requires admin access. -*/ -func (a *Client) DeleteServiceEdgeRouterPolicy(params *DeleteServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServiceEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteServiceEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "deleteServiceEdgeRouterPolicy", - Method: "DELETE", - PathPattern: "/service-edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteServiceEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteServiceEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteServiceEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailServiceEdgeRouterPolicy retrieves a single service edge policy - - Retrieves a single service edge policy by id. Requires admin access. -*/ -func (a *Client) DetailServiceEdgeRouterPolicy(params *DetailServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServiceEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailServiceEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "detailServiceEdgeRouterPolicy", - Method: "GET", - PathPattern: "/service-edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailServiceEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailServiceEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailServiceEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceEdgeRouterPolicies lists service edge router policies - - Retrieves a list of service edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServiceEdgeRouterPolicies(params *ListServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceEdgeRouterPoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceEdgeRouterPolicies", - Method: "GET", - PathPattern: "/service-edge-router-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceEdgeRouterPoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceEdgeRouterPoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceEdgeRouterPolicyEdgeRouters lists the edge routers that a service edge router policy applies to - - List the edge routers that a service edge router policy applies to -*/ -func (a *Client) ListServiceEdgeRouterPolicyEdgeRouters(params *ListServiceEdgeRouterPolicyEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyEdgeRoutersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceEdgeRouterPolicyEdgeRoutersParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceEdgeRouterPolicyEdgeRouters", - Method: "GET", - PathPattern: "/service-edge-router-policies/{id}/edge-routers", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceEdgeRouterPolicyEdgeRoutersReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceEdgeRouterPolicyEdgeRoutersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceEdgeRouterPolicyEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServiceEdgeRouterPolicyServices lists the services that a service edge router policy applies to - - List the services that a service edge router policy applies to -*/ -func (a *Client) ListServiceEdgeRouterPolicyServices(params *ListServiceEdgeRouterPolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServiceEdgeRouterPolicyServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServiceEdgeRouterPolicyServicesParams() - } - op := &runtime.ClientOperation{ - ID: "listServiceEdgeRouterPolicyServices", - Method: "GET", - PathPattern: "/service-edge-router-policies/{id}/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServiceEdgeRouterPolicyServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServiceEdgeRouterPolicyServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServiceEdgeRouterPolicyServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchServiceEdgeRouterPolicy updates the supplied fields on a service edge policy - - Update the supplied fields on a service edge policy. Requires admin access. -*/ -func (a *Client) PatchServiceEdgeRouterPolicy(params *PatchServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServiceEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchServiceEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "patchServiceEdgeRouterPolicy", - Method: "PATCH", - PathPattern: "/service-edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchServiceEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchServiceEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchServiceEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateServiceEdgeRouterPolicy updates all fields on a service edge policy - - Update all fields on a service edge policy by id. Requires admin access. -*/ -func (a *Client) UpdateServiceEdgeRouterPolicy(params *UpdateServiceEdgeRouterPolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServiceEdgeRouterPolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateServiceEdgeRouterPolicyParams() - } - op := &runtime.ClientOperation{ - ID: "updateServiceEdgeRouterPolicy", - Method: "PUT", - PathPattern: "/service-edge-router-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateServiceEdgeRouterPolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateServiceEdgeRouterPolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateServiceEdgeRouterPolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_parameters.go b/rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_parameters.go deleted file mode 100644 index 7730e40ad..000000000 --- a/rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServiceEdgeRouterPolicyParams creates a new UpdateServiceEdgeRouterPolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateServiceEdgeRouterPolicyParams() *UpdateServiceEdgeRouterPolicyParams { - return &UpdateServiceEdgeRouterPolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateServiceEdgeRouterPolicyParamsWithTimeout creates a new UpdateServiceEdgeRouterPolicyParams object -// with the ability to set a timeout on a request. -func NewUpdateServiceEdgeRouterPolicyParamsWithTimeout(timeout time.Duration) *UpdateServiceEdgeRouterPolicyParams { - return &UpdateServiceEdgeRouterPolicyParams{ - timeout: timeout, - } -} - -// NewUpdateServiceEdgeRouterPolicyParamsWithContext creates a new UpdateServiceEdgeRouterPolicyParams object -// with the ability to set a context for a request. -func NewUpdateServiceEdgeRouterPolicyParamsWithContext(ctx context.Context) *UpdateServiceEdgeRouterPolicyParams { - return &UpdateServiceEdgeRouterPolicyParams{ - Context: ctx, - } -} - -// NewUpdateServiceEdgeRouterPolicyParamsWithHTTPClient creates a new UpdateServiceEdgeRouterPolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateServiceEdgeRouterPolicyParamsWithHTTPClient(client *http.Client) *UpdateServiceEdgeRouterPolicyParams { - return &UpdateServiceEdgeRouterPolicyParams{ - HTTPClient: client, - } -} - -/* UpdateServiceEdgeRouterPolicyParams contains all the parameters to send to the API endpoint - for the update service edge router policy operation. - - Typically these are written to a http.Request. -*/ -type UpdateServiceEdgeRouterPolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Policy. - - A service edge router policy update object - */ - Policy *rest_model.ServiceEdgeRouterPolicyUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServiceEdgeRouterPolicyParams) WithDefaults() *UpdateServiceEdgeRouterPolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update service edge router policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServiceEdgeRouterPolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) WithTimeout(timeout time.Duration) *UpdateServiceEdgeRouterPolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) WithContext(ctx context.Context) *UpdateServiceEdgeRouterPolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) WithHTTPClient(client *http.Client) *UpdateServiceEdgeRouterPolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) WithID(id string) *UpdateServiceEdgeRouterPolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) SetID(id string) { - o.ID = id -} - -// WithPolicy adds the policy to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) WithPolicy(policy *rest_model.ServiceEdgeRouterPolicyUpdate) *UpdateServiceEdgeRouterPolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the update service edge router policy params -func (o *UpdateServiceEdgeRouterPolicyParams) SetPolicy(policy *rest_model.ServiceEdgeRouterPolicyUpdate) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateServiceEdgeRouterPolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_responses.go b/rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_responses.go deleted file mode 100644 index d8591e8d2..000000000 --- a/rest_management_api_client/service_edge_router_policy/update_service_edge_router_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServiceEdgeRouterPolicyReader is a Reader for the UpdateServiceEdgeRouterPolicy structure. -type UpdateServiceEdgeRouterPolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateServiceEdgeRouterPolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateServiceEdgeRouterPolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateServiceEdgeRouterPolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateServiceEdgeRouterPolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateServiceEdgeRouterPolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateServiceEdgeRouterPolicyOK creates a UpdateServiceEdgeRouterPolicyOK with default headers values -func NewUpdateServiceEdgeRouterPolicyOK() *UpdateServiceEdgeRouterPolicyOK { - return &UpdateServiceEdgeRouterPolicyOK{} -} - -/* UpdateServiceEdgeRouterPolicyOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateServiceEdgeRouterPolicyOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateServiceEdgeRouterPolicyOK) Error() string { - return fmt.Sprintf("[PUT /service-edge-router-policies/{id}][%d] updateServiceEdgeRouterPolicyOK %+v", 200, o.Payload) -} -func (o *UpdateServiceEdgeRouterPolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateServiceEdgeRouterPolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceEdgeRouterPolicyBadRequest creates a UpdateServiceEdgeRouterPolicyBadRequest with default headers values -func NewUpdateServiceEdgeRouterPolicyBadRequest() *UpdateServiceEdgeRouterPolicyBadRequest { - return &UpdateServiceEdgeRouterPolicyBadRequest{} -} - -/* UpdateServiceEdgeRouterPolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateServiceEdgeRouterPolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceEdgeRouterPolicyBadRequest) Error() string { - return fmt.Sprintf("[PUT /service-edge-router-policies/{id}][%d] updateServiceEdgeRouterPolicyBadRequest %+v", 400, o.Payload) -} -func (o *UpdateServiceEdgeRouterPolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceEdgeRouterPolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceEdgeRouterPolicyUnauthorized creates a UpdateServiceEdgeRouterPolicyUnauthorized with default headers values -func NewUpdateServiceEdgeRouterPolicyUnauthorized() *UpdateServiceEdgeRouterPolicyUnauthorized { - return &UpdateServiceEdgeRouterPolicyUnauthorized{} -} - -/* UpdateServiceEdgeRouterPolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateServiceEdgeRouterPolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceEdgeRouterPolicyUnauthorized) Error() string { - return fmt.Sprintf("[PUT /service-edge-router-policies/{id}][%d] updateServiceEdgeRouterPolicyUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateServiceEdgeRouterPolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceEdgeRouterPolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServiceEdgeRouterPolicyNotFound creates a UpdateServiceEdgeRouterPolicyNotFound with default headers values -func NewUpdateServiceEdgeRouterPolicyNotFound() *UpdateServiceEdgeRouterPolicyNotFound { - return &UpdateServiceEdgeRouterPolicyNotFound{} -} - -/* UpdateServiceEdgeRouterPolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateServiceEdgeRouterPolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServiceEdgeRouterPolicyNotFound) Error() string { - return fmt.Sprintf("[PUT /service-edge-router-policies/{id}][%d] updateServiceEdgeRouterPolicyNotFound %+v", 404, o.Payload) -} -func (o *UpdateServiceEdgeRouterPolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServiceEdgeRouterPolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/create_service_policy_parameters.go b/rest_management_api_client/service_policy/create_service_policy_parameters.go deleted file mode 100644 index 2e6db0738..000000000 --- a/rest_management_api_client/service_policy/create_service_policy_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateServicePolicyParams creates a new CreateServicePolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateServicePolicyParams() *CreateServicePolicyParams { - return &CreateServicePolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateServicePolicyParamsWithTimeout creates a new CreateServicePolicyParams object -// with the ability to set a timeout on a request. -func NewCreateServicePolicyParamsWithTimeout(timeout time.Duration) *CreateServicePolicyParams { - return &CreateServicePolicyParams{ - timeout: timeout, - } -} - -// NewCreateServicePolicyParamsWithContext creates a new CreateServicePolicyParams object -// with the ability to set a context for a request. -func NewCreateServicePolicyParamsWithContext(ctx context.Context) *CreateServicePolicyParams { - return &CreateServicePolicyParams{ - Context: ctx, - } -} - -// NewCreateServicePolicyParamsWithHTTPClient creates a new CreateServicePolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateServicePolicyParamsWithHTTPClient(client *http.Client) *CreateServicePolicyParams { - return &CreateServicePolicyParams{ - HTTPClient: client, - } -} - -/* CreateServicePolicyParams contains all the parameters to send to the API endpoint - for the create service policy operation. - - Typically these are written to a http.Request. -*/ -type CreateServicePolicyParams struct { - - /* Policy. - - A service policy to create - */ - Policy *rest_model.ServicePolicyCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServicePolicyParams) WithDefaults() *CreateServicePolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServicePolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create service policy params -func (o *CreateServicePolicyParams) WithTimeout(timeout time.Duration) *CreateServicePolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create service policy params -func (o *CreateServicePolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create service policy params -func (o *CreateServicePolicyParams) WithContext(ctx context.Context) *CreateServicePolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create service policy params -func (o *CreateServicePolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create service policy params -func (o *CreateServicePolicyParams) WithHTTPClient(client *http.Client) *CreateServicePolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create service policy params -func (o *CreateServicePolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPolicy adds the policy to the create service policy params -func (o *CreateServicePolicyParams) WithPolicy(policy *rest_model.ServicePolicyCreate) *CreateServicePolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the create service policy params -func (o *CreateServicePolicyParams) SetPolicy(policy *rest_model.ServicePolicyCreate) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/create_service_policy_responses.go b/rest_management_api_client/service_policy/create_service_policy_responses.go deleted file mode 100644 index eddf43a1f..000000000 --- a/rest_management_api_client/service_policy/create_service_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateServicePolicyReader is a Reader for the CreateServicePolicy structure. -type CreateServicePolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateServicePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateServicePolicyCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateServicePolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateServicePolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateServicePolicyCreated creates a CreateServicePolicyCreated with default headers values -func NewCreateServicePolicyCreated() *CreateServicePolicyCreated { - return &CreateServicePolicyCreated{} -} - -/* CreateServicePolicyCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateServicePolicyCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateServicePolicyCreated) Error() string { - return fmt.Sprintf("[POST /service-policies][%d] createServicePolicyCreated %+v", 201, o.Payload) -} -func (o *CreateServicePolicyCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateServicePolicyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServicePolicyBadRequest creates a CreateServicePolicyBadRequest with default headers values -func NewCreateServicePolicyBadRequest() *CreateServicePolicyBadRequest { - return &CreateServicePolicyBadRequest{} -} - -/* CreateServicePolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateServicePolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateServicePolicyBadRequest) Error() string { - return fmt.Sprintf("[POST /service-policies][%d] createServicePolicyBadRequest %+v", 400, o.Payload) -} -func (o *CreateServicePolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateServicePolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServicePolicyUnauthorized creates a CreateServicePolicyUnauthorized with default headers values -func NewCreateServicePolicyUnauthorized() *CreateServicePolicyUnauthorized { - return &CreateServicePolicyUnauthorized{} -} - -/* CreateServicePolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateServicePolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateServicePolicyUnauthorized) Error() string { - return fmt.Sprintf("[POST /service-policies][%d] createServicePolicyUnauthorized %+v", 401, o.Payload) -} -func (o *CreateServicePolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateServicePolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/delete_service_policy_parameters.go b/rest_management_api_client/service_policy/delete_service_policy_parameters.go deleted file mode 100644 index 896ba2fe5..000000000 --- a/rest_management_api_client/service_policy/delete_service_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServicePolicyParams creates a new DeleteServicePolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteServicePolicyParams() *DeleteServicePolicyParams { - return &DeleteServicePolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteServicePolicyParamsWithTimeout creates a new DeleteServicePolicyParams object -// with the ability to set a timeout on a request. -func NewDeleteServicePolicyParamsWithTimeout(timeout time.Duration) *DeleteServicePolicyParams { - return &DeleteServicePolicyParams{ - timeout: timeout, - } -} - -// NewDeleteServicePolicyParamsWithContext creates a new DeleteServicePolicyParams object -// with the ability to set a context for a request. -func NewDeleteServicePolicyParamsWithContext(ctx context.Context) *DeleteServicePolicyParams { - return &DeleteServicePolicyParams{ - Context: ctx, - } -} - -// NewDeleteServicePolicyParamsWithHTTPClient creates a new DeleteServicePolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteServicePolicyParamsWithHTTPClient(client *http.Client) *DeleteServicePolicyParams { - return &DeleteServicePolicyParams{ - HTTPClient: client, - } -} - -/* DeleteServicePolicyParams contains all the parameters to send to the API endpoint - for the delete service policy operation. - - Typically these are written to a http.Request. -*/ -type DeleteServicePolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServicePolicyParams) WithDefaults() *DeleteServicePolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteServicePolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete service policy params -func (o *DeleteServicePolicyParams) WithTimeout(timeout time.Duration) *DeleteServicePolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete service policy params -func (o *DeleteServicePolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete service policy params -func (o *DeleteServicePolicyParams) WithContext(ctx context.Context) *DeleteServicePolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete service policy params -func (o *DeleteServicePolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete service policy params -func (o *DeleteServicePolicyParams) WithHTTPClient(client *http.Client) *DeleteServicePolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete service policy params -func (o *DeleteServicePolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete service policy params -func (o *DeleteServicePolicyParams) WithID(id string) *DeleteServicePolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete service policy params -func (o *DeleteServicePolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/delete_service_policy_responses.go b/rest_management_api_client/service_policy/delete_service_policy_responses.go deleted file mode 100644 index ad03f1b69..000000000 --- a/rest_management_api_client/service_policy/delete_service_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServicePolicyReader is a Reader for the DeleteServicePolicy structure. -type DeleteServicePolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteServicePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteServicePolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteServicePolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteServicePolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteServicePolicyConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteServicePolicyOK creates a DeleteServicePolicyOK with default headers values -func NewDeleteServicePolicyOK() *DeleteServicePolicyOK { - return &DeleteServicePolicyOK{} -} - -/* DeleteServicePolicyOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteServicePolicyOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteServicePolicyOK) Error() string { - return fmt.Sprintf("[DELETE /service-policies/{id}][%d] deleteServicePolicyOK %+v", 200, o.Payload) -} -func (o *DeleteServicePolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteServicePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServicePolicyBadRequest creates a DeleteServicePolicyBadRequest with default headers values -func NewDeleteServicePolicyBadRequest() *DeleteServicePolicyBadRequest { - return &DeleteServicePolicyBadRequest{} -} - -/* DeleteServicePolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteServicePolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServicePolicyBadRequest) Error() string { - return fmt.Sprintf("[DELETE /service-policies/{id}][%d] deleteServicePolicyBadRequest %+v", 400, o.Payload) -} -func (o *DeleteServicePolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServicePolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServicePolicyUnauthorized creates a DeleteServicePolicyUnauthorized with default headers values -func NewDeleteServicePolicyUnauthorized() *DeleteServicePolicyUnauthorized { - return &DeleteServicePolicyUnauthorized{} -} - -/* DeleteServicePolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteServicePolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServicePolicyUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /service-policies/{id}][%d] deleteServicePolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteServicePolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServicePolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteServicePolicyConflict creates a DeleteServicePolicyConflict with default headers values -func NewDeleteServicePolicyConflict() *DeleteServicePolicyConflict { - return &DeleteServicePolicyConflict{} -} - -/* DeleteServicePolicyConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteServicePolicyConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteServicePolicyConflict) Error() string { - return fmt.Sprintf("[DELETE /service-policies/{id}][%d] deleteServicePolicyConflict %+v", 409, o.Payload) -} -func (o *DeleteServicePolicyConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteServicePolicyConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/detail_service_policy_parameters.go b/rest_management_api_client/service_policy/detail_service_policy_parameters.go deleted file mode 100644 index cd4b74ce0..000000000 --- a/rest_management_api_client/service_policy/detail_service_policy_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailServicePolicyParams creates a new DetailServicePolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailServicePolicyParams() *DetailServicePolicyParams { - return &DetailServicePolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailServicePolicyParamsWithTimeout creates a new DetailServicePolicyParams object -// with the ability to set a timeout on a request. -func NewDetailServicePolicyParamsWithTimeout(timeout time.Duration) *DetailServicePolicyParams { - return &DetailServicePolicyParams{ - timeout: timeout, - } -} - -// NewDetailServicePolicyParamsWithContext creates a new DetailServicePolicyParams object -// with the ability to set a context for a request. -func NewDetailServicePolicyParamsWithContext(ctx context.Context) *DetailServicePolicyParams { - return &DetailServicePolicyParams{ - Context: ctx, - } -} - -// NewDetailServicePolicyParamsWithHTTPClient creates a new DetailServicePolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailServicePolicyParamsWithHTTPClient(client *http.Client) *DetailServicePolicyParams { - return &DetailServicePolicyParams{ - HTTPClient: client, - } -} - -/* DetailServicePolicyParams contains all the parameters to send to the API endpoint - for the detail service policy operation. - - Typically these are written to a http.Request. -*/ -type DetailServicePolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServicePolicyParams) WithDefaults() *DetailServicePolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailServicePolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail service policy params -func (o *DetailServicePolicyParams) WithTimeout(timeout time.Duration) *DetailServicePolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail service policy params -func (o *DetailServicePolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail service policy params -func (o *DetailServicePolicyParams) WithContext(ctx context.Context) *DetailServicePolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail service policy params -func (o *DetailServicePolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail service policy params -func (o *DetailServicePolicyParams) WithHTTPClient(client *http.Client) *DetailServicePolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail service policy params -func (o *DetailServicePolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail service policy params -func (o *DetailServicePolicyParams) WithID(id string) *DetailServicePolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail service policy params -func (o *DetailServicePolicyParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/detail_service_policy_responses.go b/rest_management_api_client/service_policy/detail_service_policy_responses.go deleted file mode 100644 index 7f8fe6556..000000000 --- a/rest_management_api_client/service_policy/detail_service_policy_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailServicePolicyReader is a Reader for the DetailServicePolicy structure. -type DetailServicePolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailServicePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailServicePolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailServicePolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailServicePolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailServicePolicyOK creates a DetailServicePolicyOK with default headers values -func NewDetailServicePolicyOK() *DetailServicePolicyOK { - return &DetailServicePolicyOK{} -} - -/* DetailServicePolicyOK describes a response with status code 200, with default header values. - -A single service policy -*/ -type DetailServicePolicyOK struct { - Payload *rest_model.DetailServicePolicyEnvelop -} - -func (o *DetailServicePolicyOK) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}][%d] detailServicePolicyOK %+v", 200, o.Payload) -} -func (o *DetailServicePolicyOK) GetPayload() *rest_model.DetailServicePolicyEnvelop { - return o.Payload -} - -func (o *DetailServicePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailServicePolicyEnvelop) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServicePolicyUnauthorized creates a DetailServicePolicyUnauthorized with default headers values -func NewDetailServicePolicyUnauthorized() *DetailServicePolicyUnauthorized { - return &DetailServicePolicyUnauthorized{} -} - -/* DetailServicePolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailServicePolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServicePolicyUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}][%d] detailServicePolicyUnauthorized %+v", 401, o.Payload) -} -func (o *DetailServicePolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServicePolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailServicePolicyNotFound creates a DetailServicePolicyNotFound with default headers values -func NewDetailServicePolicyNotFound() *DetailServicePolicyNotFound { - return &DetailServicePolicyNotFound{} -} - -/* DetailServicePolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailServicePolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailServicePolicyNotFound) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}][%d] detailServicePolicyNotFound %+v", 404, o.Payload) -} -func (o *DetailServicePolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailServicePolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policies_parameters.go b/rest_management_api_client/service_policy/list_service_policies_parameters.go deleted file mode 100644 index b6ec024e5..000000000 --- a/rest_management_api_client/service_policy/list_service_policies_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePoliciesParams creates a new ListServicePoliciesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServicePoliciesParams() *ListServicePoliciesParams { - return &ListServicePoliciesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicePoliciesParamsWithTimeout creates a new ListServicePoliciesParams object -// with the ability to set a timeout on a request. -func NewListServicePoliciesParamsWithTimeout(timeout time.Duration) *ListServicePoliciesParams { - return &ListServicePoliciesParams{ - timeout: timeout, - } -} - -// NewListServicePoliciesParamsWithContext creates a new ListServicePoliciesParams object -// with the ability to set a context for a request. -func NewListServicePoliciesParamsWithContext(ctx context.Context) *ListServicePoliciesParams { - return &ListServicePoliciesParams{ - Context: ctx, - } -} - -// NewListServicePoliciesParamsWithHTTPClient creates a new ListServicePoliciesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicePoliciesParamsWithHTTPClient(client *http.Client) *ListServicePoliciesParams { - return &ListServicePoliciesParams{ - HTTPClient: client, - } -} - -/* ListServicePoliciesParams contains all the parameters to send to the API endpoint - for the list service policies operation. - - Typically these are written to a http.Request. -*/ -type ListServicePoliciesParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePoliciesParams) WithDefaults() *ListServicePoliciesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service policies params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePoliciesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service policies params -func (o *ListServicePoliciesParams) WithTimeout(timeout time.Duration) *ListServicePoliciesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service policies params -func (o *ListServicePoliciesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service policies params -func (o *ListServicePoliciesParams) WithContext(ctx context.Context) *ListServicePoliciesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service policies params -func (o *ListServicePoliciesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service policies params -func (o *ListServicePoliciesParams) WithHTTPClient(client *http.Client) *ListServicePoliciesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service policies params -func (o *ListServicePoliciesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service policies params -func (o *ListServicePoliciesParams) WithFilter(filter *string) *ListServicePoliciesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service policies params -func (o *ListServicePoliciesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list service policies params -func (o *ListServicePoliciesParams) WithLimit(limit *int64) *ListServicePoliciesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service policies params -func (o *ListServicePoliciesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service policies params -func (o *ListServicePoliciesParams) WithOffset(offset *int64) *ListServicePoliciesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service policies params -func (o *ListServicePoliciesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicePoliciesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policies_responses.go b/rest_management_api_client/service_policy/list_service_policies_responses.go deleted file mode 100644 index 3f0a773c6..000000000 --- a/rest_management_api_client/service_policy/list_service_policies_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePoliciesReader is a Reader for the ListServicePolicies structure. -type ListServicePoliciesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicePoliciesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicePoliciesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServicePoliciesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServicePoliciesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServicePoliciesOK creates a ListServicePoliciesOK with default headers values -func NewListServicePoliciesOK() *ListServicePoliciesOK { - return &ListServicePoliciesOK{} -} - -/* ListServicePoliciesOK describes a response with status code 200, with default header values. - -A list of service policies -*/ -type ListServicePoliciesOK struct { - Payload *rest_model.ListServicePoliciesEnvelope -} - -func (o *ListServicePoliciesOK) Error() string { - return fmt.Sprintf("[GET /service-policies][%d] listServicePoliciesOK %+v", 200, o.Payload) -} -func (o *ListServicePoliciesOK) GetPayload() *rest_model.ListServicePoliciesEnvelope { - return o.Payload -} - -func (o *ListServicePoliciesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicePoliciesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePoliciesBadRequest creates a ListServicePoliciesBadRequest with default headers values -func NewListServicePoliciesBadRequest() *ListServicePoliciesBadRequest { - return &ListServicePoliciesBadRequest{} -} - -/* ListServicePoliciesBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListServicePoliciesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePoliciesBadRequest) Error() string { - return fmt.Sprintf("[GET /service-policies][%d] listServicePoliciesBadRequest %+v", 400, o.Payload) -} -func (o *ListServicePoliciesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePoliciesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePoliciesUnauthorized creates a ListServicePoliciesUnauthorized with default headers values -func NewListServicePoliciesUnauthorized() *ListServicePoliciesUnauthorized { - return &ListServicePoliciesUnauthorized{} -} - -/* ListServicePoliciesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServicePoliciesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePoliciesUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-policies][%d] listServicePoliciesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServicePoliciesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePoliciesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policy_identities_parameters.go b/rest_management_api_client/service_policy/list_service_policy_identities_parameters.go deleted file mode 100644 index ac2892878..000000000 --- a/rest_management_api_client/service_policy/list_service_policy_identities_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePolicyIdentitiesParams creates a new ListServicePolicyIdentitiesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServicePolicyIdentitiesParams() *ListServicePolicyIdentitiesParams { - return &ListServicePolicyIdentitiesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicePolicyIdentitiesParamsWithTimeout creates a new ListServicePolicyIdentitiesParams object -// with the ability to set a timeout on a request. -func NewListServicePolicyIdentitiesParamsWithTimeout(timeout time.Duration) *ListServicePolicyIdentitiesParams { - return &ListServicePolicyIdentitiesParams{ - timeout: timeout, - } -} - -// NewListServicePolicyIdentitiesParamsWithContext creates a new ListServicePolicyIdentitiesParams object -// with the ability to set a context for a request. -func NewListServicePolicyIdentitiesParamsWithContext(ctx context.Context) *ListServicePolicyIdentitiesParams { - return &ListServicePolicyIdentitiesParams{ - Context: ctx, - } -} - -// NewListServicePolicyIdentitiesParamsWithHTTPClient creates a new ListServicePolicyIdentitiesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicePolicyIdentitiesParamsWithHTTPClient(client *http.Client) *ListServicePolicyIdentitiesParams { - return &ListServicePolicyIdentitiesParams{ - HTTPClient: client, - } -} - -/* ListServicePolicyIdentitiesParams contains all the parameters to send to the API endpoint - for the list service policy identities operation. - - Typically these are written to a http.Request. -*/ -type ListServicePolicyIdentitiesParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service policy identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePolicyIdentitiesParams) WithDefaults() *ListServicePolicyIdentitiesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service policy identities params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePolicyIdentitiesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithTimeout(timeout time.Duration) *ListServicePolicyIdentitiesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithContext(ctx context.Context) *ListServicePolicyIdentitiesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithHTTPClient(client *http.Client) *ListServicePolicyIdentitiesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithFilter(filter *string) *ListServicePolicyIdentitiesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithID(id string) *ListServicePolicyIdentitiesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithLimit(limit *int64) *ListServicePolicyIdentitiesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) WithOffset(offset *int64) *ListServicePolicyIdentitiesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service policy identities params -func (o *ListServicePolicyIdentitiesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicePolicyIdentitiesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policy_identities_responses.go b/rest_management_api_client/service_policy/list_service_policy_identities_responses.go deleted file mode 100644 index b8a3e9b36..000000000 --- a/rest_management_api_client/service_policy/list_service_policy_identities_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePolicyIdentitiesReader is a Reader for the ListServicePolicyIdentities structure. -type ListServicePolicyIdentitiesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicePolicyIdentitiesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicePolicyIdentitiesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServicePolicyIdentitiesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServicePolicyIdentitiesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServicePolicyIdentitiesOK creates a ListServicePolicyIdentitiesOK with default headers values -func NewListServicePolicyIdentitiesOK() *ListServicePolicyIdentitiesOK { - return &ListServicePolicyIdentitiesOK{} -} - -/* ListServicePolicyIdentitiesOK describes a response with status code 200, with default header values. - -A list of identities -*/ -type ListServicePolicyIdentitiesOK struct { - Payload *rest_model.ListIdentitiesEnvelope -} - -func (o *ListServicePolicyIdentitiesOK) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/identities][%d] listServicePolicyIdentitiesOK %+v", 200, o.Payload) -} -func (o *ListServicePolicyIdentitiesOK) GetPayload() *rest_model.ListIdentitiesEnvelope { - return o.Payload -} - -func (o *ListServicePolicyIdentitiesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListIdentitiesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePolicyIdentitiesBadRequest creates a ListServicePolicyIdentitiesBadRequest with default headers values -func NewListServicePolicyIdentitiesBadRequest() *ListServicePolicyIdentitiesBadRequest { - return &ListServicePolicyIdentitiesBadRequest{} -} - -/* ListServicePolicyIdentitiesBadRequest describes a response with status code 400, with default header values. - -The requested resource does not exist -*/ -type ListServicePolicyIdentitiesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePolicyIdentitiesBadRequest) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/identities][%d] listServicePolicyIdentitiesBadRequest %+v", 400, o.Payload) -} -func (o *ListServicePolicyIdentitiesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePolicyIdentitiesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePolicyIdentitiesUnauthorized creates a ListServicePolicyIdentitiesUnauthorized with default headers values -func NewListServicePolicyIdentitiesUnauthorized() *ListServicePolicyIdentitiesUnauthorized { - return &ListServicePolicyIdentitiesUnauthorized{} -} - -/* ListServicePolicyIdentitiesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServicePolicyIdentitiesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePolicyIdentitiesUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/identities][%d] listServicePolicyIdentitiesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServicePolicyIdentitiesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePolicyIdentitiesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policy_posture_checks_parameters.go b/rest_management_api_client/service_policy/list_service_policy_posture_checks_parameters.go deleted file mode 100644 index aadd26abf..000000000 --- a/rest_management_api_client/service_policy/list_service_policy_posture_checks_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePolicyPostureChecksParams creates a new ListServicePolicyPostureChecksParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServicePolicyPostureChecksParams() *ListServicePolicyPostureChecksParams { - return &ListServicePolicyPostureChecksParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicePolicyPostureChecksParamsWithTimeout creates a new ListServicePolicyPostureChecksParams object -// with the ability to set a timeout on a request. -func NewListServicePolicyPostureChecksParamsWithTimeout(timeout time.Duration) *ListServicePolicyPostureChecksParams { - return &ListServicePolicyPostureChecksParams{ - timeout: timeout, - } -} - -// NewListServicePolicyPostureChecksParamsWithContext creates a new ListServicePolicyPostureChecksParams object -// with the ability to set a context for a request. -func NewListServicePolicyPostureChecksParamsWithContext(ctx context.Context) *ListServicePolicyPostureChecksParams { - return &ListServicePolicyPostureChecksParams{ - Context: ctx, - } -} - -// NewListServicePolicyPostureChecksParamsWithHTTPClient creates a new ListServicePolicyPostureChecksParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicePolicyPostureChecksParamsWithHTTPClient(client *http.Client) *ListServicePolicyPostureChecksParams { - return &ListServicePolicyPostureChecksParams{ - HTTPClient: client, - } -} - -/* ListServicePolicyPostureChecksParams contains all the parameters to send to the API endpoint - for the list service policy posture checks operation. - - Typically these are written to a http.Request. -*/ -type ListServicePolicyPostureChecksParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service policy posture checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePolicyPostureChecksParams) WithDefaults() *ListServicePolicyPostureChecksParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service policy posture checks params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePolicyPostureChecksParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithTimeout(timeout time.Duration) *ListServicePolicyPostureChecksParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithContext(ctx context.Context) *ListServicePolicyPostureChecksParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithHTTPClient(client *http.Client) *ListServicePolicyPostureChecksParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithFilter(filter *string) *ListServicePolicyPostureChecksParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithID(id string) *ListServicePolicyPostureChecksParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithLimit(limit *int64) *ListServicePolicyPostureChecksParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) WithOffset(offset *int64) *ListServicePolicyPostureChecksParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service policy posture checks params -func (o *ListServicePolicyPostureChecksParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicePolicyPostureChecksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policy_posture_checks_responses.go b/rest_management_api_client/service_policy/list_service_policy_posture_checks_responses.go deleted file mode 100644 index b2ec6d319..000000000 --- a/rest_management_api_client/service_policy/list_service_policy_posture_checks_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePolicyPostureChecksReader is a Reader for the ListServicePolicyPostureChecks structure. -type ListServicePolicyPostureChecksReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicePolicyPostureChecksReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicePolicyPostureChecksOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServicePolicyPostureChecksBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServicePolicyPostureChecksUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServicePolicyPostureChecksOK creates a ListServicePolicyPostureChecksOK with default headers values -func NewListServicePolicyPostureChecksOK() *ListServicePolicyPostureChecksOK { - return &ListServicePolicyPostureChecksOK{} -} - -/* ListServicePolicyPostureChecksOK describes a response with status code 200, with default header values. - -A list of posture checks -*/ -type ListServicePolicyPostureChecksOK struct { - Payload *rest_model.ListPostureCheckEnvelope -} - -func (o *ListServicePolicyPostureChecksOK) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/posture-checks][%d] listServicePolicyPostureChecksOK %+v", 200, o.Payload) -} -func (o *ListServicePolicyPostureChecksOK) GetPayload() *rest_model.ListPostureCheckEnvelope { - return o.Payload -} - -func (o *ListServicePolicyPostureChecksOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListPostureCheckEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePolicyPostureChecksBadRequest creates a ListServicePolicyPostureChecksBadRequest with default headers values -func NewListServicePolicyPostureChecksBadRequest() *ListServicePolicyPostureChecksBadRequest { - return &ListServicePolicyPostureChecksBadRequest{} -} - -/* ListServicePolicyPostureChecksBadRequest describes a response with status code 400, with default header values. - -The requested resource does not exist -*/ -type ListServicePolicyPostureChecksBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePolicyPostureChecksBadRequest) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/posture-checks][%d] listServicePolicyPostureChecksBadRequest %+v", 400, o.Payload) -} -func (o *ListServicePolicyPostureChecksBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePolicyPostureChecksBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePolicyPostureChecksUnauthorized creates a ListServicePolicyPostureChecksUnauthorized with default headers values -func NewListServicePolicyPostureChecksUnauthorized() *ListServicePolicyPostureChecksUnauthorized { - return &ListServicePolicyPostureChecksUnauthorized{} -} - -/* ListServicePolicyPostureChecksUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServicePolicyPostureChecksUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePolicyPostureChecksUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/posture-checks][%d] listServicePolicyPostureChecksUnauthorized %+v", 401, o.Payload) -} -func (o *ListServicePolicyPostureChecksUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePolicyPostureChecksUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policy_services_parameters.go b/rest_management_api_client/service_policy/list_service_policy_services_parameters.go deleted file mode 100644 index 5ffd6c302..000000000 --- a/rest_management_api_client/service_policy/list_service_policy_services_parameters.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePolicyServicesParams creates a new ListServicePolicyServicesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListServicePolicyServicesParams() *ListServicePolicyServicesParams { - return &ListServicePolicyServicesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListServicePolicyServicesParamsWithTimeout creates a new ListServicePolicyServicesParams object -// with the ability to set a timeout on a request. -func NewListServicePolicyServicesParamsWithTimeout(timeout time.Duration) *ListServicePolicyServicesParams { - return &ListServicePolicyServicesParams{ - timeout: timeout, - } -} - -// NewListServicePolicyServicesParamsWithContext creates a new ListServicePolicyServicesParams object -// with the ability to set a context for a request. -func NewListServicePolicyServicesParamsWithContext(ctx context.Context) *ListServicePolicyServicesParams { - return &ListServicePolicyServicesParams{ - Context: ctx, - } -} - -// NewListServicePolicyServicesParamsWithHTTPClient creates a new ListServicePolicyServicesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListServicePolicyServicesParamsWithHTTPClient(client *http.Client) *ListServicePolicyServicesParams { - return &ListServicePolicyServicesParams{ - HTTPClient: client, - } -} - -/* ListServicePolicyServicesParams contains all the parameters to send to the API endpoint - for the list service policy services operation. - - Typically these are written to a http.Request. -*/ -type ListServicePolicyServicesParams struct { - - // Filter. - Filter *string - - /* ID. - - The id of the requested resource - */ - ID string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list service policy services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePolicyServicesParams) WithDefaults() *ListServicePolicyServicesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list service policy services params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListServicePolicyServicesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list service policy services params -func (o *ListServicePolicyServicesParams) WithTimeout(timeout time.Duration) *ListServicePolicyServicesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list service policy services params -func (o *ListServicePolicyServicesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list service policy services params -func (o *ListServicePolicyServicesParams) WithContext(ctx context.Context) *ListServicePolicyServicesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list service policy services params -func (o *ListServicePolicyServicesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list service policy services params -func (o *ListServicePolicyServicesParams) WithHTTPClient(client *http.Client) *ListServicePolicyServicesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list service policy services params -func (o *ListServicePolicyServicesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list service policy services params -func (o *ListServicePolicyServicesParams) WithFilter(filter *string) *ListServicePolicyServicesParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list service policy services params -func (o *ListServicePolicyServicesParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithID adds the id to the list service policy services params -func (o *ListServicePolicyServicesParams) WithID(id string) *ListServicePolicyServicesParams { - o.SetID(id) - return o -} - -// SetID adds the id to the list service policy services params -func (o *ListServicePolicyServicesParams) SetID(id string) { - o.ID = id -} - -// WithLimit adds the limit to the list service policy services params -func (o *ListServicePolicyServicesParams) WithLimit(limit *int64) *ListServicePolicyServicesParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list service policy services params -func (o *ListServicePolicyServicesParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list service policy services params -func (o *ListServicePolicyServicesParams) WithOffset(offset *int64) *ListServicePolicyServicesParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list service policy services params -func (o *ListServicePolicyServicesParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListServicePolicyServicesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/list_service_policy_services_responses.go b/rest_management_api_client/service_policy/list_service_policy_services_responses.go deleted file mode 100644 index 6a63af966..000000000 --- a/rest_management_api_client/service_policy/list_service_policy_services_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePolicyServicesReader is a Reader for the ListServicePolicyServices structure. -type ListServicePolicyServicesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListServicePolicyServicesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListServicePolicyServicesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListServicePolicyServicesBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListServicePolicyServicesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListServicePolicyServicesOK creates a ListServicePolicyServicesOK with default headers values -func NewListServicePolicyServicesOK() *ListServicePolicyServicesOK { - return &ListServicePolicyServicesOK{} -} - -/* ListServicePolicyServicesOK describes a response with status code 200, with default header values. - -A list of services -*/ -type ListServicePolicyServicesOK struct { - Payload *rest_model.ListServicesEnvelope -} - -func (o *ListServicePolicyServicesOK) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/services][%d] listServicePolicyServicesOK %+v", 200, o.Payload) -} -func (o *ListServicePolicyServicesOK) GetPayload() *rest_model.ListServicesEnvelope { - return o.Payload -} - -func (o *ListServicePolicyServicesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListServicesEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePolicyServicesBadRequest creates a ListServicePolicyServicesBadRequest with default headers values -func NewListServicePolicyServicesBadRequest() *ListServicePolicyServicesBadRequest { - return &ListServicePolicyServicesBadRequest{} -} - -/* ListServicePolicyServicesBadRequest describes a response with status code 400, with default header values. - -The requested resource does not exist -*/ -type ListServicePolicyServicesBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePolicyServicesBadRequest) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/services][%d] listServicePolicyServicesBadRequest %+v", 400, o.Payload) -} -func (o *ListServicePolicyServicesBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePolicyServicesBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListServicePolicyServicesUnauthorized creates a ListServicePolicyServicesUnauthorized with default headers values -func NewListServicePolicyServicesUnauthorized() *ListServicePolicyServicesUnauthorized { - return &ListServicePolicyServicesUnauthorized{} -} - -/* ListServicePolicyServicesUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListServicePolicyServicesUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListServicePolicyServicesUnauthorized) Error() string { - return fmt.Sprintf("[GET /service-policies/{id}/services][%d] listServicePolicyServicesUnauthorized %+v", 401, o.Payload) -} -func (o *ListServicePolicyServicesUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListServicePolicyServicesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/patch_service_policy_parameters.go b/rest_management_api_client/service_policy/patch_service_policy_parameters.go deleted file mode 100644 index 4909cac16..000000000 --- a/rest_management_api_client/service_policy/patch_service_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServicePolicyParams creates a new PatchServicePolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchServicePolicyParams() *PatchServicePolicyParams { - return &PatchServicePolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchServicePolicyParamsWithTimeout creates a new PatchServicePolicyParams object -// with the ability to set a timeout on a request. -func NewPatchServicePolicyParamsWithTimeout(timeout time.Duration) *PatchServicePolicyParams { - return &PatchServicePolicyParams{ - timeout: timeout, - } -} - -// NewPatchServicePolicyParamsWithContext creates a new PatchServicePolicyParams object -// with the ability to set a context for a request. -func NewPatchServicePolicyParamsWithContext(ctx context.Context) *PatchServicePolicyParams { - return &PatchServicePolicyParams{ - Context: ctx, - } -} - -// NewPatchServicePolicyParamsWithHTTPClient creates a new PatchServicePolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchServicePolicyParamsWithHTTPClient(client *http.Client) *PatchServicePolicyParams { - return &PatchServicePolicyParams{ - HTTPClient: client, - } -} - -/* PatchServicePolicyParams contains all the parameters to send to the API endpoint - for the patch service policy operation. - - Typically these are written to a http.Request. -*/ -type PatchServicePolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Policy. - - A service policy patch object - */ - Policy *rest_model.ServicePolicyPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServicePolicyParams) WithDefaults() *PatchServicePolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchServicePolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch service policy params -func (o *PatchServicePolicyParams) WithTimeout(timeout time.Duration) *PatchServicePolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch service policy params -func (o *PatchServicePolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch service policy params -func (o *PatchServicePolicyParams) WithContext(ctx context.Context) *PatchServicePolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch service policy params -func (o *PatchServicePolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch service policy params -func (o *PatchServicePolicyParams) WithHTTPClient(client *http.Client) *PatchServicePolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch service policy params -func (o *PatchServicePolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch service policy params -func (o *PatchServicePolicyParams) WithID(id string) *PatchServicePolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch service policy params -func (o *PatchServicePolicyParams) SetID(id string) { - o.ID = id -} - -// WithPolicy adds the policy to the patch service policy params -func (o *PatchServicePolicyParams) WithPolicy(policy *rest_model.ServicePolicyPatch) *PatchServicePolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the patch service policy params -func (o *PatchServicePolicyParams) SetPolicy(policy *rest_model.ServicePolicyPatch) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/patch_service_policy_responses.go b/rest_management_api_client/service_policy/patch_service_policy_responses.go deleted file mode 100644 index b244f9d64..000000000 --- a/rest_management_api_client/service_policy/patch_service_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchServicePolicyReader is a Reader for the PatchServicePolicy structure. -type PatchServicePolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchServicePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchServicePolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchServicePolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchServicePolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchServicePolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchServicePolicyOK creates a PatchServicePolicyOK with default headers values -func NewPatchServicePolicyOK() *PatchServicePolicyOK { - return &PatchServicePolicyOK{} -} - -/* PatchServicePolicyOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchServicePolicyOK struct { - Payload *rest_model.Empty -} - -func (o *PatchServicePolicyOK) Error() string { - return fmt.Sprintf("[PATCH /service-policies/{id}][%d] patchServicePolicyOK %+v", 200, o.Payload) -} -func (o *PatchServicePolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchServicePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServicePolicyBadRequest creates a PatchServicePolicyBadRequest with default headers values -func NewPatchServicePolicyBadRequest() *PatchServicePolicyBadRequest { - return &PatchServicePolicyBadRequest{} -} - -/* PatchServicePolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchServicePolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServicePolicyBadRequest) Error() string { - return fmt.Sprintf("[PATCH /service-policies/{id}][%d] patchServicePolicyBadRequest %+v", 400, o.Payload) -} -func (o *PatchServicePolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServicePolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServicePolicyUnauthorized creates a PatchServicePolicyUnauthorized with default headers values -func NewPatchServicePolicyUnauthorized() *PatchServicePolicyUnauthorized { - return &PatchServicePolicyUnauthorized{} -} - -/* PatchServicePolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchServicePolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServicePolicyUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /service-policies/{id}][%d] patchServicePolicyUnauthorized %+v", 401, o.Payload) -} -func (o *PatchServicePolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServicePolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchServicePolicyNotFound creates a PatchServicePolicyNotFound with default headers values -func NewPatchServicePolicyNotFound() *PatchServicePolicyNotFound { - return &PatchServicePolicyNotFound{} -} - -/* PatchServicePolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchServicePolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchServicePolicyNotFound) Error() string { - return fmt.Sprintf("[PATCH /service-policies/{id}][%d] patchServicePolicyNotFound %+v", 404, o.Payload) -} -func (o *PatchServicePolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchServicePolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/service_policy/service_policy_client.go b/rest_management_api_client/service_policy/service_policy_client.go deleted file mode 100644 index c360236d2..000000000 --- a/rest_management_api_client/service_policy/service_policy_client.go +++ /dev/null @@ -1,454 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new service policy API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for service policy API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateServicePolicy(params *CreateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServicePolicyCreated, error) - - DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServicePolicyOK, error) - - DetailServicePolicy(params *DetailServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServicePolicyOK, error) - - ListServicePolicies(params *ListServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePoliciesOK, error) - - ListServicePolicyIdentities(params *ListServicePolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyIdentitiesOK, error) - - ListServicePolicyPostureChecks(params *ListServicePolicyPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyPostureChecksOK, error) - - ListServicePolicyServices(params *ListServicePolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyServicesOK, error) - - PatchServicePolicy(params *PatchServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServicePolicyOK, error) - - UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServicePolicyOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateServicePolicy creates a service policy resource - - Create a service policy resource. Requires admin access. -*/ -func (a *Client) CreateServicePolicy(params *CreateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateServicePolicyCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateServicePolicyParams() - } - op := &runtime.ClientOperation{ - ID: "createServicePolicy", - Method: "POST", - PathPattern: "/service-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateServicePolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateServicePolicyCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createServicePolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteServicePolicy deletes a service policy - - Delete a service policy by id. Requires admin access. -*/ -func (a *Client) DeleteServicePolicy(params *DeleteServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteServicePolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteServicePolicyParams() - } - op := &runtime.ClientOperation{ - ID: "deleteServicePolicy", - Method: "DELETE", - PathPattern: "/service-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteServicePolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteServicePolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteServicePolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailServicePolicy retrieves a single service policy - - Retrieves a single service policy by id. Requires admin access. -*/ -func (a *Client) DetailServicePolicy(params *DetailServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailServicePolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailServicePolicyParams() - } - op := &runtime.ClientOperation{ - ID: "detailServicePolicy", - Method: "GET", - PathPattern: "/service-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailServicePolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailServicePolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailServicePolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServicePolicies lists service policies - - Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServicePolicies(params *ListServicePoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePoliciesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicePoliciesParams() - } - op := &runtime.ClientOperation{ - ID: "listServicePolicies", - Method: "GET", - PathPattern: "/service-policies", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServicePoliciesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicePoliciesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServicePolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServicePolicyIdentities lists identities a service policy affects - - Retrieves a list of identity resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServicePolicyIdentities(params *ListServicePolicyIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyIdentitiesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicePolicyIdentitiesParams() - } - op := &runtime.ClientOperation{ - ID: "listServicePolicyIdentities", - Method: "GET", - PathPattern: "/service-policies/{id}/identities", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServicePolicyIdentitiesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicePolicyIdentitiesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServicePolicyIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServicePolicyPostureChecks lists posture check a service policy includes - - Retrieves a list of posture check resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServicePolicyPostureChecks(params *ListServicePolicyPostureChecksParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyPostureChecksOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicePolicyPostureChecksParams() - } - op := &runtime.ClientOperation{ - ID: "listServicePolicyPostureChecks", - Method: "GET", - PathPattern: "/service-policies/{id}/posture-checks", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServicePolicyPostureChecksReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicePolicyPostureChecksOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServicePolicyPostureChecks: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListServicePolicyServices lists services a service policy affects - - Retrieves a list of service resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListServicePolicyServices(params *ListServicePolicyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListServicePolicyServicesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListServicePolicyServicesParams() - } - op := &runtime.ClientOperation{ - ID: "listServicePolicyServices", - Method: "GET", - PathPattern: "/service-policies/{id}/services", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListServicePolicyServicesReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListServicePolicyServicesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listServicePolicyServices: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchServicePolicy updates the supplied fields on a service policy - - Update the supplied fields on a service policy. Requires admin access. -*/ -func (a *Client) PatchServicePolicy(params *PatchServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchServicePolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchServicePolicyParams() - } - op := &runtime.ClientOperation{ - ID: "patchServicePolicy", - Method: "PATCH", - PathPattern: "/service-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchServicePolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchServicePolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchServicePolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateServicePolicy updates all fields on a service policy - - Update all fields on a service policy by id. Requires admin access. -*/ -func (a *Client) UpdateServicePolicy(params *UpdateServicePolicyParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateServicePolicyOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateServicePolicyParams() - } - op := &runtime.ClientOperation{ - ID: "updateServicePolicy", - Method: "PUT", - PathPattern: "/service-policies/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateServicePolicyReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateServicePolicyOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateServicePolicy: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/service_policy/update_service_policy_parameters.go b/rest_management_api_client/service_policy/update_service_policy_parameters.go deleted file mode 100644 index bdfd9a538..000000000 --- a/rest_management_api_client/service_policy/update_service_policy_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServicePolicyParams creates a new UpdateServicePolicyParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateServicePolicyParams() *UpdateServicePolicyParams { - return &UpdateServicePolicyParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateServicePolicyParamsWithTimeout creates a new UpdateServicePolicyParams object -// with the ability to set a timeout on a request. -func NewUpdateServicePolicyParamsWithTimeout(timeout time.Duration) *UpdateServicePolicyParams { - return &UpdateServicePolicyParams{ - timeout: timeout, - } -} - -// NewUpdateServicePolicyParamsWithContext creates a new UpdateServicePolicyParams object -// with the ability to set a context for a request. -func NewUpdateServicePolicyParamsWithContext(ctx context.Context) *UpdateServicePolicyParams { - return &UpdateServicePolicyParams{ - Context: ctx, - } -} - -// NewUpdateServicePolicyParamsWithHTTPClient creates a new UpdateServicePolicyParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateServicePolicyParamsWithHTTPClient(client *http.Client) *UpdateServicePolicyParams { - return &UpdateServicePolicyParams{ - HTTPClient: client, - } -} - -/* UpdateServicePolicyParams contains all the parameters to send to the API endpoint - for the update service policy operation. - - Typically these are written to a http.Request. -*/ -type UpdateServicePolicyParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Policy. - - A service policy update object - */ - Policy *rest_model.ServicePolicyUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServicePolicyParams) WithDefaults() *UpdateServicePolicyParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update service policy params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateServicePolicyParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update service policy params -func (o *UpdateServicePolicyParams) WithTimeout(timeout time.Duration) *UpdateServicePolicyParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update service policy params -func (o *UpdateServicePolicyParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update service policy params -func (o *UpdateServicePolicyParams) WithContext(ctx context.Context) *UpdateServicePolicyParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update service policy params -func (o *UpdateServicePolicyParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update service policy params -func (o *UpdateServicePolicyParams) WithHTTPClient(client *http.Client) *UpdateServicePolicyParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update service policy params -func (o *UpdateServicePolicyParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update service policy params -func (o *UpdateServicePolicyParams) WithID(id string) *UpdateServicePolicyParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update service policy params -func (o *UpdateServicePolicyParams) SetID(id string) { - o.ID = id -} - -// WithPolicy adds the policy to the update service policy params -func (o *UpdateServicePolicyParams) WithPolicy(policy *rest_model.ServicePolicyUpdate) *UpdateServicePolicyParams { - o.SetPolicy(policy) - return o -} - -// SetPolicy adds the policy to the update service policy params -func (o *UpdateServicePolicyParams) SetPolicy(policy *rest_model.ServicePolicyUpdate) { - o.Policy = policy -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateServicePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Policy != nil { - if err := r.SetBodyParam(o.Policy); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/service_policy/update_service_policy_responses.go b/rest_management_api_client/service_policy/update_service_policy_responses.go deleted file mode 100644 index 3fab40fb4..000000000 --- a/rest_management_api_client/service_policy/update_service_policy_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServicePolicyReader is a Reader for the UpdateServicePolicy structure. -type UpdateServicePolicyReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateServicePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateServicePolicyOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateServicePolicyBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateServicePolicyUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateServicePolicyNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateServicePolicyOK creates a UpdateServicePolicyOK with default headers values -func NewUpdateServicePolicyOK() *UpdateServicePolicyOK { - return &UpdateServicePolicyOK{} -} - -/* UpdateServicePolicyOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateServicePolicyOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateServicePolicyOK) Error() string { - return fmt.Sprintf("[PUT /service-policies/{id}][%d] updateServicePolicyOK %+v", 200, o.Payload) -} -func (o *UpdateServicePolicyOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateServicePolicyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServicePolicyBadRequest creates a UpdateServicePolicyBadRequest with default headers values -func NewUpdateServicePolicyBadRequest() *UpdateServicePolicyBadRequest { - return &UpdateServicePolicyBadRequest{} -} - -/* UpdateServicePolicyBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateServicePolicyBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServicePolicyBadRequest) Error() string { - return fmt.Sprintf("[PUT /service-policies/{id}][%d] updateServicePolicyBadRequest %+v", 400, o.Payload) -} -func (o *UpdateServicePolicyBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServicePolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServicePolicyUnauthorized creates a UpdateServicePolicyUnauthorized with default headers values -func NewUpdateServicePolicyUnauthorized() *UpdateServicePolicyUnauthorized { - return &UpdateServicePolicyUnauthorized{} -} - -/* UpdateServicePolicyUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateServicePolicyUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServicePolicyUnauthorized) Error() string { - return fmt.Sprintf("[PUT /service-policies/{id}][%d] updateServicePolicyUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateServicePolicyUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServicePolicyUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateServicePolicyNotFound creates a UpdateServicePolicyNotFound with default headers values -func NewUpdateServicePolicyNotFound() *UpdateServicePolicyNotFound { - return &UpdateServicePolicyNotFound{} -} - -/* UpdateServicePolicyNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateServicePolicyNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateServicePolicyNotFound) Error() string { - return fmt.Sprintf("[PUT /service-policies/{id}][%d] updateServicePolicyNotFound %+v", 404, o.Payload) -} -func (o *UpdateServicePolicyNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateServicePolicyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/session/delete_session_parameters.go b/rest_management_api_client/session/delete_session_parameters.go deleted file mode 100644 index 7913c8ac1..000000000 --- a/rest_management_api_client/session/delete_session_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteSessionParams creates a new DeleteSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteSessionParams() *DeleteSessionParams { - return &DeleteSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteSessionParamsWithTimeout creates a new DeleteSessionParams object -// with the ability to set a timeout on a request. -func NewDeleteSessionParamsWithTimeout(timeout time.Duration) *DeleteSessionParams { - return &DeleteSessionParams{ - timeout: timeout, - } -} - -// NewDeleteSessionParamsWithContext creates a new DeleteSessionParams object -// with the ability to set a context for a request. -func NewDeleteSessionParamsWithContext(ctx context.Context) *DeleteSessionParams { - return &DeleteSessionParams{ - Context: ctx, - } -} - -// NewDeleteSessionParamsWithHTTPClient creates a new DeleteSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteSessionParamsWithHTTPClient(client *http.Client) *DeleteSessionParams { - return &DeleteSessionParams{ - HTTPClient: client, - } -} - -/* DeleteSessionParams contains all the parameters to send to the API endpoint - for the delete session operation. - - Typically these are written to a http.Request. -*/ -type DeleteSessionParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteSessionParams) WithDefaults() *DeleteSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteSessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete session params -func (o *DeleteSessionParams) WithTimeout(timeout time.Duration) *DeleteSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete session params -func (o *DeleteSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete session params -func (o *DeleteSessionParams) WithContext(ctx context.Context) *DeleteSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete session params -func (o *DeleteSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete session params -func (o *DeleteSessionParams) WithHTTPClient(client *http.Client) *DeleteSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete session params -func (o *DeleteSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete session params -func (o *DeleteSessionParams) WithID(id string) *DeleteSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete session params -func (o *DeleteSessionParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/session/delete_session_responses.go b/rest_management_api_client/session/delete_session_responses.go deleted file mode 100644 index 7145f0668..000000000 --- a/rest_management_api_client/session/delete_session_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteSessionReader is a Reader for the DeleteSession structure. -type DeleteSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteSessionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteSessionConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteSessionOK creates a DeleteSessionOK with default headers values -func NewDeleteSessionOK() *DeleteSessionOK { - return &DeleteSessionOK{} -} - -/* DeleteSessionOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteSessionOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteSessionOK) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionOK %+v", 200, o.Payload) -} -func (o *DeleteSessionOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSessionBadRequest creates a DeleteSessionBadRequest with default headers values -func NewDeleteSessionBadRequest() *DeleteSessionBadRequest { - return &DeleteSessionBadRequest{} -} - -/* DeleteSessionBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteSessionBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteSessionBadRequest) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionBadRequest %+v", 400, o.Payload) -} -func (o *DeleteSessionBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteSessionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSessionUnauthorized creates a DeleteSessionUnauthorized with default headers values -func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized { - return &DeleteSessionUnauthorized{} -} - -/* DeleteSessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteSessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteSessionUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteSessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteSessionConflict creates a DeleteSessionConflict with default headers values -func NewDeleteSessionConflict() *DeleteSessionConflict { - return &DeleteSessionConflict{} -} - -/* DeleteSessionConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteSessionConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteSessionConflict) Error() string { - return fmt.Sprintf("[DELETE /sessions/{id}][%d] deleteSessionConflict %+v", 409, o.Payload) -} -func (o *DeleteSessionConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteSessionConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/session/detail_session_parameters.go b/rest_management_api_client/session/detail_session_parameters.go deleted file mode 100644 index 38f318abc..000000000 --- a/rest_management_api_client/session/detail_session_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSessionParams creates a new DetailSessionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSessionParams() *DetailSessionParams { - return &DetailSessionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSessionParamsWithTimeout creates a new DetailSessionParams object -// with the ability to set a timeout on a request. -func NewDetailSessionParamsWithTimeout(timeout time.Duration) *DetailSessionParams { - return &DetailSessionParams{ - timeout: timeout, - } -} - -// NewDetailSessionParamsWithContext creates a new DetailSessionParams object -// with the ability to set a context for a request. -func NewDetailSessionParamsWithContext(ctx context.Context) *DetailSessionParams { - return &DetailSessionParams{ - Context: ctx, - } -} - -// NewDetailSessionParamsWithHTTPClient creates a new DetailSessionParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSessionParamsWithHTTPClient(client *http.Client) *DetailSessionParams { - return &DetailSessionParams{ - HTTPClient: client, - } -} - -/* DetailSessionParams contains all the parameters to send to the API endpoint - for the detail session operation. - - Typically these are written to a http.Request. -*/ -type DetailSessionParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSessionParams) WithDefaults() *DetailSessionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail session params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSessionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail session params -func (o *DetailSessionParams) WithTimeout(timeout time.Duration) *DetailSessionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail session params -func (o *DetailSessionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail session params -func (o *DetailSessionParams) WithContext(ctx context.Context) *DetailSessionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail session params -func (o *DetailSessionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail session params -func (o *DetailSessionParams) WithHTTPClient(client *http.Client) *DetailSessionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail session params -func (o *DetailSessionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail session params -func (o *DetailSessionParams) WithID(id string) *DetailSessionParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail session params -func (o *DetailSessionParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSessionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/session/detail_session_responses.go b/rest_management_api_client/session/detail_session_responses.go deleted file mode 100644 index 6e182e351..000000000 --- a/rest_management_api_client/session/detail_session_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSessionReader is a Reader for the DetailSession structure. -type DetailSessionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSessionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSessionOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailSessionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailSessionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSessionOK creates a DetailSessionOK with default headers values -func NewDetailSessionOK() *DetailSessionOK { - return &DetailSessionOK{} -} - -/* DetailSessionOK describes a response with status code 200, with default header values. - -A single session -*/ -type DetailSessionOK struct { - Payload *rest_model.DetailSessionManagementEnvelope -} - -func (o *DetailSessionOK) Error() string { - return fmt.Sprintf("[GET /sessions/{id}][%d] detailSessionOK %+v", 200, o.Payload) -} -func (o *DetailSessionOK) GetPayload() *rest_model.DetailSessionManagementEnvelope { - return o.Payload -} - -func (o *DetailSessionOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSessionManagementEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailSessionUnauthorized creates a DetailSessionUnauthorized with default headers values -func NewDetailSessionUnauthorized() *DetailSessionUnauthorized { - return &DetailSessionUnauthorized{} -} - -/* DetailSessionUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailSessionUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailSessionUnauthorized) Error() string { - return fmt.Sprintf("[GET /sessions/{id}][%d] detailSessionUnauthorized %+v", 401, o.Payload) -} -func (o *DetailSessionUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailSessionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailSessionNotFound creates a DetailSessionNotFound with default headers values -func NewDetailSessionNotFound() *DetailSessionNotFound { - return &DetailSessionNotFound{} -} - -/* DetailSessionNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailSessionNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailSessionNotFound) Error() string { - return fmt.Sprintf("[GET /sessions/{id}][%d] detailSessionNotFound %+v", 404, o.Payload) -} -func (o *DetailSessionNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailSessionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/session/detail_session_route_path_parameters.go b/rest_management_api_client/session/detail_session_route_path_parameters.go deleted file mode 100644 index 8b5178404..000000000 --- a/rest_management_api_client/session/detail_session_route_path_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailSessionRoutePathParams creates a new DetailSessionRoutePathParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailSessionRoutePathParams() *DetailSessionRoutePathParams { - return &DetailSessionRoutePathParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailSessionRoutePathParamsWithTimeout creates a new DetailSessionRoutePathParams object -// with the ability to set a timeout on a request. -func NewDetailSessionRoutePathParamsWithTimeout(timeout time.Duration) *DetailSessionRoutePathParams { - return &DetailSessionRoutePathParams{ - timeout: timeout, - } -} - -// NewDetailSessionRoutePathParamsWithContext creates a new DetailSessionRoutePathParams object -// with the ability to set a context for a request. -func NewDetailSessionRoutePathParamsWithContext(ctx context.Context) *DetailSessionRoutePathParams { - return &DetailSessionRoutePathParams{ - Context: ctx, - } -} - -// NewDetailSessionRoutePathParamsWithHTTPClient creates a new DetailSessionRoutePathParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailSessionRoutePathParamsWithHTTPClient(client *http.Client) *DetailSessionRoutePathParams { - return &DetailSessionRoutePathParams{ - HTTPClient: client, - } -} - -/* DetailSessionRoutePathParams contains all the parameters to send to the API endpoint - for the detail session route path operation. - - Typically these are written to a http.Request. -*/ -type DetailSessionRoutePathParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail session route path params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSessionRoutePathParams) WithDefaults() *DetailSessionRoutePathParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail session route path params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailSessionRoutePathParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail session route path params -func (o *DetailSessionRoutePathParams) WithTimeout(timeout time.Duration) *DetailSessionRoutePathParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail session route path params -func (o *DetailSessionRoutePathParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail session route path params -func (o *DetailSessionRoutePathParams) WithContext(ctx context.Context) *DetailSessionRoutePathParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail session route path params -func (o *DetailSessionRoutePathParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail session route path params -func (o *DetailSessionRoutePathParams) WithHTTPClient(client *http.Client) *DetailSessionRoutePathParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail session route path params -func (o *DetailSessionRoutePathParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail session route path params -func (o *DetailSessionRoutePathParams) WithID(id string) *DetailSessionRoutePathParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail session route path params -func (o *DetailSessionRoutePathParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailSessionRoutePathParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/session/detail_session_route_path_responses.go b/rest_management_api_client/session/detail_session_route_path_responses.go deleted file mode 100644 index d930ecec8..000000000 --- a/rest_management_api_client/session/detail_session_route_path_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailSessionRoutePathReader is a Reader for the DetailSessionRoutePath structure. -type DetailSessionRoutePathReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailSessionRoutePathReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailSessionRoutePathOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailSessionRoutePathUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailSessionRoutePathNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailSessionRoutePathOK creates a DetailSessionRoutePathOK with default headers values -func NewDetailSessionRoutePathOK() *DetailSessionRoutePathOK { - return &DetailSessionRoutePathOK{} -} - -/* DetailSessionRoutePathOK describes a response with status code 200, with default header values. - -A single session's route path -*/ -type DetailSessionRoutePathOK struct { - Payload *rest_model.DetailSessionRoutePathEnvelope -} - -func (o *DetailSessionRoutePathOK) Error() string { - return fmt.Sprintf("[GET /sessions/{id}/route-path][%d] detailSessionRoutePathOK %+v", 200, o.Payload) -} -func (o *DetailSessionRoutePathOK) GetPayload() *rest_model.DetailSessionRoutePathEnvelope { - return o.Payload -} - -func (o *DetailSessionRoutePathOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailSessionRoutePathEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailSessionRoutePathUnauthorized creates a DetailSessionRoutePathUnauthorized with default headers values -func NewDetailSessionRoutePathUnauthorized() *DetailSessionRoutePathUnauthorized { - return &DetailSessionRoutePathUnauthorized{} -} - -/* DetailSessionRoutePathUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailSessionRoutePathUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailSessionRoutePathUnauthorized) Error() string { - return fmt.Sprintf("[GET /sessions/{id}/route-path][%d] detailSessionRoutePathUnauthorized %+v", 401, o.Payload) -} -func (o *DetailSessionRoutePathUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailSessionRoutePathUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailSessionRoutePathNotFound creates a DetailSessionRoutePathNotFound with default headers values -func NewDetailSessionRoutePathNotFound() *DetailSessionRoutePathNotFound { - return &DetailSessionRoutePathNotFound{} -} - -/* DetailSessionRoutePathNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailSessionRoutePathNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailSessionRoutePathNotFound) Error() string { - return fmt.Sprintf("[GET /sessions/{id}/route-path][%d] detailSessionRoutePathNotFound %+v", 404, o.Payload) -} -func (o *DetailSessionRoutePathNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailSessionRoutePathNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/session/list_sessions_parameters.go b/rest_management_api_client/session/list_sessions_parameters.go deleted file mode 100644 index b6257b293..000000000 --- a/rest_management_api_client/session/list_sessions_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListSessionsParams creates a new ListSessionsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListSessionsParams() *ListSessionsParams { - return &ListSessionsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListSessionsParamsWithTimeout creates a new ListSessionsParams object -// with the ability to set a timeout on a request. -func NewListSessionsParamsWithTimeout(timeout time.Duration) *ListSessionsParams { - return &ListSessionsParams{ - timeout: timeout, - } -} - -// NewListSessionsParamsWithContext creates a new ListSessionsParams object -// with the ability to set a context for a request. -func NewListSessionsParamsWithContext(ctx context.Context) *ListSessionsParams { - return &ListSessionsParams{ - Context: ctx, - } -} - -// NewListSessionsParamsWithHTTPClient creates a new ListSessionsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListSessionsParamsWithHTTPClient(client *http.Client) *ListSessionsParams { - return &ListSessionsParams{ - HTTPClient: client, - } -} - -/* ListSessionsParams contains all the parameters to send to the API endpoint - for the list sessions operation. - - Typically these are written to a http.Request. -*/ -type ListSessionsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSessionsParams) WithDefaults() *ListSessionsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list sessions params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListSessionsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list sessions params -func (o *ListSessionsParams) WithTimeout(timeout time.Duration) *ListSessionsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list sessions params -func (o *ListSessionsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list sessions params -func (o *ListSessionsParams) WithContext(ctx context.Context) *ListSessionsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list sessions params -func (o *ListSessionsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list sessions params -func (o *ListSessionsParams) WithHTTPClient(client *http.Client) *ListSessionsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list sessions params -func (o *ListSessionsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list sessions params -func (o *ListSessionsParams) WithFilter(filter *string) *ListSessionsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list sessions params -func (o *ListSessionsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list sessions params -func (o *ListSessionsParams) WithLimit(limit *int64) *ListSessionsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list sessions params -func (o *ListSessionsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list sessions params -func (o *ListSessionsParams) WithOffset(offset *int64) *ListSessionsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list sessions params -func (o *ListSessionsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListSessionsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/session/list_sessions_responses.go b/rest_management_api_client/session/list_sessions_responses.go deleted file mode 100644 index 4a3d60980..000000000 --- a/rest_management_api_client/session/list_sessions_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListSessionsReader is a Reader for the ListSessions structure. -type ListSessionsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListSessionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListSessionsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListSessionsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListSessionsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListSessionsOK creates a ListSessionsOK with default headers values -func NewListSessionsOK() *ListSessionsOK { - return &ListSessionsOK{} -} - -/* ListSessionsOK describes a response with status code 200, with default header values. - -A list of sessions -*/ -type ListSessionsOK struct { - Payload *rest_model.ListSessionsManagementEnvelope -} - -func (o *ListSessionsOK) Error() string { - return fmt.Sprintf("[GET /sessions][%d] listSessionsOK %+v", 200, o.Payload) -} -func (o *ListSessionsOK) GetPayload() *rest_model.ListSessionsManagementEnvelope { - return o.Payload -} - -func (o *ListSessionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListSessionsManagementEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListSessionsBadRequest creates a ListSessionsBadRequest with default headers values -func NewListSessionsBadRequest() *ListSessionsBadRequest { - return &ListSessionsBadRequest{} -} - -/* ListSessionsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListSessionsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListSessionsBadRequest) Error() string { - return fmt.Sprintf("[GET /sessions][%d] listSessionsBadRequest %+v", 400, o.Payload) -} -func (o *ListSessionsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListSessionsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListSessionsUnauthorized creates a ListSessionsUnauthorized with default headers values -func NewListSessionsUnauthorized() *ListSessionsUnauthorized { - return &ListSessionsUnauthorized{} -} - -/* ListSessionsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListSessionsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListSessionsUnauthorized) Error() string { - return fmt.Sprintf("[GET /sessions][%d] listSessionsUnauthorized %+v", 401, o.Payload) -} -func (o *ListSessionsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListSessionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/session/session_client.go b/rest_management_api_client/session/session_client.go deleted file mode 100644 index 60d30cf8d..000000000 --- a/rest_management_api_client/session/session_client.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new session API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for session API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionOK, error) - - DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionOK, error) - - DetailSessionRoutePath(params *DetailSessionRoutePathParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionRoutePathOK, error) - - ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSessionsOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - DeleteSession deletes a session - - Delete a session by id. Requires admin access. -*/ -func (a *Client) DeleteSession(params *DeleteSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteSessionParams() - } - op := &runtime.ClientOperation{ - ID: "deleteSession", - Method: "DELETE", - PathPattern: "/sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailSession retrieves a single session - - Retrieves a single session by id. Requires admin access. -*/ -func (a *Client) DetailSession(params *DetailSessionParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSessionParams() - } - op := &runtime.ClientOperation{ - ID: "detailSession", - Method: "GET", - PathPattern: "/sessions/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSessionReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSessionOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSession: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailSessionRoutePath retrieves a single session s router path - - Retrieves a single session's route path by id. Requires admin access. -*/ -func (a *Client) DetailSessionRoutePath(params *DetailSessionRoutePathParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailSessionRoutePathOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailSessionRoutePathParams() - } - op := &runtime.ClientOperation{ - ID: "detailSessionRoutePath", - Method: "GET", - PathPattern: "/sessions/{id}/route-path", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailSessionRoutePathReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailSessionRoutePathOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailSessionRoutePath: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListSessions lists sessions - - Retrieves a list of active sessions resources; supports filtering, sorting, and pagination. Requires admin access. - -Sessions are tied to an API session and are moved when an API session times out or logs out. Active sessions -(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active. - -*/ -func (a *Client) ListSessions(params *ListSessionsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListSessionsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListSessionsParams() - } - op := &runtime.ClientOperation{ - ID: "listSessions", - Method: "GET", - PathPattern: "/sessions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListSessionsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListSessionsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listSessions: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/terminator/create_terminator_parameters.go b/rest_management_api_client/terminator/create_terminator_parameters.go deleted file mode 100644 index 388b2114e..000000000 --- a/rest_management_api_client/terminator/create_terminator_parameters.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateTerminatorParams creates a new CreateTerminatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateTerminatorParams() *CreateTerminatorParams { - return &CreateTerminatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateTerminatorParamsWithTimeout creates a new CreateTerminatorParams object -// with the ability to set a timeout on a request. -func NewCreateTerminatorParamsWithTimeout(timeout time.Duration) *CreateTerminatorParams { - return &CreateTerminatorParams{ - timeout: timeout, - } -} - -// NewCreateTerminatorParamsWithContext creates a new CreateTerminatorParams object -// with the ability to set a context for a request. -func NewCreateTerminatorParamsWithContext(ctx context.Context) *CreateTerminatorParams { - return &CreateTerminatorParams{ - Context: ctx, - } -} - -// NewCreateTerminatorParamsWithHTTPClient creates a new CreateTerminatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateTerminatorParamsWithHTTPClient(client *http.Client) *CreateTerminatorParams { - return &CreateTerminatorParams{ - HTTPClient: client, - } -} - -/* CreateTerminatorParams contains all the parameters to send to the API endpoint - for the create terminator operation. - - Typically these are written to a http.Request. -*/ -type CreateTerminatorParams struct { - - /* Terminator. - - A terminator to create - */ - Terminator *rest_model.TerminatorCreate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTerminatorParams) WithDefaults() *CreateTerminatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateTerminatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create terminator params -func (o *CreateTerminatorParams) WithTimeout(timeout time.Duration) *CreateTerminatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create terminator params -func (o *CreateTerminatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create terminator params -func (o *CreateTerminatorParams) WithContext(ctx context.Context) *CreateTerminatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create terminator params -func (o *CreateTerminatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create terminator params -func (o *CreateTerminatorParams) WithHTTPClient(client *http.Client) *CreateTerminatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create terminator params -func (o *CreateTerminatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithTerminator adds the terminator to the create terminator params -func (o *CreateTerminatorParams) WithTerminator(terminator *rest_model.TerminatorCreate) *CreateTerminatorParams { - o.SetTerminator(terminator) - return o -} - -// SetTerminator adds the terminator to the create terminator params -func (o *CreateTerminatorParams) SetTerminator(terminator *rest_model.TerminatorCreate) { - o.Terminator = terminator -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Terminator != nil { - if err := r.SetBodyParam(o.Terminator); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/terminator/create_terminator_responses.go b/rest_management_api_client/terminator/create_terminator_responses.go deleted file mode 100644 index 1c7117ab8..000000000 --- a/rest_management_api_client/terminator/create_terminator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// CreateTerminatorReader is a Reader for the CreateTerminator structure. -type CreateTerminatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateTerminatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateTerminatorCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateTerminatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateTerminatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewCreateTerminatorCreated creates a CreateTerminatorCreated with default headers values -func NewCreateTerminatorCreated() *CreateTerminatorCreated { - return &CreateTerminatorCreated{} -} - -/* CreateTerminatorCreated describes a response with status code 201, with default header values. - -The create request was successful and the resource has been added at the following location -*/ -type CreateTerminatorCreated struct { - Payload *rest_model.CreateEnvelope -} - -func (o *CreateTerminatorCreated) Error() string { - return fmt.Sprintf("[POST /terminators][%d] createTerminatorCreated %+v", 201, o.Payload) -} -func (o *CreateTerminatorCreated) GetPayload() *rest_model.CreateEnvelope { - return o.Payload -} - -func (o *CreateTerminatorCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.CreateEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTerminatorBadRequest creates a CreateTerminatorBadRequest with default headers values -func NewCreateTerminatorBadRequest() *CreateTerminatorBadRequest { - return &CreateTerminatorBadRequest{} -} - -/* CreateTerminatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type CreateTerminatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateTerminatorBadRequest) Error() string { - return fmt.Sprintf("[POST /terminators][%d] createTerminatorBadRequest %+v", 400, o.Payload) -} -func (o *CreateTerminatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateTerminatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateTerminatorUnauthorized creates a CreateTerminatorUnauthorized with default headers values -func NewCreateTerminatorUnauthorized() *CreateTerminatorUnauthorized { - return &CreateTerminatorUnauthorized{} -} - -/* CreateTerminatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type CreateTerminatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *CreateTerminatorUnauthorized) Error() string { - return fmt.Sprintf("[POST /terminators][%d] createTerminatorUnauthorized %+v", 401, o.Payload) -} -func (o *CreateTerminatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *CreateTerminatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/terminator/delete_terminator_parameters.go b/rest_management_api_client/terminator/delete_terminator_parameters.go deleted file mode 100644 index 1a5682ed5..000000000 --- a/rest_management_api_client/terminator/delete_terminator_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteTerminatorParams creates a new DeleteTerminatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteTerminatorParams() *DeleteTerminatorParams { - return &DeleteTerminatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteTerminatorParamsWithTimeout creates a new DeleteTerminatorParams object -// with the ability to set a timeout on a request. -func NewDeleteTerminatorParamsWithTimeout(timeout time.Duration) *DeleteTerminatorParams { - return &DeleteTerminatorParams{ - timeout: timeout, - } -} - -// NewDeleteTerminatorParamsWithContext creates a new DeleteTerminatorParams object -// with the ability to set a context for a request. -func NewDeleteTerminatorParamsWithContext(ctx context.Context) *DeleteTerminatorParams { - return &DeleteTerminatorParams{ - Context: ctx, - } -} - -// NewDeleteTerminatorParamsWithHTTPClient creates a new DeleteTerminatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteTerminatorParamsWithHTTPClient(client *http.Client) *DeleteTerminatorParams { - return &DeleteTerminatorParams{ - HTTPClient: client, - } -} - -/* DeleteTerminatorParams contains all the parameters to send to the API endpoint - for the delete terminator operation. - - Typically these are written to a http.Request. -*/ -type DeleteTerminatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteTerminatorParams) WithDefaults() *DeleteTerminatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteTerminatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete terminator params -func (o *DeleteTerminatorParams) WithTimeout(timeout time.Duration) *DeleteTerminatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete terminator params -func (o *DeleteTerminatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete terminator params -func (o *DeleteTerminatorParams) WithContext(ctx context.Context) *DeleteTerminatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete terminator params -func (o *DeleteTerminatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete terminator params -func (o *DeleteTerminatorParams) WithHTTPClient(client *http.Client) *DeleteTerminatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete terminator params -func (o *DeleteTerminatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the delete terminator params -func (o *DeleteTerminatorParams) WithID(id string) *DeleteTerminatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the delete terminator params -func (o *DeleteTerminatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/terminator/delete_terminator_responses.go b/rest_management_api_client/terminator/delete_terminator_responses.go deleted file mode 100644 index f3e07ef75..000000000 --- a/rest_management_api_client/terminator/delete_terminator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DeleteTerminatorReader is a Reader for the DeleteTerminator structure. -type DeleteTerminatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteTerminatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDeleteTerminatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteTerminatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewDeleteTerminatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteTerminatorConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDeleteTerminatorOK creates a DeleteTerminatorOK with default headers values -func NewDeleteTerminatorOK() *DeleteTerminatorOK { - return &DeleteTerminatorOK{} -} - -/* DeleteTerminatorOK describes a response with status code 200, with default header values. - -The delete request was successful and the resource has been removed -*/ -type DeleteTerminatorOK struct { - Payload *rest_model.Empty -} - -func (o *DeleteTerminatorOK) Error() string { - return fmt.Sprintf("[DELETE /terminators/{id}][%d] deleteTerminatorOK %+v", 200, o.Payload) -} -func (o *DeleteTerminatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *DeleteTerminatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteTerminatorBadRequest creates a DeleteTerminatorBadRequest with default headers values -func NewDeleteTerminatorBadRequest() *DeleteTerminatorBadRequest { - return &DeleteTerminatorBadRequest{} -} - -/* DeleteTerminatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type DeleteTerminatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteTerminatorBadRequest) Error() string { - return fmt.Sprintf("[DELETE /terminators/{id}][%d] deleteTerminatorBadRequest %+v", 400, o.Payload) -} -func (o *DeleteTerminatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteTerminatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteTerminatorUnauthorized creates a DeleteTerminatorUnauthorized with default headers values -func NewDeleteTerminatorUnauthorized() *DeleteTerminatorUnauthorized { - return &DeleteTerminatorUnauthorized{} -} - -/* DeleteTerminatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DeleteTerminatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteTerminatorUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /terminators/{id}][%d] deleteTerminatorUnauthorized %+v", 401, o.Payload) -} -func (o *DeleteTerminatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteTerminatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteTerminatorConflict creates a DeleteTerminatorConflict with default headers values -func NewDeleteTerminatorConflict() *DeleteTerminatorConflict { - return &DeleteTerminatorConflict{} -} - -/* DeleteTerminatorConflict describes a response with status code 409, with default header values. - -The resource requested to be removed/altered cannot be as it is referenced by another object. -*/ -type DeleteTerminatorConflict struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DeleteTerminatorConflict) Error() string { - return fmt.Sprintf("[DELETE /terminators/{id}][%d] deleteTerminatorConflict %+v", 409, o.Payload) -} -func (o *DeleteTerminatorConflict) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DeleteTerminatorConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/terminator/detail_terminator_parameters.go b/rest_management_api_client/terminator/detail_terminator_parameters.go deleted file mode 100644 index d4f86df30..000000000 --- a/rest_management_api_client/terminator/detail_terminator_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDetailTerminatorParams creates a new DetailTerminatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDetailTerminatorParams() *DetailTerminatorParams { - return &DetailTerminatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDetailTerminatorParamsWithTimeout creates a new DetailTerminatorParams object -// with the ability to set a timeout on a request. -func NewDetailTerminatorParamsWithTimeout(timeout time.Duration) *DetailTerminatorParams { - return &DetailTerminatorParams{ - timeout: timeout, - } -} - -// NewDetailTerminatorParamsWithContext creates a new DetailTerminatorParams object -// with the ability to set a context for a request. -func NewDetailTerminatorParamsWithContext(ctx context.Context) *DetailTerminatorParams { - return &DetailTerminatorParams{ - Context: ctx, - } -} - -// NewDetailTerminatorParamsWithHTTPClient creates a new DetailTerminatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewDetailTerminatorParamsWithHTTPClient(client *http.Client) *DetailTerminatorParams { - return &DetailTerminatorParams{ - HTTPClient: client, - } -} - -/* DetailTerminatorParams contains all the parameters to send to the API endpoint - for the detail terminator operation. - - Typically these are written to a http.Request. -*/ -type DetailTerminatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the detail terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailTerminatorParams) WithDefaults() *DetailTerminatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the detail terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DetailTerminatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the detail terminator params -func (o *DetailTerminatorParams) WithTimeout(timeout time.Duration) *DetailTerminatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the detail terminator params -func (o *DetailTerminatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the detail terminator params -func (o *DetailTerminatorParams) WithContext(ctx context.Context) *DetailTerminatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the detail terminator params -func (o *DetailTerminatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the detail terminator params -func (o *DetailTerminatorParams) WithHTTPClient(client *http.Client) *DetailTerminatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the detail terminator params -func (o *DetailTerminatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the detail terminator params -func (o *DetailTerminatorParams) WithID(id string) *DetailTerminatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the detail terminator params -func (o *DetailTerminatorParams) SetID(id string) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DetailTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/terminator/detail_terminator_responses.go b/rest_management_api_client/terminator/detail_terminator_responses.go deleted file mode 100644 index 8fc60ee11..000000000 --- a/rest_management_api_client/terminator/detail_terminator_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// DetailTerminatorReader is a Reader for the DetailTerminator structure. -type DetailTerminatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DetailTerminatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDetailTerminatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewDetailTerminatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDetailTerminatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewDetailTerminatorOK creates a DetailTerminatorOK with default headers values -func NewDetailTerminatorOK() *DetailTerminatorOK { - return &DetailTerminatorOK{} -} - -/* DetailTerminatorOK describes a response with status code 200, with default header values. - -A single terminator -*/ -type DetailTerminatorOK struct { - Payload *rest_model.DetailTerminatorEnvelope -} - -func (o *DetailTerminatorOK) Error() string { - return fmt.Sprintf("[GET /terminators/{id}][%d] detailTerminatorOK %+v", 200, o.Payload) -} -func (o *DetailTerminatorOK) GetPayload() *rest_model.DetailTerminatorEnvelope { - return o.Payload -} - -func (o *DetailTerminatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.DetailTerminatorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailTerminatorUnauthorized creates a DetailTerminatorUnauthorized with default headers values -func NewDetailTerminatorUnauthorized() *DetailTerminatorUnauthorized { - return &DetailTerminatorUnauthorized{} -} - -/* DetailTerminatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type DetailTerminatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailTerminatorUnauthorized) Error() string { - return fmt.Sprintf("[GET /terminators/{id}][%d] detailTerminatorUnauthorized %+v", 401, o.Payload) -} -func (o *DetailTerminatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailTerminatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDetailTerminatorNotFound creates a DetailTerminatorNotFound with default headers values -func NewDetailTerminatorNotFound() *DetailTerminatorNotFound { - return &DetailTerminatorNotFound{} -} - -/* DetailTerminatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type DetailTerminatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *DetailTerminatorNotFound) Error() string { - return fmt.Sprintf("[GET /terminators/{id}][%d] detailTerminatorNotFound %+v", 404, o.Payload) -} -func (o *DetailTerminatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *DetailTerminatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/terminator/list_terminators_parameters.go b/rest_management_api_client/terminator/list_terminators_parameters.go deleted file mode 100644 index fd7777db3..000000000 --- a/rest_management_api_client/terminator/list_terminators_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListTerminatorsParams creates a new ListTerminatorsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListTerminatorsParams() *ListTerminatorsParams { - return &ListTerminatorsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListTerminatorsParamsWithTimeout creates a new ListTerminatorsParams object -// with the ability to set a timeout on a request. -func NewListTerminatorsParamsWithTimeout(timeout time.Duration) *ListTerminatorsParams { - return &ListTerminatorsParams{ - timeout: timeout, - } -} - -// NewListTerminatorsParamsWithContext creates a new ListTerminatorsParams object -// with the ability to set a context for a request. -func NewListTerminatorsParamsWithContext(ctx context.Context) *ListTerminatorsParams { - return &ListTerminatorsParams{ - Context: ctx, - } -} - -// NewListTerminatorsParamsWithHTTPClient creates a new ListTerminatorsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListTerminatorsParamsWithHTTPClient(client *http.Client) *ListTerminatorsParams { - return &ListTerminatorsParams{ - HTTPClient: client, - } -} - -/* ListTerminatorsParams contains all the parameters to send to the API endpoint - for the list terminators operation. - - Typically these are written to a http.Request. -*/ -type ListTerminatorsParams struct { - - // Filter. - Filter *string - - // Limit. - Limit *int64 - - // Offset. - Offset *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list terminators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTerminatorsParams) WithDefaults() *ListTerminatorsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list terminators params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListTerminatorsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list terminators params -func (o *ListTerminatorsParams) WithTimeout(timeout time.Duration) *ListTerminatorsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list terminators params -func (o *ListTerminatorsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list terminators params -func (o *ListTerminatorsParams) WithContext(ctx context.Context) *ListTerminatorsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list terminators params -func (o *ListTerminatorsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list terminators params -func (o *ListTerminatorsParams) WithHTTPClient(client *http.Client) *ListTerminatorsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list terminators params -func (o *ListTerminatorsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFilter adds the filter to the list terminators params -func (o *ListTerminatorsParams) WithFilter(filter *string) *ListTerminatorsParams { - o.SetFilter(filter) - return o -} - -// SetFilter adds the filter to the list terminators params -func (o *ListTerminatorsParams) SetFilter(filter *string) { - o.Filter = filter -} - -// WithLimit adds the limit to the list terminators params -func (o *ListTerminatorsParams) WithLimit(limit *int64) *ListTerminatorsParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the list terminators params -func (o *ListTerminatorsParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the list terminators params -func (o *ListTerminatorsParams) WithOffset(offset *int64) *ListTerminatorsParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the list terminators params -func (o *ListTerminatorsParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WriteToRequest writes these params to a swagger request -func (o *ListTerminatorsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Filter != nil { - - // query param filter - var qrFilter string - - if o.Filter != nil { - qrFilter = *o.Filter - } - qFilter := qrFilter - if qFilter != "" { - - if err := r.SetQueryParam("filter", qFilter); err != nil { - return err - } - } - } - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/terminator/list_terminators_responses.go b/rest_management_api_client/terminator/list_terminators_responses.go deleted file mode 100644 index 9b97daff1..000000000 --- a/rest_management_api_client/terminator/list_terminators_responses.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// ListTerminatorsReader is a Reader for the ListTerminators structure. -type ListTerminatorsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListTerminatorsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListTerminatorsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListTerminatorsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListTerminatorsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewListTerminatorsOK creates a ListTerminatorsOK with default headers values -func NewListTerminatorsOK() *ListTerminatorsOK { - return &ListTerminatorsOK{} -} - -/* ListTerminatorsOK describes a response with status code 200, with default header values. - -A list of terminators -*/ -type ListTerminatorsOK struct { - Payload *rest_model.ListTerminatorsEnvelope -} - -func (o *ListTerminatorsOK) Error() string { - return fmt.Sprintf("[GET /terminators][%d] listTerminatorsOK %+v", 200, o.Payload) -} -func (o *ListTerminatorsOK) GetPayload() *rest_model.ListTerminatorsEnvelope { - return o.Payload -} - -func (o *ListTerminatorsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.ListTerminatorsEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListTerminatorsBadRequest creates a ListTerminatorsBadRequest with default headers values -func NewListTerminatorsBadRequest() *ListTerminatorsBadRequest { - return &ListTerminatorsBadRequest{} -} - -/* ListTerminatorsBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type ListTerminatorsBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListTerminatorsBadRequest) Error() string { - return fmt.Sprintf("[GET /terminators][%d] listTerminatorsBadRequest %+v", 400, o.Payload) -} -func (o *ListTerminatorsBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListTerminatorsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListTerminatorsUnauthorized creates a ListTerminatorsUnauthorized with default headers values -func NewListTerminatorsUnauthorized() *ListTerminatorsUnauthorized { - return &ListTerminatorsUnauthorized{} -} - -/* ListTerminatorsUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type ListTerminatorsUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *ListTerminatorsUnauthorized) Error() string { - return fmt.Sprintf("[GET /terminators][%d] listTerminatorsUnauthorized %+v", 401, o.Payload) -} -func (o *ListTerminatorsUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *ListTerminatorsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/terminator/patch_terminator_parameters.go b/rest_management_api_client/terminator/patch_terminator_parameters.go deleted file mode 100644 index 216b08369..000000000 --- a/rest_management_api_client/terminator/patch_terminator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchTerminatorParams creates a new PatchTerminatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewPatchTerminatorParams() *PatchTerminatorParams { - return &PatchTerminatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewPatchTerminatorParamsWithTimeout creates a new PatchTerminatorParams object -// with the ability to set a timeout on a request. -func NewPatchTerminatorParamsWithTimeout(timeout time.Duration) *PatchTerminatorParams { - return &PatchTerminatorParams{ - timeout: timeout, - } -} - -// NewPatchTerminatorParamsWithContext creates a new PatchTerminatorParams object -// with the ability to set a context for a request. -func NewPatchTerminatorParamsWithContext(ctx context.Context) *PatchTerminatorParams { - return &PatchTerminatorParams{ - Context: ctx, - } -} - -// NewPatchTerminatorParamsWithHTTPClient creates a new PatchTerminatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewPatchTerminatorParamsWithHTTPClient(client *http.Client) *PatchTerminatorParams { - return &PatchTerminatorParams{ - HTTPClient: client, - } -} - -/* PatchTerminatorParams contains all the parameters to send to the API endpoint - for the patch terminator operation. - - Typically these are written to a http.Request. -*/ -type PatchTerminatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Terminator. - - A terminator patch object - */ - Terminator *rest_model.TerminatorPatch - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the patch terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchTerminatorParams) WithDefaults() *PatchTerminatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the patch terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *PatchTerminatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the patch terminator params -func (o *PatchTerminatorParams) WithTimeout(timeout time.Duration) *PatchTerminatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the patch terminator params -func (o *PatchTerminatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the patch terminator params -func (o *PatchTerminatorParams) WithContext(ctx context.Context) *PatchTerminatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the patch terminator params -func (o *PatchTerminatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the patch terminator params -func (o *PatchTerminatorParams) WithHTTPClient(client *http.Client) *PatchTerminatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the patch terminator params -func (o *PatchTerminatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the patch terminator params -func (o *PatchTerminatorParams) WithID(id string) *PatchTerminatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the patch terminator params -func (o *PatchTerminatorParams) SetID(id string) { - o.ID = id -} - -// WithTerminator adds the terminator to the patch terminator params -func (o *PatchTerminatorParams) WithTerminator(terminator *rest_model.TerminatorPatch) *PatchTerminatorParams { - o.SetTerminator(terminator) - return o -} - -// SetTerminator adds the terminator to the patch terminator params -func (o *PatchTerminatorParams) SetTerminator(terminator *rest_model.TerminatorPatch) { - o.Terminator = terminator -} - -// WriteToRequest writes these params to a swagger request -func (o *PatchTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Terminator != nil { - if err := r.SetBodyParam(o.Terminator); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/terminator/patch_terminator_responses.go b/rest_management_api_client/terminator/patch_terminator_responses.go deleted file mode 100644 index 64eaf0ece..000000000 --- a/rest_management_api_client/terminator/patch_terminator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// PatchTerminatorReader is a Reader for the PatchTerminator structure. -type PatchTerminatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *PatchTerminatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewPatchTerminatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewPatchTerminatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewPatchTerminatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewPatchTerminatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewPatchTerminatorOK creates a PatchTerminatorOK with default headers values -func NewPatchTerminatorOK() *PatchTerminatorOK { - return &PatchTerminatorOK{} -} - -/* PatchTerminatorOK describes a response with status code 200, with default header values. - -The patch request was successful and the resource has been altered -*/ -type PatchTerminatorOK struct { - Payload *rest_model.Empty -} - -func (o *PatchTerminatorOK) Error() string { - return fmt.Sprintf("[PATCH /terminators/{id}][%d] patchTerminatorOK %+v", 200, o.Payload) -} -func (o *PatchTerminatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *PatchTerminatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchTerminatorBadRequest creates a PatchTerminatorBadRequest with default headers values -func NewPatchTerminatorBadRequest() *PatchTerminatorBadRequest { - return &PatchTerminatorBadRequest{} -} - -/* PatchTerminatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type PatchTerminatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchTerminatorBadRequest) Error() string { - return fmt.Sprintf("[PATCH /terminators/{id}][%d] patchTerminatorBadRequest %+v", 400, o.Payload) -} -func (o *PatchTerminatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchTerminatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchTerminatorUnauthorized creates a PatchTerminatorUnauthorized with default headers values -func NewPatchTerminatorUnauthorized() *PatchTerminatorUnauthorized { - return &PatchTerminatorUnauthorized{} -} - -/* PatchTerminatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type PatchTerminatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchTerminatorUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /terminators/{id}][%d] patchTerminatorUnauthorized %+v", 401, o.Payload) -} -func (o *PatchTerminatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchTerminatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewPatchTerminatorNotFound creates a PatchTerminatorNotFound with default headers values -func NewPatchTerminatorNotFound() *PatchTerminatorNotFound { - return &PatchTerminatorNotFound{} -} - -/* PatchTerminatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type PatchTerminatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *PatchTerminatorNotFound) Error() string { - return fmt.Sprintf("[PATCH /terminators/{id}][%d] patchTerminatorNotFound %+v", 404, o.Payload) -} -func (o *PatchTerminatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *PatchTerminatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/terminator/terminator_client.go b/rest_management_api_client/terminator/terminator_client.go deleted file mode 100644 index 0a9acbb89..000000000 --- a/rest_management_api_client/terminator/terminator_client.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new terminator API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for terminator API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateTerminator(params *CreateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTerminatorCreated, error) - - DeleteTerminator(params *DeleteTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTerminatorOK, error) - - DetailTerminator(params *DetailTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailTerminatorOK, error) - - ListTerminators(params *ListTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTerminatorsOK, error) - - PatchTerminator(params *PatchTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchTerminatorOK, error) - - UpdateTerminator(params *UpdateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTerminatorOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateTerminator creates a terminator resource - - Create a terminator resource. Requires admin access. -*/ -func (a *Client) CreateTerminator(params *CreateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateTerminatorCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateTerminatorParams() - } - op := &runtime.ClientOperation{ - ID: "createTerminator", - Method: "POST", - PathPattern: "/terminators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &CreateTerminatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateTerminatorCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createTerminator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteTerminator deletes a terminator - - Delete a terminator by id. Requires admin access. -*/ -func (a *Client) DeleteTerminator(params *DeleteTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteTerminatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteTerminatorParams() - } - op := &runtime.ClientOperation{ - ID: "deleteTerminator", - Method: "DELETE", - PathPattern: "/terminators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DeleteTerminatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteTerminatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteTerminator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DetailTerminator retrieves a single terminator - - Retrieves a single terminator by id. Requires admin access. -*/ -func (a *Client) DetailTerminator(params *DetailTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailTerminatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDetailTerminatorParams() - } - op := &runtime.ClientOperation{ - ID: "detailTerminator", - Method: "GET", - PathPattern: "/terminators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &DetailTerminatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DetailTerminatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for detailTerminator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListTerminators lists terminators - - Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -func (a *Client) ListTerminators(params *ListTerminatorsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListTerminatorsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListTerminatorsParams() - } - op := &runtime.ClientOperation{ - ID: "listTerminators", - Method: "GET", - PathPattern: "/terminators", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &ListTerminatorsReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListTerminatorsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listTerminators: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - PatchTerminator updates the supplied fields on a terminator - - Update the supplied fields on a terminator. Requires admin access. -*/ -func (a *Client) PatchTerminator(params *PatchTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchTerminatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewPatchTerminatorParams() - } - op := &runtime.ClientOperation{ - ID: "patchTerminator", - Method: "PATCH", - PathPattern: "/terminators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &PatchTerminatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*PatchTerminatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for patchTerminator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateTerminator updates all fields on a terminator - - Update all fields on a terminator by id. Requires admin access. -*/ -func (a *Client) UpdateTerminator(params *UpdateTerminatorParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateTerminatorOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateTerminatorParams() - } - op := &runtime.ClientOperation{ - ID: "updateTerminator", - Method: "PUT", - PathPattern: "/terminators/{id}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"https"}, - Params: params, - Reader: &UpdateTerminatorReader{formats: a.formats}, - AuthInfo: authInfo, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateTerminatorOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateTerminator: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/rest_management_api_client/terminator/update_terminator_parameters.go b/rest_management_api_client/terminator/update_terminator_parameters.go deleted file mode 100644 index 025f291dc..000000000 --- a/rest_management_api_client/terminator/update_terminator_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateTerminatorParams creates a new UpdateTerminatorParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateTerminatorParams() *UpdateTerminatorParams { - return &UpdateTerminatorParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateTerminatorParamsWithTimeout creates a new UpdateTerminatorParams object -// with the ability to set a timeout on a request. -func NewUpdateTerminatorParamsWithTimeout(timeout time.Duration) *UpdateTerminatorParams { - return &UpdateTerminatorParams{ - timeout: timeout, - } -} - -// NewUpdateTerminatorParamsWithContext creates a new UpdateTerminatorParams object -// with the ability to set a context for a request. -func NewUpdateTerminatorParamsWithContext(ctx context.Context) *UpdateTerminatorParams { - return &UpdateTerminatorParams{ - Context: ctx, - } -} - -// NewUpdateTerminatorParamsWithHTTPClient creates a new UpdateTerminatorParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateTerminatorParamsWithHTTPClient(client *http.Client) *UpdateTerminatorParams { - return &UpdateTerminatorParams{ - HTTPClient: client, - } -} - -/* UpdateTerminatorParams contains all the parameters to send to the API endpoint - for the update terminator operation. - - Typically these are written to a http.Request. -*/ -type UpdateTerminatorParams struct { - - /* ID. - - The id of the requested resource - */ - ID string - - /* Terminator. - - A terminator update object - */ - Terminator *rest_model.TerminatorUpdate - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTerminatorParams) WithDefaults() *UpdateTerminatorParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update terminator params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateTerminatorParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update terminator params -func (o *UpdateTerminatorParams) WithTimeout(timeout time.Duration) *UpdateTerminatorParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update terminator params -func (o *UpdateTerminatorParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update terminator params -func (o *UpdateTerminatorParams) WithContext(ctx context.Context) *UpdateTerminatorParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update terminator params -func (o *UpdateTerminatorParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update terminator params -func (o *UpdateTerminatorParams) WithHTTPClient(client *http.Client) *UpdateTerminatorParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update terminator params -func (o *UpdateTerminatorParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the update terminator params -func (o *UpdateTerminatorParams) WithID(id string) *UpdateTerminatorParams { - o.SetID(id) - return o -} - -// SetID adds the id to the update terminator params -func (o *UpdateTerminatorParams) SetID(id string) { - o.ID = id -} - -// WithTerminator adds the terminator to the update terminator params -func (o *UpdateTerminatorParams) WithTerminator(terminator *rest_model.TerminatorUpdate) *UpdateTerminatorParams { - o.SetTerminator(terminator) - return o -} - -// SetTerminator adds the terminator to the update terminator params -func (o *UpdateTerminatorParams) SetTerminator(terminator *rest_model.TerminatorUpdate) { - o.Terminator = terminator -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateTerminatorParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", o.ID); err != nil { - return err - } - if o.Terminator != nil { - if err := r.SetBodyParam(o.Terminator); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_client/terminator/update_terminator_responses.go b/rest_management_api_client/terminator/update_terminator_responses.go deleted file mode 100644 index 7ef00fcb0..000000000 --- a/rest_management_api_client/terminator/update_terminator_responses.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_model" -) - -// UpdateTerminatorReader is a Reader for the UpdateTerminator structure. -type UpdateTerminatorReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateTerminatorReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateTerminatorOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateTerminatorBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateTerminatorUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateTerminatorNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) - } -} - -// NewUpdateTerminatorOK creates a UpdateTerminatorOK with default headers values -func NewUpdateTerminatorOK() *UpdateTerminatorOK { - return &UpdateTerminatorOK{} -} - -/* UpdateTerminatorOK describes a response with status code 200, with default header values. - -The update request was successful and the resource has been altered -*/ -type UpdateTerminatorOK struct { - Payload *rest_model.Empty -} - -func (o *UpdateTerminatorOK) Error() string { - return fmt.Sprintf("[PUT /terminators/{id}][%d] updateTerminatorOK %+v", 200, o.Payload) -} -func (o *UpdateTerminatorOK) GetPayload() *rest_model.Empty { - return o.Payload -} - -func (o *UpdateTerminatorOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.Empty) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTerminatorBadRequest creates a UpdateTerminatorBadRequest with default headers values -func NewUpdateTerminatorBadRequest() *UpdateTerminatorBadRequest { - return &UpdateTerminatorBadRequest{} -} - -/* UpdateTerminatorBadRequest describes a response with status code 400, with default header values. - -The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information -*/ -type UpdateTerminatorBadRequest struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateTerminatorBadRequest) Error() string { - return fmt.Sprintf("[PUT /terminators/{id}][%d] updateTerminatorBadRequest %+v", 400, o.Payload) -} -func (o *UpdateTerminatorBadRequest) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateTerminatorBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTerminatorUnauthorized creates a UpdateTerminatorUnauthorized with default headers values -func NewUpdateTerminatorUnauthorized() *UpdateTerminatorUnauthorized { - return &UpdateTerminatorUnauthorized{} -} - -/* UpdateTerminatorUnauthorized describes a response with status code 401, with default header values. - -The currently supplied session does not have the correct access rights to request this resource -*/ -type UpdateTerminatorUnauthorized struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateTerminatorUnauthorized) Error() string { - return fmt.Sprintf("[PUT /terminators/{id}][%d] updateTerminatorUnauthorized %+v", 401, o.Payload) -} -func (o *UpdateTerminatorUnauthorized) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateTerminatorUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateTerminatorNotFound creates a UpdateTerminatorNotFound with default headers values -func NewUpdateTerminatorNotFound() *UpdateTerminatorNotFound { - return &UpdateTerminatorNotFound{} -} - -/* UpdateTerminatorNotFound describes a response with status code 404, with default header values. - -The requested resource does not exist -*/ -type UpdateTerminatorNotFound struct { - Payload *rest_model.APIErrorEnvelope -} - -func (o *UpdateTerminatorNotFound) Error() string { - return fmt.Sprintf("[PUT /terminators/{id}][%d] updateTerminatorNotFound %+v", 404, o.Payload) -} -func (o *UpdateTerminatorNotFound) GetPayload() *rest_model.APIErrorEnvelope { - return o.Payload -} - -func (o *UpdateTerminatorNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(rest_model.APIErrorEnvelope) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/rest_management_api_client/ziti_edge_management_client.go b/rest_management_api_client/ziti_edge_management_client.go deleted file mode 100644 index d581a120f..000000000 --- a/rest_management_api_client/ziti_edge_management_client.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_management_api_client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/openziti/edge/rest_management_api_client/api_session" - "github.com/openziti/edge/rest_management_api_client/auth_policy" - "github.com/openziti/edge/rest_management_api_client/authentication" - "github.com/openziti/edge/rest_management_api_client/authenticator" - "github.com/openziti/edge/rest_management_api_client/certificate_authority" - "github.com/openziti/edge/rest_management_api_client/config" - "github.com/openziti/edge/rest_management_api_client/current_api_session" - "github.com/openziti/edge/rest_management_api_client/current_identity" - "github.com/openziti/edge/rest_management_api_client/database" - "github.com/openziti/edge/rest_management_api_client/edge_router" - "github.com/openziti/edge/rest_management_api_client/edge_router_policy" - "github.com/openziti/edge/rest_management_api_client/enrollment" - "github.com/openziti/edge/rest_management_api_client/external_jwt_signer" - "github.com/openziti/edge/rest_management_api_client/identity" - "github.com/openziti/edge/rest_management_api_client/informational" - "github.com/openziti/edge/rest_management_api_client/posture_checks" - "github.com/openziti/edge/rest_management_api_client/role_attributes" - "github.com/openziti/edge/rest_management_api_client/router" - "github.com/openziti/edge/rest_management_api_client/service" - "github.com/openziti/edge/rest_management_api_client/service_edge_router_policy" - "github.com/openziti/edge/rest_management_api_client/service_policy" - "github.com/openziti/edge/rest_management_api_client/session" - "github.com/openziti/edge/rest_management_api_client/terminator" -) - -// Default ziti edge management HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "demo.ziti.dev" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/edge/management/v1" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"https"} - -// NewHTTPClient creates a new ziti edge management HTTP client. -func NewHTTPClient(formats strfmt.Registry) *ZitiEdgeManagement { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new ziti edge management HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *ZitiEdgeManagement { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new ziti edge management client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *ZitiEdgeManagement { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(ZitiEdgeManagement) - cli.Transport = transport - cli.APISession = api_session.New(transport, formats) - cli.AuthPolicy = auth_policy.New(transport, formats) - cli.Authentication = authentication.New(transport, formats) - cli.Authenticator = authenticator.New(transport, formats) - cli.CertificateAuthority = certificate_authority.New(transport, formats) - cli.Config = config.New(transport, formats) - cli.CurrentAPISession = current_api_session.New(transport, formats) - cli.CurrentIdentity = current_identity.New(transport, formats) - cli.Database = database.New(transport, formats) - cli.EdgeRouter = edge_router.New(transport, formats) - cli.EdgeRouterPolicy = edge_router_policy.New(transport, formats) - cli.Enrollment = enrollment.New(transport, formats) - cli.ExternalJWTSigner = external_jwt_signer.New(transport, formats) - cli.Identity = identity.New(transport, formats) - cli.Informational = informational.New(transport, formats) - cli.PostureChecks = posture_checks.New(transport, formats) - cli.RoleAttributes = role_attributes.New(transport, formats) - cli.Router = router.New(transport, formats) - cli.Service = service.New(transport, formats) - cli.ServiceEdgeRouterPolicy = service_edge_router_policy.New(transport, formats) - cli.ServicePolicy = service_policy.New(transport, formats) - cli.Session = session.New(transport, formats) - cli.Terminator = terminator.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// ZitiEdgeManagement is a client for ziti edge management -type ZitiEdgeManagement struct { - APISession api_session.ClientService - - AuthPolicy auth_policy.ClientService - - Authentication authentication.ClientService - - Authenticator authenticator.ClientService - - CertificateAuthority certificate_authority.ClientService - - Config config.ClientService - - CurrentAPISession current_api_session.ClientService - - CurrentIdentity current_identity.ClientService - - Database database.ClientService - - EdgeRouter edge_router.ClientService - - EdgeRouterPolicy edge_router_policy.ClientService - - Enrollment enrollment.ClientService - - ExternalJWTSigner external_jwt_signer.ClientService - - Identity identity.ClientService - - Informational informational.ClientService - - PostureChecks posture_checks.ClientService - - RoleAttributes role_attributes.ClientService - - Router router.ClientService - - Service service.ClientService - - ServiceEdgeRouterPolicy service_edge_router_policy.ClientService - - ServicePolicy service_policy.ClientService - - Session session.ClientService - - Terminator terminator.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *ZitiEdgeManagement) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.APISession.SetTransport(transport) - c.AuthPolicy.SetTransport(transport) - c.Authentication.SetTransport(transport) - c.Authenticator.SetTransport(transport) - c.CertificateAuthority.SetTransport(transport) - c.Config.SetTransport(transport) - c.CurrentAPISession.SetTransport(transport) - c.CurrentIdentity.SetTransport(transport) - c.Database.SetTransport(transport) - c.EdgeRouter.SetTransport(transport) - c.EdgeRouterPolicy.SetTransport(transport) - c.Enrollment.SetTransport(transport) - c.ExternalJWTSigner.SetTransport(transport) - c.Identity.SetTransport(transport) - c.Informational.SetTransport(transport) - c.PostureChecks.SetTransport(transport) - c.RoleAttributes.SetTransport(transport) - c.Router.SetTransport(transport) - c.Service.SetTransport(transport) - c.ServiceEdgeRouterPolicy.SetTransport(transport) - c.ServicePolicy.SetTransport(transport) - c.Session.SetTransport(transport) - c.Terminator.SetTransport(transport) -} diff --git a/rest_management_api_server/configure_ziti_edge_management.go b/rest_management_api_server/configure_ziti_edge_management.go deleted file mode 100644 index 1b9bb3f2c..000000000 --- a/rest_management_api_server/configure_ziti_edge_management.go +++ /dev/null @@ -1,1044 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_management_api_server - -import ( - "crypto/tls" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/openziti/edge/rest_management_api_server/operations" - "github.com/openziti/edge/rest_management_api_server/operations/api_session" - "github.com/openziti/edge/rest_management_api_server/operations/auth_policy" - "github.com/openziti/edge/rest_management_api_server/operations/authentication" - "github.com/openziti/edge/rest_management_api_server/operations/authenticator" - "github.com/openziti/edge/rest_management_api_server/operations/certificate_authority" - "github.com/openziti/edge/rest_management_api_server/operations/config" - "github.com/openziti/edge/rest_management_api_server/operations/current_api_session" - "github.com/openziti/edge/rest_management_api_server/operations/current_identity" - "github.com/openziti/edge/rest_management_api_server/operations/database" - "github.com/openziti/edge/rest_management_api_server/operations/edge_router" - "github.com/openziti/edge/rest_management_api_server/operations/edge_router_policy" - "github.com/openziti/edge/rest_management_api_server/operations/enrollment" - "github.com/openziti/edge/rest_management_api_server/operations/external_jwt_signer" - "github.com/openziti/edge/rest_management_api_server/operations/identity" - "github.com/openziti/edge/rest_management_api_server/operations/informational" - "github.com/openziti/edge/rest_management_api_server/operations/posture_checks" - "github.com/openziti/edge/rest_management_api_server/operations/role_attributes" - "github.com/openziti/edge/rest_management_api_server/operations/router" - "github.com/openziti/edge/rest_management_api_server/operations/service" - "github.com/openziti/edge/rest_management_api_server/operations/service_edge_router_policy" - "github.com/openziti/edge/rest_management_api_server/operations/service_policy" - "github.com/openziti/edge/rest_management_api_server/operations/session" - "github.com/openziti/edge/rest_management_api_server/operations/terminator" -) - -//go:generate swagger generate server --target ../../edge --name ZitiEdgeManagement --spec ../specs/management.yml --model-package rest_model --server-package rest_management_api_server --principal interface{} --exclude-main - -func configureFlags(api *operations.ZitiEdgeManagementAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *operations.ZitiEdgeManagementAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - api.TxtConsumer = runtime.TextConsumer() - - api.ApplicationJWTProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationJwt producer has not yet been implemented") - }) - api.BinProducer = runtime.ByteStreamProducer() - api.JSONProducer = runtime.JSONProducer() - api.TextYamlProducer = runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("textYaml producer has not yet been implemented") - }) - - // Applies when the "zt-session" header is set - if api.ZtSessionAuth == nil { - api.ZtSessionAuth = func(token string) (interface{}, error) { - return nil, errors.NotImplemented("api key auth (ztSession) zt-session from header param [zt-session] has not yet been implemented") - } - } - - // Set your custom authorizer if needed. Default one is security.Authorized() - // Expected interface runtime.Authorizer - // - // Example: - // api.APIAuthorizer = security.Authorized() - - if api.CurrentAPISessionDeleteCurrentAPISessionHandler == nil { - api.CurrentAPISessionDeleteCurrentAPISessionHandler = current_api_session.DeleteCurrentAPISessionHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISession has not yet been implemented") - }) - } - if api.IdentityAssociateIdentitysServiceConfigsHandler == nil { - api.IdentityAssociateIdentitysServiceConfigsHandler = identity.AssociateIdentitysServiceConfigsHandlerFunc(func(params identity.AssociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.AssociateIdentitysServiceConfigs has not yet been implemented") - }) - } - if api.AuthenticationAuthenticateHandler == nil { - api.AuthenticationAuthenticateHandler = authentication.AuthenticateHandlerFunc(func(params authentication.AuthenticateParams) middleware.Responder { - return middleware.NotImplemented("operation authentication.Authenticate has not yet been implemented") - }) - } - if api.AuthenticationAuthenticateMfaHandler == nil { - api.AuthenticationAuthenticateMfaHandler = authentication.AuthenticateMfaHandlerFunc(func(params authentication.AuthenticateMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authentication.AuthenticateMfa has not yet been implemented") - }) - } - if api.DatabaseCheckDataIntegrityHandler == nil { - api.DatabaseCheckDataIntegrityHandler = database.CheckDataIntegrityHandlerFunc(func(params database.CheckDataIntegrityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.CheckDataIntegrity has not yet been implemented") - }) - } - if api.AuthPolicyCreateAuthPolicyHandler == nil { - api.AuthPolicyCreateAuthPolicyHandler = auth_policy.CreateAuthPolicyHandlerFunc(func(params auth_policy.CreateAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.CreateAuthPolicy has not yet been implemented") - }) - } - if api.AuthenticatorCreateAuthenticatorHandler == nil { - api.AuthenticatorCreateAuthenticatorHandler = authenticator.CreateAuthenticatorHandlerFunc(func(params authenticator.CreateAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.CreateAuthenticator has not yet been implemented") - }) - } - if api.CertificateAuthorityCreateCaHandler == nil { - api.CertificateAuthorityCreateCaHandler = certificate_authority.CreateCaHandlerFunc(func(params certificate_authority.CreateCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.CreateCa has not yet been implemented") - }) - } - if api.ConfigCreateConfigHandler == nil { - api.ConfigCreateConfigHandler = config.CreateConfigHandlerFunc(func(params config.CreateConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.CreateConfig has not yet been implemented") - }) - } - if api.ConfigCreateConfigTypeHandler == nil { - api.ConfigCreateConfigTypeHandler = config.CreateConfigTypeHandlerFunc(func(params config.CreateConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.CreateConfigType has not yet been implemented") - }) - } - if api.DatabaseCreateDatabaseSnapshotHandler == nil { - api.DatabaseCreateDatabaseSnapshotHandler = database.CreateDatabaseSnapshotHandlerFunc(func(params database.CreateDatabaseSnapshotParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.CreateDatabaseSnapshot has not yet been implemented") - }) - } - if api.EdgeRouterCreateEdgeRouterHandler == nil { - api.EdgeRouterCreateEdgeRouterHandler = edge_router.CreateEdgeRouterHandlerFunc(func(params edge_router.CreateEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.CreateEdgeRouter has not yet been implemented") - }) - } - if api.EdgeRouterPolicyCreateEdgeRouterPolicyHandler == nil { - api.EdgeRouterPolicyCreateEdgeRouterPolicyHandler = edge_router_policy.CreateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.CreateEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.CreateEdgeRouterPolicy has not yet been implemented") - }) - } - if api.EnrollmentCreateEnrollmentHandler == nil { - api.EnrollmentCreateEnrollmentHandler = enrollment.CreateEnrollmentHandlerFunc(func(params enrollment.CreateEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.CreateEnrollment has not yet been implemented") - }) - } - if api.ExternalJWTSignerCreateExternalJWTSignerHandler == nil { - api.ExternalJWTSignerCreateExternalJWTSignerHandler = external_jwt_signer.CreateExternalJWTSignerHandlerFunc(func(params external_jwt_signer.CreateExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.CreateExternalJWTSigner has not yet been implemented") - }) - } - if api.IdentityCreateIdentityHandler == nil { - api.IdentityCreateIdentityHandler = identity.CreateIdentityHandlerFunc(func(params identity.CreateIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.CreateIdentity has not yet been implemented") - }) - } - if api.CurrentIdentityCreateMfaRecoveryCodesHandler == nil { - api.CurrentIdentityCreateMfaRecoveryCodesHandler = current_identity.CreateMfaRecoveryCodesHandlerFunc(func(params current_identity.CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.CreateMfaRecoveryCodes has not yet been implemented") - }) - } - if api.PostureChecksCreatePostureCheckHandler == nil { - api.PostureChecksCreatePostureCheckHandler = posture_checks.CreatePostureCheckHandlerFunc(func(params posture_checks.CreatePostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.CreatePostureCheck has not yet been implemented") - }) - } - if api.RouterCreateRouterHandler == nil { - api.RouterCreateRouterHandler = router.CreateRouterHandlerFunc(func(params router.CreateRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.CreateRouter has not yet been implemented") - }) - } - if api.ServiceCreateServiceHandler == nil { - api.ServiceCreateServiceHandler = service.CreateServiceHandlerFunc(func(params service.CreateServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.CreateService has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler == nil { - api.ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler = service_edge_router_policy.CreateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.CreateServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.CreateServiceEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ServicePolicyCreateServicePolicyHandler == nil { - api.ServicePolicyCreateServicePolicyHandler = service_policy.CreateServicePolicyHandlerFunc(func(params service_policy.CreateServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.CreateServicePolicy has not yet been implemented") - }) - } - if api.TerminatorCreateTerminatorHandler == nil { - api.TerminatorCreateTerminatorHandler = terminator.CreateTerminatorHandlerFunc(func(params terminator.CreateTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.CreateTerminator has not yet been implemented") - }) - } - if api.RouterCreateTransitRouterHandler == nil { - api.RouterCreateTransitRouterHandler = router.CreateTransitRouterHandlerFunc(func(params router.CreateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.CreateTransitRouter has not yet been implemented") - }) - } - if api.DatabaseDataIntegrityResultsHandler == nil { - api.DatabaseDataIntegrityResultsHandler = database.DataIntegrityResultsHandlerFunc(func(params database.DataIntegrityResultsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.DataIntegrityResults has not yet been implemented") - }) - } - if api.APISessionDeleteAPISessionsHandler == nil { - api.APISessionDeleteAPISessionsHandler = api_session.DeleteAPISessionsHandlerFunc(func(params api_session.DeleteAPISessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation api_session.DeleteAPISessions has not yet been implemented") - }) - } - if api.AuthPolicyDeleteAuthPolicyHandler == nil { - api.AuthPolicyDeleteAuthPolicyHandler = auth_policy.DeleteAuthPolicyHandlerFunc(func(params auth_policy.DeleteAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.DeleteAuthPolicy has not yet been implemented") - }) - } - if api.AuthenticatorDeleteAuthenticatorHandler == nil { - api.AuthenticatorDeleteAuthenticatorHandler = authenticator.DeleteAuthenticatorHandlerFunc(func(params authenticator.DeleteAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.DeleteAuthenticator has not yet been implemented") - }) - } - if api.CertificateAuthorityDeleteCaHandler == nil { - api.CertificateAuthorityDeleteCaHandler = certificate_authority.DeleteCaHandlerFunc(func(params certificate_authority.DeleteCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.DeleteCa has not yet been implemented") - }) - } - if api.ConfigDeleteConfigHandler == nil { - api.ConfigDeleteConfigHandler = config.DeleteConfigHandlerFunc(func(params config.DeleteConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DeleteConfig has not yet been implemented") - }) - } - if api.ConfigDeleteConfigTypeHandler == nil { - api.ConfigDeleteConfigTypeHandler = config.DeleteConfigTypeHandlerFunc(func(params config.DeleteConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DeleteConfigType has not yet been implemented") - }) - } - if api.EdgeRouterDeleteEdgeRouterHandler == nil { - api.EdgeRouterDeleteEdgeRouterHandler = edge_router.DeleteEdgeRouterHandlerFunc(func(params edge_router.DeleteEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.DeleteEdgeRouter has not yet been implemented") - }) - } - if api.EdgeRouterPolicyDeleteEdgeRouterPolicyHandler == nil { - api.EdgeRouterPolicyDeleteEdgeRouterPolicyHandler = edge_router_policy.DeleteEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DeleteEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.DeleteEdgeRouterPolicy has not yet been implemented") - }) - } - if api.EnrollmentDeleteEnrollmentHandler == nil { - api.EnrollmentDeleteEnrollmentHandler = enrollment.DeleteEnrollmentHandlerFunc(func(params enrollment.DeleteEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.DeleteEnrollment has not yet been implemented") - }) - } - if api.ExternalJWTSignerDeleteExternalJWTSignerHandler == nil { - api.ExternalJWTSignerDeleteExternalJWTSignerHandler = external_jwt_signer.DeleteExternalJWTSignerHandlerFunc(func(params external_jwt_signer.DeleteExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.DeleteExternalJWTSigner has not yet been implemented") - }) - } - if api.IdentityDeleteIdentityHandler == nil { - api.IdentityDeleteIdentityHandler = identity.DeleteIdentityHandlerFunc(func(params identity.DeleteIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DeleteIdentity has not yet been implemented") - }) - } - if api.CurrentIdentityDeleteMfaHandler == nil { - api.CurrentIdentityDeleteMfaHandler = current_identity.DeleteMfaHandlerFunc(func(params current_identity.DeleteMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DeleteMfa has not yet been implemented") - }) - } - if api.PostureChecksDeletePostureCheckHandler == nil { - api.PostureChecksDeletePostureCheckHandler = posture_checks.DeletePostureCheckHandlerFunc(func(params posture_checks.DeletePostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.DeletePostureCheck has not yet been implemented") - }) - } - if api.RouterDeleteRouterHandler == nil { - api.RouterDeleteRouterHandler = router.DeleteRouterHandlerFunc(func(params router.DeleteRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DeleteRouter has not yet been implemented") - }) - } - if api.ServiceDeleteServiceHandler == nil { - api.ServiceDeleteServiceHandler = service.DeleteServiceHandlerFunc(func(params service.DeleteServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DeleteService has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler == nil { - api.ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler = service_edge_router_policy.DeleteServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DeleteServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.DeleteServiceEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ServicePolicyDeleteServicePolicyHandler == nil { - api.ServicePolicyDeleteServicePolicyHandler = service_policy.DeleteServicePolicyHandlerFunc(func(params service_policy.DeleteServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.DeleteServicePolicy has not yet been implemented") - }) - } - if api.SessionDeleteSessionHandler == nil { - api.SessionDeleteSessionHandler = session.DeleteSessionHandlerFunc(func(params session.DeleteSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DeleteSession has not yet been implemented") - }) - } - if api.TerminatorDeleteTerminatorHandler == nil { - api.TerminatorDeleteTerminatorHandler = terminator.DeleteTerminatorHandlerFunc(func(params terminator.DeleteTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.DeleteTerminator has not yet been implemented") - }) - } - if api.RouterDeleteTransitRouterHandler == nil { - api.RouterDeleteTransitRouterHandler = router.DeleteTransitRouterHandlerFunc(func(params router.DeleteTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DeleteTransitRouter has not yet been implemented") - }) - } - if api.APISessionDetailAPISessionsHandler == nil { - api.APISessionDetailAPISessionsHandler = api_session.DetailAPISessionsHandlerFunc(func(params api_session.DetailAPISessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation api_session.DetailAPISessions has not yet been implemented") - }) - } - if api.AuthPolicyDetailAuthPolicyHandler == nil { - api.AuthPolicyDetailAuthPolicyHandler = auth_policy.DetailAuthPolicyHandlerFunc(func(params auth_policy.DetailAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.DetailAuthPolicy has not yet been implemented") - }) - } - if api.AuthenticatorDetailAuthenticatorHandler == nil { - api.AuthenticatorDetailAuthenticatorHandler = authenticator.DetailAuthenticatorHandlerFunc(func(params authenticator.DetailAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.DetailAuthenticator has not yet been implemented") - }) - } - if api.CertificateAuthorityDetailCaHandler == nil { - api.CertificateAuthorityDetailCaHandler = certificate_authority.DetailCaHandlerFunc(func(params certificate_authority.DetailCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.DetailCa has not yet been implemented") - }) - } - if api.ConfigDetailConfigHandler == nil { - api.ConfigDetailConfigHandler = config.DetailConfigHandlerFunc(func(params config.DetailConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DetailConfig has not yet been implemented") - }) - } - if api.ConfigDetailConfigTypeHandler == nil { - api.ConfigDetailConfigTypeHandler = config.DetailConfigTypeHandlerFunc(func(params config.DetailConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DetailConfigType has not yet been implemented") - }) - } - if api.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler = current_api_session.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DetailCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.EdgeRouterDetailEdgeRouterHandler == nil { - api.EdgeRouterDetailEdgeRouterHandler = edge_router.DetailEdgeRouterHandlerFunc(func(params edge_router.DetailEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.DetailEdgeRouter has not yet been implemented") - }) - } - if api.EdgeRouterPolicyDetailEdgeRouterPolicyHandler == nil { - api.EdgeRouterPolicyDetailEdgeRouterPolicyHandler = edge_router_policy.DetailEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DetailEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.DetailEdgeRouterPolicy has not yet been implemented") - }) - } - if api.EnrollmentDetailEnrollmentHandler == nil { - api.EnrollmentDetailEnrollmentHandler = enrollment.DetailEnrollmentHandlerFunc(func(params enrollment.DetailEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.DetailEnrollment has not yet been implemented") - }) - } - if api.ExternalJWTSignerDetailExternalJWTSignerHandler == nil { - api.ExternalJWTSignerDetailExternalJWTSignerHandler = external_jwt_signer.DetailExternalJWTSignerHandlerFunc(func(params external_jwt_signer.DetailExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.DetailExternalJWTSigner has not yet been implemented") - }) - } - if api.IdentityDetailIdentityHandler == nil { - api.IdentityDetailIdentityHandler = identity.DetailIdentityHandlerFunc(func(params identity.DetailIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DetailIdentity has not yet been implemented") - }) - } - if api.IdentityDetailIdentityTypeHandler == nil { - api.IdentityDetailIdentityTypeHandler = identity.DetailIdentityTypeHandlerFunc(func(params identity.DetailIdentityTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DetailIdentityType has not yet been implemented") - }) - } - if api.CurrentIdentityDetailMfaHandler == nil { - api.CurrentIdentityDetailMfaHandler = current_identity.DetailMfaHandlerFunc(func(params current_identity.DetailMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfa has not yet been implemented") - }) - } - if api.CurrentIdentityDetailMfaQrCodeHandler == nil { - api.CurrentIdentityDetailMfaQrCodeHandler = current_identity.DetailMfaQrCodeHandlerFunc(func(params current_identity.DetailMfaQrCodeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaQrCode has not yet been implemented") - }) - } - if api.CurrentIdentityDetailMfaRecoveryCodesHandler == nil { - api.CurrentIdentityDetailMfaRecoveryCodesHandler = current_identity.DetailMfaRecoveryCodesHandlerFunc(func(params current_identity.DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaRecoveryCodes has not yet been implemented") - }) - } - if api.PostureChecksDetailPostureCheckHandler == nil { - api.PostureChecksDetailPostureCheckHandler = posture_checks.DetailPostureCheckHandlerFunc(func(params posture_checks.DetailPostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.DetailPostureCheck has not yet been implemented") - }) - } - if api.PostureChecksDetailPostureCheckTypeHandler == nil { - api.PostureChecksDetailPostureCheckTypeHandler = posture_checks.DetailPostureCheckTypeHandlerFunc(func(params posture_checks.DetailPostureCheckTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.DetailPostureCheckType has not yet been implemented") - }) - } - if api.RouterDetailRouterHandler == nil { - api.RouterDetailRouterHandler = router.DetailRouterHandlerFunc(func(params router.DetailRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DetailRouter has not yet been implemented") - }) - } - if api.ServiceDetailServiceHandler == nil { - api.ServiceDetailServiceHandler = service.DetailServiceHandlerFunc(func(params service.DetailServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DetailService has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler == nil { - api.ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler = service_edge_router_policy.DetailServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DetailServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.DetailServiceEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ServicePolicyDetailServicePolicyHandler == nil { - api.ServicePolicyDetailServicePolicyHandler = service_policy.DetailServicePolicyHandlerFunc(func(params service_policy.DetailServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.DetailServicePolicy has not yet been implemented") - }) - } - if api.SessionDetailSessionHandler == nil { - api.SessionDetailSessionHandler = session.DetailSessionHandlerFunc(func(params session.DetailSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DetailSession has not yet been implemented") - }) - } - if api.SessionDetailSessionRoutePathHandler == nil { - api.SessionDetailSessionRoutePathHandler = session.DetailSessionRoutePathHandlerFunc(func(params session.DetailSessionRoutePathParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DetailSessionRoutePath has not yet been implemented") - }) - } - if api.InformationalDetailSpecHandler == nil { - api.InformationalDetailSpecHandler = informational.DetailSpecHandlerFunc(func(params informational.DetailSpecParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpec has not yet been implemented") - }) - } - if api.InformationalDetailSpecBodyHandler == nil { - api.InformationalDetailSpecBodyHandler = informational.DetailSpecBodyHandlerFunc(func(params informational.DetailSpecBodyParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpecBody has not yet been implemented") - }) - } - if api.TerminatorDetailTerminatorHandler == nil { - api.TerminatorDetailTerminatorHandler = terminator.DetailTerminatorHandlerFunc(func(params terminator.DetailTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.DetailTerminator has not yet been implemented") - }) - } - if api.RouterDetailTransitRouterHandler == nil { - api.RouterDetailTransitRouterHandler = router.DetailTransitRouterHandlerFunc(func(params router.DetailTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DetailTransitRouter has not yet been implemented") - }) - } - if api.IdentityDisableIdentityHandler == nil { - api.IdentityDisableIdentityHandler = identity.DisableIdentityHandlerFunc(func(params identity.DisableIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DisableIdentity has not yet been implemented") - }) - } - if api.IdentityDisassociateIdentitysServiceConfigsHandler == nil { - api.IdentityDisassociateIdentitysServiceConfigsHandler = identity.DisassociateIdentitysServiceConfigsHandlerFunc(func(params identity.DisassociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DisassociateIdentitysServiceConfigs has not yet been implemented") - }) - } - if api.IdentityEnableIdentityHandler == nil { - api.IdentityEnableIdentityHandler = identity.EnableIdentityHandlerFunc(func(params identity.EnableIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.EnableIdentity has not yet been implemented") - }) - } - if api.CurrentIdentityEnrollMfaHandler == nil { - api.CurrentIdentityEnrollMfaHandler = current_identity.EnrollMfaHandlerFunc(func(params current_identity.EnrollMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.EnrollMfa has not yet been implemented") - }) - } - if api.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler = current_api_session.ExtendCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler = current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendVerifyCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.DatabaseFixDataIntegrityHandler == nil { - api.DatabaseFixDataIntegrityHandler = database.FixDataIntegrityHandlerFunc(func(params database.FixDataIntegrityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.FixDataIntegrity has not yet been implemented") - }) - } - if api.CertificateAuthorityGetCaJWTHandler == nil { - api.CertificateAuthorityGetCaJWTHandler = certificate_authority.GetCaJWTHandlerFunc(func(params certificate_authority.GetCaJWTParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.GetCaJWT has not yet been implemented") - }) - } - if api.CurrentAPISessionGetCurrentAPISessionHandler == nil { - api.CurrentAPISessionGetCurrentAPISessionHandler = current_api_session.GetCurrentAPISessionHandlerFunc(func(params current_api_session.GetCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.GetCurrentAPISession has not yet been implemented") - }) - } - if api.CurrentIdentityGetCurrentIdentityHandler == nil { - api.CurrentIdentityGetCurrentIdentityHandler = current_identity.GetCurrentIdentityHandlerFunc(func(params current_identity.GetCurrentIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.GetCurrentIdentity has not yet been implemented") - }) - } - if api.IdentityGetIdentityAuthenticatorsHandler == nil { - api.IdentityGetIdentityAuthenticatorsHandler = identity.GetIdentityAuthenticatorsHandlerFunc(func(params identity.GetIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityAuthenticators has not yet been implemented") - }) - } - if api.IdentityGetIdentityEnrollmentsHandler == nil { - api.IdentityGetIdentityEnrollmentsHandler = identity.GetIdentityEnrollmentsHandlerFunc(func(params identity.GetIdentityEnrollmentsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityEnrollments has not yet been implemented") - }) - } - if api.IdentityGetIdentityFailedServiceRequestsHandler == nil { - api.IdentityGetIdentityFailedServiceRequestsHandler = identity.GetIdentityFailedServiceRequestsHandlerFunc(func(params identity.GetIdentityFailedServiceRequestsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityFailedServiceRequests has not yet been implemented") - }) - } - if api.IdentityGetIdentityPolicyAdviceHandler == nil { - api.IdentityGetIdentityPolicyAdviceHandler = identity.GetIdentityPolicyAdviceHandlerFunc(func(params identity.GetIdentityPolicyAdviceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityPolicyAdvice has not yet been implemented") - }) - } - if api.IdentityGetIdentityPostureDataHandler == nil { - api.IdentityGetIdentityPostureDataHandler = identity.GetIdentityPostureDataHandlerFunc(func(params identity.GetIdentityPostureDataParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityPostureData has not yet been implemented") - }) - } - if api.APISessionListAPISessionsHandler == nil { - api.APISessionListAPISessionsHandler = api_session.ListAPISessionsHandlerFunc(func(params api_session.ListAPISessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation api_session.ListAPISessions has not yet been implemented") - }) - } - if api.AuthPolicyListAuthPoliciesHandler == nil { - api.AuthPolicyListAuthPoliciesHandler = auth_policy.ListAuthPoliciesHandlerFunc(func(params auth_policy.ListAuthPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.ListAuthPolicies has not yet been implemented") - }) - } - if api.AuthenticatorListAuthenticatorsHandler == nil { - api.AuthenticatorListAuthenticatorsHandler = authenticator.ListAuthenticatorsHandlerFunc(func(params authenticator.ListAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.ListAuthenticators has not yet been implemented") - }) - } - if api.CertificateAuthorityListCasHandler == nil { - api.CertificateAuthorityListCasHandler = certificate_authority.ListCasHandlerFunc(func(params certificate_authority.ListCasParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.ListCas has not yet been implemented") - }) - } - if api.ConfigListConfigTypesHandler == nil { - api.ConfigListConfigTypesHandler = config.ListConfigTypesHandlerFunc(func(params config.ListConfigTypesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.ListConfigTypes has not yet been implemented") - }) - } - if api.ConfigListConfigsHandler == nil { - api.ConfigListConfigsHandler = config.ListConfigsHandlerFunc(func(params config.ListConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.ListConfigs has not yet been implemented") - }) - } - if api.ConfigListConfigsForConfigTypeHandler == nil { - api.ConfigListConfigsForConfigTypeHandler = config.ListConfigsForConfigTypeHandlerFunc(func(params config.ListConfigsForConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.ListConfigsForConfigType has not yet been implemented") - }) - } - if api.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler == nil { - api.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler = current_api_session.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params current_api_session.ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListCurrentIdentityAuthenticators has not yet been implemented") - }) - } - if api.EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler == nil { - api.EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler = edge_router.ListEdgeRouterEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterEdgeRouterPolicies has not yet been implemented") - }) - } - if api.EdgeRouterListEdgeRouterIdentitiesHandler == nil { - api.EdgeRouterListEdgeRouterIdentitiesHandler = edge_router.ListEdgeRouterIdentitiesHandlerFunc(func(params edge_router.ListEdgeRouterIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterIdentities has not yet been implemented") - }) - } - if api.EdgeRouterPolicyListEdgeRouterPoliciesHandler == nil { - api.EdgeRouterPolicyListEdgeRouterPoliciesHandler = edge_router_policy.ListEdgeRouterPoliciesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.ListEdgeRouterPolicies has not yet been implemented") - }) - } - if api.EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler == nil { - api.EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler = edge_router_policy.ListEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.ListEdgeRouterPolicyEdgeRouters has not yet been implemented") - }) - } - if api.EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler == nil { - api.EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler = edge_router_policy.ListEdgeRouterPolicyIdentitiesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.ListEdgeRouterPolicyIdentities has not yet been implemented") - }) - } - if api.RoleAttributesListEdgeRouterRoleAttributesHandler == nil { - api.RoleAttributesListEdgeRouterRoleAttributesHandler = role_attributes.ListEdgeRouterRoleAttributesHandlerFunc(func(params role_attributes.ListEdgeRouterRoleAttributesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation role_attributes.ListEdgeRouterRoleAttributes has not yet been implemented") - }) - } - if api.EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler == nil { - api.EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler = edge_router.ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterServiceEdgeRouterPolicies has not yet been implemented") - }) - } - if api.EdgeRouterListEdgeRouterServicesHandler == nil { - api.EdgeRouterListEdgeRouterServicesHandler = edge_router.ListEdgeRouterServicesHandlerFunc(func(params edge_router.ListEdgeRouterServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterServices has not yet been implemented") - }) - } - if api.EdgeRouterListEdgeRoutersHandler == nil { - api.EdgeRouterListEdgeRoutersHandler = edge_router.ListEdgeRoutersHandlerFunc(func(params edge_router.ListEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouters has not yet been implemented") - }) - } - if api.EnrollmentListEnrollmentsHandler == nil { - api.EnrollmentListEnrollmentsHandler = enrollment.ListEnrollmentsHandlerFunc(func(params enrollment.ListEnrollmentsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.ListEnrollments has not yet been implemented") - }) - } - if api.ExternalJWTSignerListExternalJWTSignersHandler == nil { - api.ExternalJWTSignerListExternalJWTSignersHandler = external_jwt_signer.ListExternalJWTSignersHandlerFunc(func(params external_jwt_signer.ListExternalJWTSignersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.ListExternalJWTSigners has not yet been implemented") - }) - } - if api.IdentityListIdentitiesHandler == nil { - api.IdentityListIdentitiesHandler = identity.ListIdentitiesHandlerFunc(func(params identity.ListIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentities has not yet been implemented") - }) - } - if api.IdentityListIdentityEdgeRoutersHandler == nil { - api.IdentityListIdentityEdgeRoutersHandler = identity.ListIdentityEdgeRoutersHandlerFunc(func(params identity.ListIdentityEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityEdgeRouters has not yet been implemented") - }) - } - if api.RoleAttributesListIdentityRoleAttributesHandler == nil { - api.RoleAttributesListIdentityRoleAttributesHandler = role_attributes.ListIdentityRoleAttributesHandlerFunc(func(params role_attributes.ListIdentityRoleAttributesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation role_attributes.ListIdentityRoleAttributes has not yet been implemented") - }) - } - if api.IdentityListIdentityServicePoliciesHandler == nil { - api.IdentityListIdentityServicePoliciesHandler = identity.ListIdentityServicePoliciesHandlerFunc(func(params identity.ListIdentityServicePoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityServicePolicies has not yet been implemented") - }) - } - if api.IdentityListIdentityServicesHandler == nil { - api.IdentityListIdentityServicesHandler = identity.ListIdentityServicesHandlerFunc(func(params identity.ListIdentityServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityServices has not yet been implemented") - }) - } - if api.IdentityListIdentityTypesHandler == nil { - api.IdentityListIdentityTypesHandler = identity.ListIdentityTypesHandlerFunc(func(params identity.ListIdentityTypesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityTypes has not yet been implemented") - }) - } - if api.IdentityListIdentitysEdgeRouterPoliciesHandler == nil { - api.IdentityListIdentitysEdgeRouterPoliciesHandler = identity.ListIdentitysEdgeRouterPoliciesHandlerFunc(func(params identity.ListIdentitysEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentitysEdgeRouterPolicies has not yet been implemented") - }) - } - if api.IdentityListIdentitysServiceConfigsHandler == nil { - api.IdentityListIdentitysServiceConfigsHandler = identity.ListIdentitysServiceConfigsHandlerFunc(func(params identity.ListIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentitysServiceConfigs has not yet been implemented") - }) - } - if api.PostureChecksListPostureCheckTypesHandler == nil { - api.PostureChecksListPostureCheckTypesHandler = posture_checks.ListPostureCheckTypesHandlerFunc(func(params posture_checks.ListPostureCheckTypesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.ListPostureCheckTypes has not yet been implemented") - }) - } - if api.PostureChecksListPostureChecksHandler == nil { - api.PostureChecksListPostureChecksHandler = posture_checks.ListPostureChecksHandlerFunc(func(params posture_checks.ListPostureChecksParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.ListPostureChecks has not yet been implemented") - }) - } - if api.InformationalListRootHandler == nil { - api.InformationalListRootHandler = informational.ListRootHandlerFunc(func(params informational.ListRootParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListRoot has not yet been implemented") - }) - } - if api.RouterListRoutersHandler == nil { - api.RouterListRoutersHandler = router.ListRoutersHandlerFunc(func(params router.ListRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.ListRouters has not yet been implemented") - }) - } - if api.ServiceListServiceConfigHandler == nil { - api.ServiceListServiceConfigHandler = service.ListServiceConfigHandlerFunc(func(params service.ListServiceConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceConfig has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler == nil { - api.ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler = service_edge_router_policy.ListServiceEdgeRouterPoliciesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.ListServiceEdgeRouterPolicies has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler == nil { - api.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler = service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRouters has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler == nil { - api.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler = service_edge_router_policy.ListServiceEdgeRouterPolicyServicesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.ListServiceEdgeRouterPolicyServices has not yet been implemented") - }) - } - if api.ServiceListServiceEdgeRoutersHandler == nil { - api.ServiceListServiceEdgeRoutersHandler = service.ListServiceEdgeRoutersHandlerFunc(func(params service.ListServiceEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceEdgeRouters has not yet been implemented") - }) - } - if api.ServiceListServiceIdentitiesHandler == nil { - api.ServiceListServiceIdentitiesHandler = service.ListServiceIdentitiesHandlerFunc(func(params service.ListServiceIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceIdentities has not yet been implemented") - }) - } - if api.ServicePolicyListServicePoliciesHandler == nil { - api.ServicePolicyListServicePoliciesHandler = service_policy.ListServicePoliciesHandlerFunc(func(params service_policy.ListServicePoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicies has not yet been implemented") - }) - } - if api.ServicePolicyListServicePolicyIdentitiesHandler == nil { - api.ServicePolicyListServicePolicyIdentitiesHandler = service_policy.ListServicePolicyIdentitiesHandlerFunc(func(params service_policy.ListServicePolicyIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicyIdentities has not yet been implemented") - }) - } - if api.ServicePolicyListServicePolicyPostureChecksHandler == nil { - api.ServicePolicyListServicePolicyPostureChecksHandler = service_policy.ListServicePolicyPostureChecksHandlerFunc(func(params service_policy.ListServicePolicyPostureChecksParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicyPostureChecks has not yet been implemented") - }) - } - if api.ServicePolicyListServicePolicyServicesHandler == nil { - api.ServicePolicyListServicePolicyServicesHandler = service_policy.ListServicePolicyServicesHandlerFunc(func(params service_policy.ListServicePolicyServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicyServices has not yet been implemented") - }) - } - if api.RoleAttributesListServiceRoleAttributesHandler == nil { - api.RoleAttributesListServiceRoleAttributesHandler = role_attributes.ListServiceRoleAttributesHandlerFunc(func(params role_attributes.ListServiceRoleAttributesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation role_attributes.ListServiceRoleAttributes has not yet been implemented") - }) - } - if api.ServiceListServiceServiceEdgeRouterPoliciesHandler == nil { - api.ServiceListServiceServiceEdgeRouterPoliciesHandler = service.ListServiceServiceEdgeRouterPoliciesHandlerFunc(func(params service.ListServiceServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceServiceEdgeRouterPolicies has not yet been implemented") - }) - } - if api.ServiceListServiceServicePoliciesHandler == nil { - api.ServiceListServiceServicePoliciesHandler = service.ListServiceServicePoliciesHandlerFunc(func(params service.ListServiceServicePoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceServicePolicies has not yet been implemented") - }) - } - if api.ServiceListServiceTerminatorsHandler == nil { - api.ServiceListServiceTerminatorsHandler = service.ListServiceTerminatorsHandlerFunc(func(params service.ListServiceTerminatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceTerminators has not yet been implemented") - }) - } - if api.ServiceListServicesHandler == nil { - api.ServiceListServicesHandler = service.ListServicesHandlerFunc(func(params service.ListServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServices has not yet been implemented") - }) - } - if api.SessionListSessionsHandler == nil { - api.SessionListSessionsHandler = session.ListSessionsHandlerFunc(func(params session.ListSessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.ListSessions has not yet been implemented") - }) - } - if api.InformationalListSpecsHandler == nil { - api.InformationalListSpecsHandler = informational.ListSpecsHandlerFunc(func(params informational.ListSpecsParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListSpecs has not yet been implemented") - }) - } - if api.InformationalListSummaryHandler == nil { - api.InformationalListSummaryHandler = informational.ListSummaryHandlerFunc(func(params informational.ListSummaryParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation informational.ListSummary has not yet been implemented") - }) - } - if api.TerminatorListTerminatorsHandler == nil { - api.TerminatorListTerminatorsHandler = terminator.ListTerminatorsHandlerFunc(func(params terminator.ListTerminatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.ListTerminators has not yet been implemented") - }) - } - if api.RouterListTransitRoutersHandler == nil { - api.RouterListTransitRoutersHandler = router.ListTransitRoutersHandlerFunc(func(params router.ListTransitRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.ListTransitRouters has not yet been implemented") - }) - } - if api.InformationalListVersionHandler == nil { - api.InformationalListVersionHandler = informational.ListVersionHandlerFunc(func(params informational.ListVersionParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListVersion has not yet been implemented") - }) - } - if api.AuthPolicyPatchAuthPolicyHandler == nil { - api.AuthPolicyPatchAuthPolicyHandler = auth_policy.PatchAuthPolicyHandlerFunc(func(params auth_policy.PatchAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.PatchAuthPolicy has not yet been implemented") - }) - } - if api.AuthenticatorPatchAuthenticatorHandler == nil { - api.AuthenticatorPatchAuthenticatorHandler = authenticator.PatchAuthenticatorHandlerFunc(func(params authenticator.PatchAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.PatchAuthenticator has not yet been implemented") - }) - } - if api.CertificateAuthorityPatchCaHandler == nil { - api.CertificateAuthorityPatchCaHandler = certificate_authority.PatchCaHandlerFunc(func(params certificate_authority.PatchCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.PatchCa has not yet been implemented") - }) - } - if api.ConfigPatchConfigHandler == nil { - api.ConfigPatchConfigHandler = config.PatchConfigHandlerFunc(func(params config.PatchConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.PatchConfig has not yet been implemented") - }) - } - if api.ConfigPatchConfigTypeHandler == nil { - api.ConfigPatchConfigTypeHandler = config.PatchConfigTypeHandlerFunc(func(params config.PatchConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.PatchConfigType has not yet been implemented") - }) - } - if api.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler = current_api_session.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.PatchCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.EdgeRouterPatchEdgeRouterHandler == nil { - api.EdgeRouterPatchEdgeRouterHandler = edge_router.PatchEdgeRouterHandlerFunc(func(params edge_router.PatchEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.PatchEdgeRouter has not yet been implemented") - }) - } - if api.EdgeRouterPolicyPatchEdgeRouterPolicyHandler == nil { - api.EdgeRouterPolicyPatchEdgeRouterPolicyHandler = edge_router_policy.PatchEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.PatchEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.PatchEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ExternalJWTSignerPatchExternalJWTSignerHandler == nil { - api.ExternalJWTSignerPatchExternalJWTSignerHandler = external_jwt_signer.PatchExternalJWTSignerHandlerFunc(func(params external_jwt_signer.PatchExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.PatchExternalJWTSigner has not yet been implemented") - }) - } - if api.IdentityPatchIdentityHandler == nil { - api.IdentityPatchIdentityHandler = identity.PatchIdentityHandlerFunc(func(params identity.PatchIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.PatchIdentity has not yet been implemented") - }) - } - if api.PostureChecksPatchPostureCheckHandler == nil { - api.PostureChecksPatchPostureCheckHandler = posture_checks.PatchPostureCheckHandlerFunc(func(params posture_checks.PatchPostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.PatchPostureCheck has not yet been implemented") - }) - } - if api.RouterPatchRouterHandler == nil { - api.RouterPatchRouterHandler = router.PatchRouterHandlerFunc(func(params router.PatchRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.PatchRouter has not yet been implemented") - }) - } - if api.ServicePatchServiceHandler == nil { - api.ServicePatchServiceHandler = service.PatchServiceHandlerFunc(func(params service.PatchServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.PatchService has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler == nil { - api.ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler = service_edge_router_policy.PatchServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.PatchServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.PatchServiceEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ServicePolicyPatchServicePolicyHandler == nil { - api.ServicePolicyPatchServicePolicyHandler = service_policy.PatchServicePolicyHandlerFunc(func(params service_policy.PatchServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.PatchServicePolicy has not yet been implemented") - }) - } - if api.TerminatorPatchTerminatorHandler == nil { - api.TerminatorPatchTerminatorHandler = terminator.PatchTerminatorHandlerFunc(func(params terminator.PatchTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.PatchTerminator has not yet been implemented") - }) - } - if api.RouterPatchTransitRouterHandler == nil { - api.RouterPatchTransitRouterHandler = router.PatchTransitRouterHandlerFunc(func(params router.PatchTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.PatchTransitRouter has not yet been implemented") - }) - } - if api.AuthenticatorReEnrollAuthenticatorHandler == nil { - api.AuthenticatorReEnrollAuthenticatorHandler = authenticator.ReEnrollAuthenticatorHandlerFunc(func(params authenticator.ReEnrollAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.ReEnrollAuthenticator has not yet been implemented") - }) - } - if api.EdgeRouterReEnrollEdgeRouterHandler == nil { - api.EdgeRouterReEnrollEdgeRouterHandler = edge_router.ReEnrollEdgeRouterHandlerFunc(func(params edge_router.ReEnrollEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ReEnrollEdgeRouter has not yet been implemented") - }) - } - if api.EnrollmentRefreshEnrollmentHandler == nil { - api.EnrollmentRefreshEnrollmentHandler = enrollment.RefreshEnrollmentHandlerFunc(func(params enrollment.RefreshEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.RefreshEnrollment has not yet been implemented") - }) - } - if api.IdentityRemoveIdentityMfaHandler == nil { - api.IdentityRemoveIdentityMfaHandler = identity.RemoveIdentityMfaHandlerFunc(func(params identity.RemoveIdentityMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.RemoveIdentityMfa has not yet been implemented") - }) - } - if api.AuthPolicyUpdateAuthPolicyHandler == nil { - api.AuthPolicyUpdateAuthPolicyHandler = auth_policy.UpdateAuthPolicyHandlerFunc(func(params auth_policy.UpdateAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.UpdateAuthPolicy has not yet been implemented") - }) - } - if api.AuthenticatorUpdateAuthenticatorHandler == nil { - api.AuthenticatorUpdateAuthenticatorHandler = authenticator.UpdateAuthenticatorHandlerFunc(func(params authenticator.UpdateAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.UpdateAuthenticator has not yet been implemented") - }) - } - if api.CertificateAuthorityUpdateCaHandler == nil { - api.CertificateAuthorityUpdateCaHandler = certificate_authority.UpdateCaHandlerFunc(func(params certificate_authority.UpdateCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.UpdateCa has not yet been implemented") - }) - } - if api.ConfigUpdateConfigHandler == nil { - api.ConfigUpdateConfigHandler = config.UpdateConfigHandlerFunc(func(params config.UpdateConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.UpdateConfig has not yet been implemented") - }) - } - if api.ConfigUpdateConfigTypeHandler == nil { - api.ConfigUpdateConfigTypeHandler = config.UpdateConfigTypeHandlerFunc(func(params config.UpdateConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.UpdateConfigType has not yet been implemented") - }) - } - if api.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler == nil { - api.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler = current_api_session.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.UpdateCurrentIdentityAuthenticator has not yet been implemented") - }) - } - if api.EdgeRouterUpdateEdgeRouterHandler == nil { - api.EdgeRouterUpdateEdgeRouterHandler = edge_router.UpdateEdgeRouterHandlerFunc(func(params edge_router.UpdateEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.UpdateEdgeRouter has not yet been implemented") - }) - } - if api.EdgeRouterPolicyUpdateEdgeRouterPolicyHandler == nil { - api.EdgeRouterPolicyUpdateEdgeRouterPolicyHandler = edge_router_policy.UpdateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.UpdateEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.UpdateEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ExternalJWTSignerUpdateExternalJWTSignerHandler == nil { - api.ExternalJWTSignerUpdateExternalJWTSignerHandler = external_jwt_signer.UpdateExternalJWTSignerHandlerFunc(func(params external_jwt_signer.UpdateExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.UpdateExternalJWTSigner has not yet been implemented") - }) - } - if api.IdentityUpdateIdentityHandler == nil { - api.IdentityUpdateIdentityHandler = identity.UpdateIdentityHandlerFunc(func(params identity.UpdateIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.UpdateIdentity has not yet been implemented") - }) - } - if api.IdentityUpdateIdentityTracingHandler == nil { - api.IdentityUpdateIdentityTracingHandler = identity.UpdateIdentityTracingHandlerFunc(func(params identity.UpdateIdentityTracingParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.UpdateIdentityTracing has not yet been implemented") - }) - } - if api.PostureChecksUpdatePostureCheckHandler == nil { - api.PostureChecksUpdatePostureCheckHandler = posture_checks.UpdatePostureCheckHandlerFunc(func(params posture_checks.UpdatePostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.UpdatePostureCheck has not yet been implemented") - }) - } - if api.RouterUpdateRouterHandler == nil { - api.RouterUpdateRouterHandler = router.UpdateRouterHandlerFunc(func(params router.UpdateRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.UpdateRouter has not yet been implemented") - }) - } - if api.ServiceUpdateServiceHandler == nil { - api.ServiceUpdateServiceHandler = service.UpdateServiceHandlerFunc(func(params service.UpdateServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.UpdateService has not yet been implemented") - }) - } - if api.ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler == nil { - api.ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler = service_edge_router_policy.UpdateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.UpdateServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.UpdateServiceEdgeRouterPolicy has not yet been implemented") - }) - } - if api.ServicePolicyUpdateServicePolicyHandler == nil { - api.ServicePolicyUpdateServicePolicyHandler = service_policy.UpdateServicePolicyHandlerFunc(func(params service_policy.UpdateServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.UpdateServicePolicy has not yet been implemented") - }) - } - if api.TerminatorUpdateTerminatorHandler == nil { - api.TerminatorUpdateTerminatorHandler = terminator.UpdateTerminatorHandlerFunc(func(params terminator.UpdateTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.UpdateTerminator has not yet been implemented") - }) - } - if api.RouterUpdateTransitRouterHandler == nil { - api.RouterUpdateTransitRouterHandler = router.UpdateTransitRouterHandlerFunc(func(params router.UpdateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.UpdateTransitRouter has not yet been implemented") - }) - } - if api.CertificateAuthorityVerifyCaHandler == nil { - api.CertificateAuthorityVerifyCaHandler = certificate_authority.VerifyCaHandlerFunc(func(params certificate_authority.VerifyCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.VerifyCa has not yet been implemented") - }) - } - if api.CurrentIdentityVerifyMfaHandler == nil { - api.CurrentIdentityVerifyMfaHandler = current_identity.VerifyMfaHandlerFunc(func(params current_identity.VerifyMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.VerifyMfa has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/rest_management_api_server/doc.go b/rest_management_api_server/doc.go deleted file mode 100644 index 6e8a56567..000000000 --- a/rest_management_api_server/doc.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -// Package rest_management_api_server Ziti Edge Management -// -// OpenZiti Edge Management API -// Schemes: -// https -// Host: demo.ziti.dev -// BasePath: /edge/management/v1 -// Version: 0.25.5 -// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html -// Contact: OpenZiti https://openziti.discourse.group -// -// Consumes: -// - application/json -// - text/plain -// -// Produces: -// - application/jwt -// - image/png -// - application/json -// - text/yaml -// -// swagger:meta -package rest_management_api_server diff --git a/rest_management_api_server/embedded_spec.go b/rest_management_api_server/embedded_spec.go deleted file mode 100644 index 9d658bc3c..000000000 --- a/rest_management_api_server/embedded_spec.go +++ /dev/null @@ -1,46597 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_management_api_server - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "description": "OpenZiti Edge Management API", - "title": "Ziti Edge Management", - "contact": { - "name": "OpenZiti", - "url": "https://openziti.discourse.group", - "email": "help@openziti.org" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "0.25.5" - }, - "host": "demo.ziti.dev", - "basePath": "/edge/management/v1", - "paths": { - "/": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listRoot", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - }, - "/api-sessions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of active API sessions. The resources can be sorted, filtered, and paginated. This endpoint\nrequries admin access.\n", - "produces": [ - "application/json; charset=utf-8" - ], - "tags": [ - "API Session" - ], - "summary": "List active API sessions", - "operationId": "listAPISessions", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of active API Sessions", - "schema": { - "$ref": "#/definitions/listApiSessionsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/api-sessions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single API Session by id. Requires admin access.", - "tags": [ - "API Session" - ], - "summary": "Retrieves a single API Session", - "operationId": "detailAPISessions", - "responses": { - "200": { - "description": "Retrieves a singular API Session by id", - "schema": { - "$ref": "#/definitions/detailApiSessionEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Deletes and API sesion by id. Requires admin access.", - "tags": [ - "API Session" - ], - "summary": "Deletes an API Sessions", - "operationId": "deleteAPISessions", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "403": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/auth-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of Auth Policies", - "tags": [ - "Auth Policy" - ], - "summary": "List Auth Policies", - "operationId": "listAuthPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of Auth Policies", - "schema": { - "$ref": "#/definitions/listAuthPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an Auth Policy. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Creates an Auth Policy", - "operationId": "createAuthPolicy", - "parameters": [ - { - "description": "An Auth Policy to create", - "name": "authPolicy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authPolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/auth-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single Auth Policy by id. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Retrieves a single Auth Policy", - "operationId": "detailAuthPolicy", - "responses": { - "200": { - "description": "A singular Auth Policy resource", - "schema": { - "$ref": "#/definitions/detailAuthPolicyEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an Auth Policy by id. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Update all fields on an Auth Policy", - "operationId": "updateAuthPolicy", - "parameters": [ - { - "description": "An Auth Policy update object", - "name": "authPolicy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authPolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an Auth Policy by id. Requires admin access.\n", - "tags": [ - "Auth Policy" - ], - "summary": "Delete an Auth Policy", - "operationId": "deleteAuthPolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on an Auth Policy by id. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Update the supplied fields on an Auth Policy", - "operationId": "patchAuthPolicy", - "parameters": [ - { - "description": "An Auth Policy patch object", - "name": "authPolicy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authPolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/authenticate": { - "post": { - "security": [], - "description": "Allows authentication Methods include \"password\" and \"cert\"\n", - "tags": [ - "Authentication" - ], - "summary": "Authenticate via a method supplied via a query string parameter", - "operationId": "authenticate", - "parameters": [ - { - "name": "auth", - "in": "body", - "schema": { - "$ref": "#/definitions/authenticate" - } - } - ], - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": null, - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "403": { - "description": "The authentication request could not be processed as the credentials are invalid", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "INVALID_AUTH", - "message": "The authentication request failed", - "requestId": "5952ed10-3091-474f-a691-47ebab6990dc" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "enum": [ - "password", - "cert", - "ext-jwt" - ], - "type": "string", - "name": "method", - "in": "query", - "required": true - } - ] - }, - "/authenticate/mfa": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA authentication by submitting a MFA time based one time token or backup code.", - "tags": [ - "Authentication", - "MFA" - ], - "summary": "Complete MFA authentication", - "operationId": "authenticateMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaAuth", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - } - } - } - }, - "/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated.\nThis endpoint requires admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "List authenticators", - "operationId": "listAuthenticators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an authenticator for a specific identity. Requires admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "Creates an authenticator", - "operationId": "createAuthenticator", - "parameters": [ - { - "description": "A Authenticator create object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorCreate" - } - } - ], - "responses": { - "201": { - "description": "The create was successful", - "schema": { - "$ref": "#/definitions/authenticatorCreate" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/authenticators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single authenticator by id. Requires admin access.", - "tags": [ - "Authenticator" - ], - "summary": "Retrieves a single authenticator", - "operationId": "detailAuthenticator", - "responses": { - "200": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an authenticator by id. Requires admin access.", - "tags": [ - "Authenticator" - ], - "summary": "Update all fields on an authenticator", - "operationId": "updateAuthenticator", - "parameters": [ - { - "description": "An authenticator put object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in.\nRequires admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "Delete an Authenticator", - "operationId": "deleteAuthenticator", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an authenticator by id. Requires admin access.", - "tags": [ - "Authenticator" - ], - "summary": "Update the supplied fields on an authenticator", - "operationId": "patchAuthenticator", - "parameters": [ - { - "description": "An authenticator patch object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/authenticators/{id}/re-enroll": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an authenticator to be reverted to an enrollment and allows re-enrollment to occur. On success the \ncreated enrollment record response is provided and the source authenticator record will be deleted. The \nenrollment created depends on the authenticator. UPDB authenticators result in UPDB enrollments, CERT\nauthenticators result in OTT enrollments, CERT + CA authenticators result in OTTCA enrollments.\n", - "tags": [ - "Authenticator" - ], - "summary": "Reverts an authenticator to an enrollment", - "operationId": "reEnrollAuthenticator", - "parameters": [ - { - "description": "A reEnrollment request", - "name": "reEnroll", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/reEnroll" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/cas": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "List CAs", - "operationId": "listCas", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of Certificate Authorities (CAs)", - "schema": { - "$ref": "#/definitions/listCasEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates a CA in an unverified state. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Creates a CA", - "operationId": "createCa", - "parameters": [ - { - "description": "A CA to create", - "name": "ca", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/caCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/cas/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single CA by id. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Retrieves a single CA", - "operationId": "detailCa", - "responses": { - "200": { - "description": "A singular Certificate Authority (CA) resource", - "schema": { - "$ref": "#/definitions/detailCaEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a CA by id. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Update all fields on a CA", - "operationId": "updateCa", - "parameters": [ - { - "description": "A CA update object", - "name": "ca", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/caUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a CA by id. Deleting a CA will delete its associated certificate authenticators. This can make it\nimpossible for identities to authenticate if they no longer have any valid authenticators. Requires admin access.\n", - "tags": [ - "Certificate Authority" - ], - "summary": "Delete a CA", - "operationId": "deleteCa", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on a CA by id. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Update the supplied fields on a CA", - "operationId": "patchCa", - "parameters": [ - { - "description": "A CA patch object", - "name": "ca", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/caPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/cas/{id}/jwt": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "For CA auto enrollment, the enrollment JWT is static and provided on each CA resource. This endpoint provides\nthe jwt as a text response.\n", - "produces": [ - "application/jwt" - ], - "tags": [ - "Certificate Authority" - ], - "summary": "Retrieve the enrollment JWT for a CA", - "operationId": "getCaJwt", - "responses": { - "200": { - "description": "The result is the JWT text to validate the CA", - "schema": { - "type": "string" - }, - "examples": { - "application/jwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImNhIiwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6MTI 4MC8ifQ.Ot6lhNBSOw8ygHytdI5l7WDf9EWadOj44UPvJ0c-8mJ54fClWM3uMZrAHSSfV6KmOSZOeBBJe4VlNyoD-_MOECP0BzYSnSQP3E zJb0VlM-fFmGcKNGW157icyZNISfO43JL_Lw2QPBzTgikqSIj9eZnocC3BeAmZCHsVznnLfHWqDldcmuxnu-5MNOSrWV1x9iVcgLFlLHXK 2PLA4qIiZmlQTrQjpHJmUaoJ07mnj8hMKzxB3wBG8kpazjEo7HDRCO06aBH4eqFgf_l0iT8Dzcb31jquWMGUoSXPhf4lVJh_FiNcR1wVx- UiHLbG5h23Aqf1UJF-F38rc1FElKz0Zg" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/cas/{id}/verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows a CA to become verified by submitting a certificate in PEM format that has been signed by the target CA.\nThe common name on the certificate must match the verificationToken property of the CA. Unverfieid CAs can not\nbe used for enrollment/authentication. Requires admin access.\n", - "consumes": [ - "text/plain" - ], - "tags": [ - "Certificate Authority" - ], - "summary": "Verify a CA", - "operationId": "verifyCa", - "parameters": [ - { - "description": "A PEM formatted certificate signed by the target CA with the common name matching the CA's validationToken", - "name": "certificate", - "in": "body", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/config-types": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Config" - ], - "summary": "List config-types", - "operationId": "listConfigTypes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of config-types", - "schema": { - "$ref": "#/definitions/listConfigTypesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "tags": [ - "Config" - ], - "summary": "Create a config-type. Requires admin access.", - "operationId": "createConfigType", - "parameters": [ - { - "description": "A config-type to create", - "name": "configType", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configTypeCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/config-types/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single config-type by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Retrieves a single config-type", - "operationId": "detailConfigType", - "responses": { - "200": { - "description": "A singular config-type resource", - "schema": { - "$ref": "#/definitions/detailConfigTypeEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a config-type by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update all fields on a config-type", - "operationId": "updateConfigType", - "parameters": [ - { - "description": "A config-type update object", - "name": "configType", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configTypeUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a config-type by id. Removing a configuration type that are in use will result in a 409 conflict HTTP status code and error. All configurations of a type must be removed first.", - "tags": [ - "Config" - ], - "summary": "Delete a config-type", - "operationId": "deleteConfigType", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a config-type. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update the supplied fields on a config-type", - "operationId": "patchConfigType", - "parameters": [ - { - "description": "A config-type patch object", - "name": "configType", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configTypePatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/config-types/{id}/configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Lists the configs associated to a config-type. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Lists the configs of a specific config-type", - "operationId": "listConfigsForConfigType", - "responses": { - "200": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Config" - ], - "summary": "List configs", - "operationId": "listConfigs", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a config resource. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Create a config resource", - "operationId": "createConfig", - "parameters": [ - { - "description": "A config to create", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/configs/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Retrieves a single config", - "operationId": "detailConfig", - "responses": { - "200": { - "description": "A singular config resource", - "schema": { - "$ref": "#/definitions/detailConfigEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update all fields on a config", - "operationId": "updateConfig", - "parameters": [ - { - "description": "A config update object", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Delete a config", - "operationId": "deleteConfig", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a config. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update the supplied fields on a config", - "operationId": "patchConfig", - "parameters": [ - { - "description": "A config patch object", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-api-session": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves the API session that was used to issue the current request", - "tags": [ - "Current API Session" - ], - "summary": "Return the current API session", - "operationId": "getCurrentAPISession", - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": null, - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Terminates the current API session", - "tags": [ - "Current API Session" - ], - "summary": "Logout", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns the identity associated with the API sessions used to issue the current request", - "tags": [ - "Current Identity" - ], - "summary": "Return the current identity", - "operationId": "getCurrentIdentity", - "responses": { - "200": { - "description": "The identity associated with the API Session used to issue the request", - "schema": { - "$ref": "#/definitions/currentIdentityDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "edge-router-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/edge-routers" - }, - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - }, - "service-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/identities" - } - }, - "authenticators": { - "updb": { - "username": "admin" - } - }, - "createdAt": "2020-01-13T16:38:13.6854788Z", - "enrollment": {}, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "isAdmin": true, - "isDefaultAdmin": true, - "name": "Default Admin", - "roleAttributes": null, - "tags": {}, - "type": { - "_links": { - "self": { - "href": "./identity-types/User" - } - }, - "id": "User", - "name": "User", - "urlName": "identity-types" - }, - "updatedAt": "2020-01-13T16:38:13.6854788Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination.", - "tags": [ - "Current API Session" - ], - "summary": "List authenticators for the current identity", - "operationId": "listCurrentIdentityAuthenticators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity.", - "tags": [ - "Current API Session" - ], - "summary": "Retrieve an authenticator for the current identity", - "operationId": "detailCurrentIdentityAuthenticator", - "responses": { - "200": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's\nidentity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update all fields on an authenticator of this identity", - "operationId": "updateCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator put object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorUpdateWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API\nsession's identity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update the supplied fields on an authenticator of this identity", - "operationId": "patchCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator patch object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorPatchWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled.\nAllows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation.\nThe response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint.\nAfter verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to recieve a new certificate associated with a certificate based authenticator", - "operationId": "extendCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "A response containg the identity's new certificate", - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend-verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt.\nAfter receipt, the new client certificate must be used for new authentication requests.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to validate reciept of a new client certificate", - "operationId": "extendVerifyCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendValidateEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/mfa": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a ` + "`" + `POST /current-identity/mfa/verify` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Returns the current status of MFA enrollment", - "operationId": "detailMfa", - "responses": { - "200": { - "description": "The details of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via ` + "`" + `POST /current-identity/mfa/verify` + "`" + `\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Initiate MFA enrollment", - "operationId": "enrollMfa", - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The identity is already enrolled in MFA", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": null, - "cause": null, - "causeMessage": "", - "code": "ALREADY_MFA_ENROLLED", - "message": "The identity is already enrolled in MFA", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via ` + "`" + `DELETE /identities/\u003cid\u003e/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Disable MFA for the current identity", - "operationId": "deleteMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/qr-code": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started.\n", - "produces": [ - "image/png", - "application/json" - ], - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Show a QR code for unverified MFA enrollments", - "operationId": "detailMfaQrCode", - "responses": { - "200": { - "description": "OK" - }, - "404": { - "description": "No MFA enrollment or MFA enrollment is completed" - } - } - } - }, - "/current-identity/mfa/recovery-codes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment view the current recovery codes", - "operationId": "detailMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment regenerate the recovery codes", - "operationId": "createMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "The recovery codes of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaRecoveryCodesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via ` + "`" + `POST /current-identity/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Complete MFA enrollment by verifying a time based one time token", - "operationId": "verifyMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/check-data-integrity": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Starts a data integrity scan on the datastore. Requires admin access. Only once instance may run at a time, including runs of fixDataIntegrity.", - "tags": [ - "Database" - ], - "summary": "Starts a data integrity scan on the datastore", - "operationId": "checkDataIntegrity", - "responses": { - "202": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "429": { - "description": "The resource requested is rate limited and the rate limit has been exceeded", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "causeMessage": "you have hit a rate limit in the requested operation", - "code": "RATE_LIMITED", - "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/data-integrity-results": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns any results found from in-progress integrity checks. Requires admin access.", - "tags": [ - "Database" - ], - "summary": "Returns any results found from in-progress integrity checks", - "operationId": "dataIntegrityResults", - "responses": { - "200": { - "description": "A list of data integrity issues found", - "schema": { - "$ref": "#/definitions/dataIntegrityCheckResultEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/fix-data-integrity": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Runs a data integrity scan on the datastore, attempts to fix any issues it can, and returns any found issues. Requires admin access. Only once instance may run at a time, including runs of checkDataIntegrity.", - "tags": [ - "Database" - ], - "summary": "Runs a data integrity scan on the datastore, attempts to fix any issues it can and returns any found issues", - "operationId": "fixDataIntegrity", - "responses": { - "202": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "429": { - "description": "The resource requested is rate limited and the rate limit has been exceeded", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "causeMessage": "you have hit a rate limit in the requested operation", - "code": "RATE_LIMITED", - "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/snapshot": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a new database snapshot. Requires admin access.", - "tags": [ - "Database" - ], - "summary": "Create a new database snapshot", - "operationId": "createDatabaseSnapshot", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "429": { - "description": "The resource requested is rate limited and the rate limit has been exceeded", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "causeMessage": "you have hit a rate limit in the requested operation", - "code": "RATE_LIMITED", - "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router policy resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router Policy" - ], - "summary": "List edge router policies", - "operationId": "listEdgeRouterPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create an edge router policy resource. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Create an edge router policy resource", - "operationId": "createEdgeRouterPolicy", - "parameters": [ - { - "description": "An edge router policy to create", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-router-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single edge router policy by id. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Retrieves a single edge router policy", - "operationId": "detailEdgeRouterPolicy", - "responses": { - "200": { - "description": "A single edge router policy", - "schema": { - "$ref": "#/definitions/detailEdgeRouterPolicyEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an edge router policy by id. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Update all fields on an edge router policy", - "operationId": "updateEdgeRouterPolicy", - "parameters": [ - { - "description": "An edge router policy update object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an edge router policy by id. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Delete an edge router policy", - "operationId": "deleteEdgeRouterPolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an edge router policy. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Update the supplied fields on an edge router policy", - "operationId": "patchEdgeRouterPolicy", - "parameters": [ - { - "description": "An edge router policy patch object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-router-policies/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge routers an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router Policy" - ], - "summary": "List edge routers a policy affects", - "operationId": "listEdgeRouterPolicyEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-router-policies/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identities an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router Policy" - ], - "summary": "List identities an edge router policy affects", - "operationId": "listEdgeRouterPolicyIdentities", - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-router-role-attributes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of role attributes in use by edge routers; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Role Attributes" - ], - "summary": "List role attributes in use by edge routers", - "operationId": "listEdgeRouterRoleAttributes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router" - ], - "summary": "List edge routers", - "operationId": "listEdgeRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a edge router resource. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Create an edge router", - "operationId": "createEdgeRouter", - "parameters": [ - { - "description": "A edge router to create", - "name": "edgeRouter", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single edge router by id. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Retrieves a single edge router", - "operationId": "detailEdgeRouter", - "responses": { - "200": { - "description": "A singular edge router resource", - "schema": { - "$ref": "#/definitions/detailedEdgeRouterEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an edge router by id. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Update all fields on an edge router", - "operationId": "updateEdgeRouter", - "parameters": [ - { - "description": "An edge router update object", - "name": "edgeRouter", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an edge router by id. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Delete an edge router", - "operationId": "deleteEdgeRouter", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an edge router. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Update the supplied fields on an edge router", - "operationId": "patchEdgeRouter", - "parameters": [ - { - "description": "An edge router patch object", - "name": "edgeRouter", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router policies that apply to the specified edge router.", - "tags": [ - "Edge Router" - ], - "summary": "List the edge router policies that affect an edge router", - "operationId": "listEdgeRouterEdgeRouterPolicies", - "responses": { - "200": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router" - ], - "summary": "List associated identities", - "operationId": "listEdgeRouterIdentities", - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/re-enroll": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Removes current certificate based authentication mechanisms and reverts the edge router into a state where enrollment must be performed.\nThe router retains all other properties and associations. If the router is currently connected, it will be disconnected and any\nattemps to reconnect will fail until the enrollment process is completed with the newly generated JWT.\n\nIf the edge router has an existing outstanding enrollment JWT it will be replaced. The previous JWT will no longer be usable to\ncomplete the enrollment process.\n", - "tags": [ - "Edge Router" - ], - "summary": "Re-enroll an edge router", - "operationId": "reEnrollEdgeRouter", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/service-edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policies policies that apply to the specified edge router.", - "tags": [ - "Edge Router" - ], - "summary": "List the service policies that affect an edge router", - "operationId": "listEdgeRouterServiceEdgeRouterPolicies", - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router" - ], - "summary": "List associated services", - "operationId": "listEdgeRouterServices", - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/enrollments": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Enrollment" - ], - "summary": "List outstanding enrollments", - "operationId": "listEnrollments", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of enrollments", - "schema": { - "$ref": "#/definitions/listEnrollmentsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates a new OTT, OTTCA, or UPDB enrollment for a specific identity. If an enrollment of the same type is already outstanding the request will fail with a 409 conflict. If desired, an existing enrollment can be refreshed by ` + "`" + `enrollments/:id/refresh` + "`" + ` or deleted.", - "tags": [ - "Enrollment" - ], - "summary": "Create an outstanding enrollment for an identity", - "operationId": "createEnrollment", - "parameters": [ - { - "description": "An enrollment to create", - "name": "enrollment", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/enrollmentCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The request could not be completed due to a conflict of configuration or state", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - } - } - } - } - }, - "/enrollments/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single outstanding enrollment by id. Requires admin access.", - "tags": [ - "Enrollment" - ], - "summary": "Retrieves an outstanding enrollment", - "operationId": "detailEnrollment", - "responses": { - "200": { - "description": "A singular enrollment resource", - "schema": { - "$ref": "#/definitions/detailEnrollmentEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an outstanding enrollment by id. Requires admin access.", - "tags": [ - "Enrollment" - ], - "summary": "Delete an outstanding enrollment", - "operationId": "deleteEnrollment", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/enrollments/{id}/refresh": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "For expired or unexpired enrollments, reset the expiration window. A new JWT will be generated and must be used for the enrollment.", - "tags": [ - "Enrollment" - ], - "summary": "Refreshes an enrollment record's expiration window", - "operationId": "refreshEnrollment", - "parameters": [ - { - "description": "An enrollment refresh request", - "name": "refresh", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/enrollmentRefresh" - } - } - ], - "responses": { - "200": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/external-jwt-signers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of external JWT signers for authentication", - "tags": [ - "External JWT Signer" - ], - "summary": "List External JWT Signers", - "operationId": "listExternalJwtSigners", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of External JWT Signers", - "schema": { - "$ref": "#/definitions/listExternalJwtSignersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an External JWT Signer. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Creates an External JWT Signer", - "operationId": "createExternalJwtSigner", - "parameters": [ - { - "description": "An External JWT Signer to create", - "name": "externalJwtSigner", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/externalJwtSignerCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/external-jwt-signers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single External JWT Signer by id. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Retrieves a single External JWT Signer", - "operationId": "detailExternalJwtSigner", - "responses": { - "200": { - "description": "A singular External JWT Signer resource", - "schema": { - "$ref": "#/definitions/detailExternalJwtSignerEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an External JWT Signer by id. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Update all fields on an External JWT Signer", - "operationId": "updateExternalJwtSigner", - "parameters": [ - { - "description": "An External JWT Signer update object", - "name": "externalJwtSigner", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/externalJwtSignerUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an External JWT Signer by id. Requires admin access.\n", - "tags": [ - "External JWT Signer" - ], - "summary": "Delete an External JWT Signer", - "operationId": "deleteExternalJwtSigner", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on an External JWT Signer by id. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Update the supplied fields on an External JWT Signer", - "operationId": "patchExternalJwtSigner", - "parameters": [ - { - "description": "An External JWT Signer patch object", - "name": "externalJwtSigner", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/externalJwtSignerPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List identities", - "operationId": "listIdentities", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create an identity resource. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Create an identity resource", - "operationId": "createIdentity", - "parameters": [ - { - "description": "An identity to create", - "name": "identity", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/identities/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Retrieves a single identity", - "operationId": "detailIdentity", - "responses": { - "200": { - "description": "A single identity", - "schema": { - "$ref": "#/definitions/detailIdentityEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Update all fields on an identity", - "operationId": "updateIdentity", - "parameters": [ - { - "description": "An identity update object", - "name": "identity", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Delete an identity", - "operationId": "deleteIdentity", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an identity. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Update the supplied fields on an identity", - "operationId": "patchIdentity", - "parameters": [ - { - "description": "An identity patch object", - "name": "identity", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of authenticators associated to the identity specified\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve the current authenticators of a specific identity", - "operationId": "getIdentityAuthenticators", - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/disable": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin disable an identity for a set amount of time or indefinitely.\n", - "tags": [ - "Identity" - ], - "summary": "Set an identity as disabled", - "operationId": "disableIdentity", - "parameters": [ - { - "description": "Disable parameters", - "name": "disable", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/disableParams" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router policies that apply to the specified identity.", - "tags": [ - "Identity" - ], - "summary": "List the edge router policies that affect an identity", - "operationId": "listIdentitysEdgeRouterPolicies", - "responses": { - "200": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge-routers that the given identity may use to access services. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List accessible edge-routers", - "operationId": "listIdentityEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/enable": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin to remove disabled statuses from an identity.\n", - "tags": [ - "Identity" - ], - "summary": "Clears all disabled state from an identity", - "operationId": "enableIdentity", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/enrollments": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of enrollments associated to the identity specified\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve the current enrollments of a specific identity", - "operationId": "getIdentityEnrollments", - "responses": { - "200": { - "description": "A list of enrollments", - "schema": { - "$ref": "#/definitions/listEnrollmentsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/failed-service-requests": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of service session requests that failed due to posture checks. The entries will contain\nevery policy that was verified against and every failed check in each policy. Each check will include\nthe historical posture data and posture check configuration.\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve a list of the most recent service failure requests due to posture checks", - "operationId": "getIdentityFailedServiceRequests", - "responses": { - "200": { - "description": "Returns a list of service request failures", - "schema": { - "$ref": "#/definitions/failedServiceRequestEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/mfa": { - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin to remove MFA enrollment from a specific identity. Requires admin.\n", - "tags": [ - "Identity", - "MFA" - ], - "summary": "Remove MFA from an identitity", - "operationId": "removeIdentityMfa", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/policy-advice/{serviceId}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Analyzes policies to see if the given identity should be able to dial or bind the given service. |\nWill check services policies to see if the identity can access the service. Will check edge router policies |\nto check if the identity and service have access to common edge routers so that a connnection can be made. |\nWill also check if at least one edge router is on-line. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "Analyze policies relating the given identity and service", - "operationId": "getIdentityPolicyAdvice", - "responses": { - "200": { - "description": "Returns the document that represents the policy advice", - "schema": { - "$ref": "#/definitions/getIdentityPolicyAdviceEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "The id of a service", - "name": "serviceId", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/posture-data": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a nested map data represeting the posture data of the identity.\nThis data should be considered volatile.\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve the curent posture data for a specific identity.", - "operationId": "getIdentityPostureData", - "responses": { - "200": { - "description": "Returns the document that represents posture data", - "schema": { - "$ref": "#/definitions/postureDataEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/service-configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service configs associated to a specific identity", - "tags": [ - "Identity" - ], - "summary": "List the service configs associated a specific identity", - "operationId": "listIdentitysServiceConfigs", - "responses": { - "200": { - "description": "A list of service configs", - "schema": { - "$ref": "#/definitions/listServiceConfigsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Associate service configs to a specific identity", - "tags": [ - "Identity" - ], - "summary": "Associate service configs for a specific identity", - "operationId": "associateIdentitysServiceConfigs", - "parameters": [ - { - "description": "A service config patch object", - "name": "serviceConfigs", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceConfigsAssignList" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Remove service configs from a specific identity", - "tags": [ - "Identity" - ], - "summary": "Remove associated service configs from a specific identity", - "operationId": "disassociateIdentitysServiceConfigs", - "parameters": [ - { - "description": "An array of service and config id pairs to remove", - "name": "serviceConfigIdPairs", - "in": "body", - "schema": { - "$ref": "#/definitions/serviceConfigsAssignList" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/service-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policies that apply to the specified identity.", - "tags": [ - "Identity" - ], - "summary": "List the service policies that affect an identity", - "operationId": "listIdentityServicePolicies", - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of services that the given identity has access to. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List accessible services", - "operationId": "listIdentityServices", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/trace": { - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin to enable/disable data flow tracing for an identity\n", - "tags": [ - "Identity", - "Tracing" - ], - "summary": "Enable/disable data flow tracing for an identity", - "operationId": "updateIdentityTracing", - "parameters": [ - { - "description": "A traceSpec object", - "name": "traceSpec", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/traceSpec" - } - } - ], - "responses": { - "200": { - "description": "Returns the document that represents the trace state", - "schema": { - "$ref": "#/definitions/traceDetailEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identity-role-attributes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of role attributes in use by identities; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Role Attributes" - ], - "summary": "List role attributes in use by identities", - "operationId": "listIdentityRoleAttributes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/identity-types": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List available identity types", - "operationId": "listIdentityTypes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identity types", - "schema": { - "$ref": "#/definitions/listIdentityTypesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/identity-types/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single identity type by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Retrieves a identity type", - "operationId": "detailIdentityType", - "responses": { - "200": { - "description": "A single identity type", - "schema": { - "$ref": "#/definitions/detailIdentityTypeEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/posture-check-types": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of posture check types\n", - "produces": [ - "application/json; charset=utf-8" - ], - "tags": [ - "Posture Checks" - ], - "summary": "List a subset of posture check types", - "operationId": "listPostureCheckTypes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of posture check types", - "schema": { - "$ref": "#/definitions/listPostureCheckTypesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-check-types/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single posture check type by id", - "tags": [ - "Posture Checks" - ], - "summary": "Retrieves a single posture check type", - "operationId": "detailPostureCheckType", - "responses": { - "200": { - "description": "Retrieves a singular posture check type by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckTypeEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/posture-checks": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of posture checks\n", - "produces": [ - "application/json; charset=utf-8" - ], - "tags": [ - "Posture Checks" - ], - "summary": "List a subset of posture checks", - "operationId": "listPostureChecks", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of posture checks", - "schema": { - "$ref": "#/definitions/listPostureCheckEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates a Posture Checks", - "tags": [ - "Posture Checks" - ], - "summary": "Creates a Posture Checks", - "operationId": "createPostureCheck", - "parameters": [ - { - "description": "A Posture Check to create", - "name": "postureCheck", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureCheckCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-checks/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Retrieves a single Posture Checks", - "operationId": "detailPostureCheck", - "responses": { - "200": { - "description": "Retrieves a singular posture check by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Update all fields on a Posture Checks", - "operationId": "updatePostureCheck", - "parameters": [ - { - "description": "A Posture Check update object", - "name": "postureCheck", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureCheckUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Deletes and Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Deletes an Posture Checks", - "operationId": "deletePostureCheck", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "403": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on a Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Update the supplied fields on a Posture Checks", - "operationId": "patchPostureCheck", - "parameters": [ - { - "description": "A Posture Check patch object", - "name": "postureCheck", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureCheckPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Router" - ], - "summary": "List routers", - "operationId": "listRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a router resource. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Create a router resource", - "operationId": "createRouter", - "parameters": [ - { - "description": "A router to create", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Retrieves a single router", - "operationId": "detailRouter", - "responses": { - "200": { - "description": "A single router", - "schema": { - "$ref": "#/definitions/detailRouterEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update all fields on a router", - "operationId": "updateRouter", - "parameters": [ - { - "description": "A router update object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Delete a router", - "operationId": "deleteRouter", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a router. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update the supplied fields on a router", - "operationId": "patchRouter", - "parameters": [ - { - "description": "A router patch object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service edge router policy resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "List service edge router policies", - "operationId": "listServiceEdgeRouterPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service edge router policies", - "schema": { - "$ref": "#/definitions/listServiceEdgeRouterPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a service edge router policy resource. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Create a service edge router policy resource", - "operationId": "createServiceEdgeRouterPolicy", - "parameters": [ - { - "description": "A service edge router policy to create", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceEdgeRouterPolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/service-edge-router-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service edge policy by id. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Retrieves a single service edge policy", - "operationId": "detailServiceEdgeRouterPolicy", - "responses": { - "200": { - "description": "A single service edge router policy", - "schema": { - "$ref": "#/definitions/detailServiceEdgePolicyEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service edge policy by id. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Update all fields on a service edge policy", - "operationId": "updateServiceEdgeRouterPolicy", - "parameters": [ - { - "description": "A service edge router policy update object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceEdgeRouterPolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service edge policy by id. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Delete a service edge policy", - "operationId": "deleteServiceEdgeRouterPolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service edge policy. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Update the supplied fields on a service edge policy", - "operationId": "patchServiceEdgeRouterPolicy", - "parameters": [ - { - "description": "A service edge router policy patch object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceEdgeRouterPolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-edge-router-policies/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "List the edge routers that a service edge router policy applies to", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "List the edge routers that a service edge router policy applies to", - "operationId": "listServiceEdgeRouterPolicyEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-edge-router-policies/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "List the services that a service edge router policy applies to", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "List the services that a service edge router policy applies to", - "operationId": "listServiceEdgeRouterPolicyServices", - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List service policies", - "operationId": "listServicePolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a service policy resource. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Create a service policy resource", - "operationId": "createServicePolicy", - "parameters": [ - { - "description": "A service policy to create", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/service-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service policy by id. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Retrieves a single service policy", - "operationId": "detailServicePolicy", - "responses": { - "200": { - "description": "A single service policy", - "schema": { - "$ref": "#/definitions/detailServicePolicyEnvelop" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service policy by id. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Update all fields on a service policy", - "operationId": "updateServicePolicy", - "parameters": [ - { - "description": "A service policy update object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service policy by id. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Delete a service policy", - "operationId": "deleteServicePolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service policy. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Update the supplied fields on a service policy", - "operationId": "patchServicePolicy", - "parameters": [ - { - "description": "A service policy patch object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identity resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List identities a service policy affects", - "operationId": "listServicePolicyIdentities", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "400": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies/{id}/posture-checks": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of posture check resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List posture check a service policy includes", - "operationId": "listServicePolicyPostureChecks", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of posture checks", - "schema": { - "$ref": "#/definitions/listPostureCheckEnvelope" - } - }, - "400": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List services a service policy affects", - "operationId": "listServicePolicyServices", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "400": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-role-attributes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of role attributes in use by services; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Role Attributes" - ], - "summary": "List role attributes in use by services", - "operationId": "listServiceRoleAttributes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List services", - "operationId": "listServices", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a services resource. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Create a services resource", - "operationId": "createService", - "parameters": [ - { - "description": "A service to create", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/services/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Retrieves a single service", - "operationId": "detailService", - "responses": { - "200": { - "description": "A single service", - "schema": { - "$ref": "#/definitions/detailServiceEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update all fields on a service", - "operationId": "updateService", - "parameters": [ - { - "description": "A service update object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Delete a service", - "operationId": "deleteService", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update the supplied fields on a service", - "operationId": "patchService", - "parameters": [ - { - "description": "A service patch object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources associated to a specific service; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List configs associated to a specific service", - "operationId": "listServiceConfig", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge-routers that may be used to access the given service. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List accessible edge-routers", - "operationId": "listServiceEdgeRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identities that have access to this service. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List identities with access", - "operationId": "listServiceIdentities", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/service-edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service edge router policy resources that affect a specific service; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List service edge router policies that affect a specific service", - "operationId": "listServiceServiceEdgeRouterPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service edge router policies", - "schema": { - "$ref": "#/definitions/listServiceEdgeRouterPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/service-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policy resources that affect specific service; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List service policies that affect a specific service", - "operationId": "listServiceServicePolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/terminators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination.\n", - "tags": [ - "Service" - ], - "summary": "List of terminators assigned to a service", - "operationId": "listServiceTerminators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listTerminatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/sessions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of active sessions resources; supports filtering, sorting, and pagination. Requires admin access.\n\nSessions are tied to an API session and are moved when an API session times out or logs out. Active sessions\n(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active.\n", - "tags": [ - "Session" - ], - "summary": "List sessions", - "operationId": "listSessions", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of sessions", - "schema": { - "$ref": "#/definitions/listSessionsManagementEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/sessions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single session by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Retrieves a single session", - "operationId": "detailSession", - "responses": { - "200": { - "description": "A single session", - "schema": { - "$ref": "#/definitions/detailSessionManagementEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a session by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Delete a session", - "operationId": "deleteSession", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/sessions/{id}/route-path": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single session's route path by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Retrieves a single session's router path", - "operationId": "detailSessionRoutePath", - "responses": { - "200": { - "description": "A single session's route path", - "schema": { - "$ref": "#/definitions/detailSessionRoutePathEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs": { - "get": { - "security": [], - "description": "Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Returns a list of API specs", - "operationId": "listSpecs", - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listSpecsEnvelope" - } - } - } - } - }, - "/specs/{id}": { - "get": { - "security": [], - "description": "Returns single spec resource embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Return a single spec resource", - "operationId": "detailSpec", - "responses": { - "200": { - "description": "A single specification", - "schema": { - "$ref": "#/definitions/detailSpecEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs/{id}/spec": { - "get": { - "security": [], - "description": "Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc).", - "produces": [ - "text/yaml", - "application/json" - ], - "tags": [ - "Informational" - ], - "summary": "Returns the spec's file", - "operationId": "detailSpecBody", - "responses": { - "200": { - "description": "Returns the document that represents the specification", - "schema": { - "$ref": "#/definitions/detailSpecBodyEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/summary": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "This endpoint is usefull for UIs that wish to display UI elements with counts.", - "tags": [ - "Informational" - ], - "summary": "Returns a list of accessible resource counts", - "operationId": "listSummary", - "responses": { - "200": { - "description": "Entity counts scopped to the current identitie's access", - "schema": { - "$ref": "#/definitions/listSummaryCountsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/terminators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Terminator" - ], - "summary": "List terminators", - "operationId": "listTerminators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listTerminatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a terminator resource. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Create a terminator resource", - "operationId": "createTerminator", - "parameters": [ - { - "description": "A terminator to create", - "name": "terminator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/terminatorCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/terminators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Retrieves a single terminator", - "operationId": "detailTerminator", - "responses": { - "200": { - "description": "A single terminator", - "schema": { - "$ref": "#/definitions/detailTerminatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Update all fields on a terminator", - "operationId": "updateTerminator", - "parameters": [ - { - "description": "A terminator update object", - "name": "terminator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/terminatorUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Delete a terminator", - "operationId": "deleteTerminator", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a terminator. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Update the supplied fields on a terminator", - "operationId": "patchTerminator", - "parameters": [ - { - "description": "A terminator patch object", - "name": "terminator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/terminatorPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/transit-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Router" - ], - "summary": "List routers", - "operationId": "listTransitRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a router resource. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Create a router resource", - "operationId": "createTransitRouter", - "parameters": [ - { - "description": "A router to create", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/transit-routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Retrieves a single router", - "operationId": "detailTransitRouter", - "responses": { - "200": { - "description": "A single router", - "schema": { - "$ref": "#/definitions/detailRouterEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update all fields on a router", - "operationId": "updateTransitRouter", - "parameters": [ - { - "description": "A router update object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Delete a router", - "operationId": "deleteTransitRouter", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a router. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update the supplied fields on a router", - "operationId": "patchTransitRouter", - "parameters": [ - { - "description": "A router patch object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/version": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listVersion", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - } - }, - "definitions": { - "apiError": { - "type": "object", - "properties": { - "args": { - "$ref": "#/definitions/apiErrorArgs" - }, - "cause": { - "$ref": "#/definitions/apiErrorCause" - }, - "causeMessage": { - "type": "string" - }, - "code": { - "type": "string" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "message": { - "type": "string" - }, - "requestId": { - "type": "string" - } - } - }, - "apiErrorArgs": { - "type": "object", - "properties": { - "urlVars": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "apiErrorCause": { - "allOf": [ - { - "$ref": "#/definitions/apiFieldError" - }, - { - "$ref": "#/definitions/apiError" - } - ] - }, - "apiErrorEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/apiError" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "apiFieldError": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "value": { - "description": "can be any value - string, number, boolean, array or object" - } - } - }, - "apiSessionDetail": { - "description": "An API Session object", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "identity", - "identityId", - "configTypes", - "ipAddress", - "authQueries", - "cachedUpdatedAt", - "isMfaRequired", - "isMfaComplete", - "authenticatorId" - ], - "properties": { - "authQueries": { - "$ref": "#/definitions/authQueryList" - }, - "authenticatorId": { - "type": "string" - }, - "cachedLastActivityAt": { - "type": "string", - "format": "date-time" - }, - "configTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "ipAddress": { - "type": "string" - }, - "isMfaComplete": { - "type": "boolean" - }, - "isMfaRequired": { - "type": "boolean" - }, - "lastActivityAt": { - "type": "string", - "format": "date-time" - }, - "token": { - "type": "string" - } - } - } - ] - }, - "apiSessionList": { - "type": "array", - "items": { - "$ref": "#/definitions/apiSessionDetail" - } - }, - "apiSessionPostureData": { - "type": "object", - "required": [ - "mfa" - ], - "properties": { - "endpointState": { - "$ref": "#/definitions/postureDataEndpointState" - }, - "mfa": { - "$ref": "#/definitions/postureDataMfa" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - } - } - }, - "apiVersion": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "apiBaseUrls": { - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "attributes": { - "description": "A set of strings used to loosly couple this resource to policies", - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true, - "x-omitempty": true - }, - "authPolicyCreate": { - "description": "A Auth Policy resource", - "type": "object", - "required": [ - "name", - "primary", - "secondary" - ], - "properties": { - "name": { - "type": "string" - }, - "primary": { - "$ref": "#/definitions/authPolicyPrimary" - }, - "secondary": { - "$ref": "#/definitions/authPolicySecondary" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "authPolicyDetail": { - "description": "A Auth Policy resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "primary", - "secondary" - ], - "properties": { - "name": { - "type": "string" - }, - "primary": { - "$ref": "#/definitions/authPolicyPrimary" - }, - "secondary": { - "$ref": "#/definitions/authPolicySecondary" - } - } - } - ] - }, - "authPolicyList": { - "description": "An array of Auth Policies resources", - "type": "array", - "items": { - "$ref": "#/definitions/authPolicyDetail" - } - }, - "authPolicyPatch": { - "description": "A Auth Policy resource", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-nullable": true - }, - "primary": { - "$ref": "#/definitions/authPolicyPrimaryPatch" - }, - "secondary": { - "$ref": "#/definitions/authPolicySecondaryPatch" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "authPolicyPrimary": { - "type": "object", - "required": [ - "updb", - "cert", - "extJwt" - ], - "properties": { - "cert": { - "$ref": "#/definitions/authPolicyPrimaryCert" - }, - "extJwt": { - "$ref": "#/definitions/authPolicyPrimaryExtJwt" - }, - "updb": { - "$ref": "#/definitions/authPolicyPrimaryUpdb" - } - } - }, - "authPolicyPrimaryCert": { - "type": "object", - "required": [ - "allowed", - "allowExpiredCerts" - ], - "properties": { - "allowExpiredCerts": { - "type": "boolean" - }, - "allowed": { - "type": "boolean" - } - } - }, - "authPolicyPrimaryCertPatch": { - "type": "object", - "properties": { - "allowExpiredCerts": { - "type": "boolean", - "x-nullable": true - }, - "allowed": { - "type": "boolean", - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicyPrimaryExtJwt": { - "type": "object", - "required": [ - "allowed", - "allowedSigners" - ], - "properties": { - "allowed": { - "type": "boolean" - }, - "allowedSigners": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "authPolicyPrimaryExtJwtPatch": { - "type": "object", - "properties": { - "allowed": { - "type": "boolean", - "x-nullable": true - }, - "allowedSigners": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicyPrimaryPatch": { - "type": "object", - "properties": { - "cert": { - "$ref": "#/definitions/authPolicyPrimaryCertPatch" - }, - "extJwt": { - "$ref": "#/definitions/authPolicyPrimaryExtJwtPatch" - }, - "updb": { - "$ref": "#/definitions/authPolicyPrimaryUpdbPatch" - } - } - }, - "authPolicyPrimaryUpdb": { - "type": "object", - "required": [ - "allowed", - "minPasswordLength", - "requireSpecialChar", - "requireNumberChar", - "requireMixedCase", - "maxAttempts", - "lockoutDurationMinutes" - ], - "properties": { - "allowed": { - "type": "boolean" - }, - "lockoutDurationMinutes": { - "type": "integer" - }, - "maxAttempts": { - "type": "integer" - }, - "minPasswordLength": { - "type": "integer" - }, - "requireMixedCase": { - "type": "boolean" - }, - "requireNumberChar": { - "type": "boolean" - }, - "requireSpecialChar": { - "type": "boolean" - } - } - }, - "authPolicyPrimaryUpdbPatch": { - "type": "object", - "properties": { - "allowed": { - "type": "boolean", - "x-nullable": true - }, - "lockoutDurationMinutes": { - "type": "integer", - "x-nullable": true - }, - "maxAttempts": { - "type": "integer", - "x-nullable": true - }, - "minPasswordLength": { - "type": "integer", - "x-nullable": true - }, - "requireMixedCase": { - "type": "boolean", - "x-nullable": true - }, - "requireNumberChar": { - "type": "boolean", - "x-nullable": true - }, - "requireSpecialChar": { - "type": "boolean", - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicySecondary": { - "type": "object", - "required": [ - "requireTotp" - ], - "properties": { - "requireExtJwtSigner": { - "type": "string", - "x-nullable": true, - "x-omit-empty": false - }, - "requireTotp": { - "type": "boolean" - } - } - }, - "authPolicySecondaryPatch": { - "type": "object", - "properties": { - "requireExtJwtSigner": { - "type": "string", - "x-nullable": true - }, - "requireTotp": { - "type": "boolean", - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicyUpdate": { - "$ref": "#/definitions/authPolicyCreate" - }, - "authQueryDetail": { - "type": "object", - "required": [ - "provider" - ], - "properties": { - "format": { - "$ref": "#/definitions/mfaFormats" - }, - "httpMethod": { - "type": "string" - }, - "httpUrl": { - "type": "string" - }, - "maxLength": { - "type": "integer" - }, - "minLength": { - "type": "integer" - }, - "provider": { - "$ref": "#/definitions/mfaProviders" - }, - "typeId": { - "type": "string" - } - } - }, - "authQueryList": { - "type": "array", - "items": { - "$ref": "#/definitions/authQueryDetail" - } - }, - "authenticate": { - "description": "A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method.", - "type": "object", - "properties": { - "configTypes": { - "$ref": "#/definitions/configTypes" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "password": { - "$ref": "#/definitions/password" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorCreate": { - "description": "Creates an authenticator for a specific identity which can be used for API authentication", - "type": "object", - "required": [ - "method", - "identityId" - ], - "properties": { - "certPem": { - "description": "The client certificate the identity will login with. Used only for method='cert'", - "type": "string" - }, - "identityId": { - "description": "The id of an existing identity that will be assigned this authenticator", - "type": "string" - }, - "method": { - "description": "The type of authenticator to create; which will dictate which properties on this object are required.", - "type": "string" - }, - "password": { - "description": "The password the identity will login with. Used only for method='updb'", - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "description": "The username that the identity will login with. Used only for method='updb'", - "type": "string" - } - } - }, - "authenticatorDetail": { - "description": "A singular authenticator resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "method", - "identityId", - "identity" - ], - "properties": { - "certPem": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "method": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - ] - }, - "authenticatorList": { - "description": "An array of authenticator resources", - "type": "array", - "items": { - "$ref": "#/definitions/authenticatorDetail" - } - }, - "authenticatorPatch": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "properties": { - "password": { - "$ref": "#/definitions/passwordNullable" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/usernameNullable" - } - } - }, - "authenticatorPatchWithCurrent": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorPatch" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "authenticatorUpdate": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "password": { - "$ref": "#/definitions/password" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorUpdateWithCurrent": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorUpdate" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "baseEntity": { - "description": "Fields shared by all Edge API entities", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "_links" - ], - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "caCreate": { - "description": "A create Certificate Authority (CA) object", - "type": "object", - "required": [ - "name", - "certPem", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles" - ], - "properties": { - "certPem": { - "type": "string", - "example": "-----BEGIN CERTIFICATE-----\nMIICUjCCAdmgAwIBAgIJANooo7NB+dZZMAoGCCqGSM49BAMCMF4xCzAJBgNVBAYT\nAlVTMQswCQYDVQQIDAJOQzETMBEGA1UECgwKTmV0Rm91bmRyeTEtMCsGA1UEAwwk\nTmV0Rm91bmRyeSBaaXRpIEV4dGVybmFsIEFQSSBSb290IENBMB4XDTE4MTExNTEy\nNTcwOVoXDTM4MTExMDEyNTcwOVowXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5D\nMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0wKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkg\nRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARwq61Z\nIaqbaw0PDt3frJZaHjkxfZhwYrykI1GlbRNd/jix03lVG9qvpN5Og9fQfFFcFmD/\n3vCE9S6O0npm0mADQxcBcxbMRAH5dtBuCuiJW6qAAbPgiM32vqSxBiFt0KejYzBh\nMB0GA1UdDgQWBBRx1OVGuc/jdltDc8YBtkw8Tbr4fjAfBgNVHSMEGDAWgBRx1OVG\nuc/jdltDc8YBtkw8Tbr4fjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB\nhjAKBggqhkjOPQQDAgNnADBkAjBDRxNZUaIVpkQKnAgJukl3ysd3/i7Z6hDyIEms\nkllz/+ZvmdBp9iedV5o5BvJUggACMCv+UBFlJH7pmsOCo/F45Kk178YsCC7gaMxE\n1ZG1zveyMvsYsH04C9FndE6w2MLvlA==\n-----END CERTIFICATE-----\n" - }, - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaim" - }, - "identityNameFormat": { - "type": "string" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "name": { - "type": "string", - "example": "Test 3rd Party External CA" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "caDetail": { - "description": "A Certificate Authority (CA) resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "fingerprint", - "certPem", - "isVerified", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles", - "identityNameFormat" - ], - "properties": { - "certPem": { - "type": "string" - }, - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaim" - }, - "fingerprint": { - "type": "string" - }, - "identityNameFormat": { - "type": "string" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isVerified": { - "type": "boolean", - "example": false - }, - "name": { - "type": "string" - }, - "verificationToken": { - "type": "string", - "format": "uuid" - } - } - } - ] - }, - "caList": { - "description": "An array of Certificate Authority (CA) resources", - "type": "array", - "items": { - "$ref": "#/definitions/caDetail" - } - }, - "caPatch": { - "type": "object", - "properties": { - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaimPatch" - }, - "identityNameFormat": { - "type": "string", - "x-nullable": true - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "name": { - "type": "string", - "x-nullable": true, - "example": "My CA" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "caUpdate": { - "type": "object", - "required": [ - "name", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles", - "identityNameFormat" - ], - "properties": { - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaim" - }, - "identityNameFormat": { - "type": "string" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "name": { - "type": "string", - "example": "My CA" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "commonEdgeRouterProperties": { - "type": "object", - "required": [ - "hostname", - "name", - "supportedProtocols", - "syncStatus", - "isOnline", - "cost", - "noTraversal" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "hostname": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "supportedProtocols": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "syncStatus": { - "type": "string" - } - } - }, - "configCreate": { - "description": "A config create object", - "type": "object", - "required": [ - "name", - "configTypeId", - "data" - ], - "properties": { - "configTypeId": { - "description": "The id of a config-type that the data section will match", - "type": "string" - }, - "data": { - "description": "Data payload is defined by the schema of the config-type defined in the type parameter", - "type": "object", - "additionalProperties": true, - "x-nullable": false - }, - "name": { - "type": "string", - "example": "default.ziti-tunneler-server.v1" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "example": { - "configTypeId": "cea49285-6c07-42cf-9f52-09a9b115c783", - "data": { - "hostname": "example.com", - "port": 80 - }, - "name": "test-config" - } - }, - "configDetail": { - "description": "A config resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "configTypeId", - "configType", - "data" - ], - "properties": { - "configType": { - "$ref": "#/definitions/entityRef" - }, - "configTypeId": { - "type": "string" - }, - "data": { - "description": "The data section of a config is based on the schema of its type", - "type": "object" - }, - "name": { - "type": "string" - } - } - } - ] - }, - "configList": { - "description": "An array of config resources", - "type": "array", - "items": { - "$ref": "#/definitions/configDetail" - } - }, - "configPatch": { - "description": "A config patch object", - "type": "object", - "properties": { - "data": { - "description": "Data payload is defined by the schema of the config-type defined in the type parameter", - "type": "object", - "additionalProperties": true - }, - "name": { - "type": "string", - "example": "default.ziti-tunneler-server.v1" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "example": { - "data": { - "hostname": "example.com", - "port": 80 - }, - "name": "example-config-name" - } - }, - "configTypeCreate": { - "description": "A config-type create object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "configTypeDetail": { - "description": "A config-type resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "schema" - ], - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - } - } - } - ] - }, - "configTypeList": { - "description": "An array of config-type resources", - "type": "array", - "items": { - "$ref": "#/definitions/configTypeDetail" - } - }, - "configTypePatch": { - "description": "A config-type patch object", - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "configTypeUpdate": { - "description": "A config-type update object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "configTypes": { - "description": "Specific configuration types that should be returned", - "type": "array", - "items": { - "type": "string" - } - }, - "configUpdate": { - "description": "A config update object", - "type": "object", - "required": [ - "name", - "data" - ], - "properties": { - "data": { - "description": "Data payload is defined by the schema of the config-type defined in the type parameter", - "type": "object", - "additionalProperties": true, - "x-nullable": false - }, - "name": { - "type": "string", - "example": "default.ziti-tunneler-server.v1" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "example": { - "data": { - "hostname": "example.com", - "port": 80 - }, - "name": "example-config-name" - } - }, - "createEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/createLocation" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "createLocation": { - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "id": { - "type": "string" - } - } - }, - "currentApiSessionDetail": { - "description": "An API Session object for the current API session", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/apiSessionDetail" - }, - { - "type": "object", - "required": [ - "expiresAt", - "expirationSeconds" - ], - "properties": { - "expirationSeconds": { - "type": "integer" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - } - ] - }, - "currentApiSessionDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "currentIdentityDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "dataIntegrityCheckDetail": { - "type": "object", - "required": [ - "description", - "fixed" - ], - "properties": { - "description": { - "type": "string" - }, - "fixed": { - "type": "boolean" - } - } - }, - "dataIntegrityCheckDetailList": { - "type": "array", - "items": { - "$ref": "#/definitions/dataIntegrityCheckDetail" - } - }, - "dataIntegrityCheckDetails": { - "type": "object", - "required": [ - "inProgress", - "fixingErrors", - "tooManyErrors", - "startTime", - "endTime", - "error", - "results" - ], - "properties": { - "endTime": { - "type": "string", - "format": "date-time" - }, - "error": { - "type": "string" - }, - "fixingErrors": { - "type": "boolean" - }, - "inProgress": { - "type": "boolean" - }, - "results": { - "$ref": "#/definitions/dataIntegrityCheckDetailList" - }, - "startTime": { - "type": "string", - "format": "date-time" - }, - "tooManyErrors": { - "type": "boolean" - } - } - }, - "dataIntegrityCheckResultEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/dataIntegrityCheckDetails" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailApiSessionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/apiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailAuthPolicyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authPolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailAuthenticatorEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authenticatorDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailCaEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/caDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailConfigEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailConfigTypeEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configTypeDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailEdgeRouterPolicyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterPolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailEnrollmentEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/enrollmentDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailExternalJwtSignerEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/externalJwtSignerDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailIdentityEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailIdentityTypeEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityTypeDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfa": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "isVerified" - ], - "properties": { - "isVerified": { - "type": "boolean" - }, - "provisioningUrl": { - "description": "Not provided if MFA verification has been completed", - "type": "string" - }, - "recoveryCodes": { - "description": "Not provided if MFA verification has been completed", - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/detailMfa" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfaRecoveryCodes": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "recoveryCodes" - ], - "properties": { - "recoveryCodes": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaRecoveryCodesEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/detailMfaRecoveryCodes" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailPostureCheckEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureCheckDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailPostureCheckTypeEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureCheckTypeDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailRouterEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/routerDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServiceEdgePolicyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceEdgeRouterPolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServiceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServicePolicyEnvelop": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/servicePolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSessionManagementEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionManagementDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSessionRoutePathEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionRoutePathDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecBodyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specBodyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailTerminatorEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/terminatorDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailedEdgeRouterEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "dialBind": { - "type": "string", - "enum": [ - "Dial", - "Bind" - ] - }, - "dialBindArray": { - "type": "array", - "items": { - "$ref": "#/definitions/dialBind" - } - }, - "disableParams": { - "type": "object", - "required": [ - "durationMinutes" - ], - "properties": { - "durationMinutes": { - "type": "integer" - } - } - }, - "edgeRouterCreate": { - "description": "An edge router create object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterDetail": { - "description": "A detail edge router resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "$ref": "#/definitions/commonEdgeRouterProperties" - }, - { - "type": "object", - "required": [ - "isVerified", - "roleAttributes", - "os", - "version", - "arch", - "buildDate", - "revision", - "isTunnelerEnabled" - ], - "properties": { - "certPem": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "enrollmentCreatedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentJwt": { - "type": "string", - "x-nullable": true - }, - "enrollmentToken": { - "type": "string", - "x-nullable": true - }, - "fingerprint": { - "type": "string" - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "isVerified": { - "type": "boolean" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "unverifiedCertPem": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "unverifiedFingerprint": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "versionInfo": { - "$ref": "#/definitions/versionInfo" - } - } - } - ], - "example": { - "_links": { - "edge-router-policies": { - "href": "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d/edge-routers" - }, - "self": { - "href": "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d" - } - }, - "cost": 0, - "createdAt": "2020-03-16T17:13:31.5807454Z", - "enrollmentCreatedAt": "2020-03-16T17:13:31.5777637Z", - "enrollmentExpiresAt": "2020-03-16T17:18:31.5777637Z", - "enrollmentJwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImVyb3R0IiwiZXhwIjoxNTg0Mzc5MTExLCJpc3MiOiJodHRwczovL 2xvY2FsaG9zdDoxMjgwIiwianRpIjoiMzBhMWYwZWEtZDM5Yi00YWFlLWI4NTItMzA0Y2YxYzMwZDFmIiwic3ViIjoiYjA3NjZiOGQtYmQxYS00ZDI 4LTg0MTUtNjM5YjI5ZDNjODNkIn0.UsyQhCPORQ5tQnYWY7S88LNvV9iFS5Hy-P4aJaClZzEICobKgnQoyQblJcdMvk3cGKwyFqAnQtt0tDZkb8tHz Vqyv6bilHcAFuMRrdwXRqdXquabSN5geu2qBUnyzL7Mf2X85if8sbMida6snB4oLZsVRF3CRn4ODBJdeiVJ_Z4rgD-zW2IwtXPApT7ALyiiw2cN4EH 8pqQ7tpZKqztE0PGEbBQFPGKUFnm7oXyvSUo17EsFJUv5gUlBzfKKGolh5io4ptp22HZrqsqSnqDSOnYEZHonr5Yljuwiktrlh-JKiK6GGns5OAJMP dO9lgM4yHSpF2ILbqhWMV93Y3zMOg", - "enrollmentToken": "30a1f0ea-d39b-4aae-b852-304cf1c30d1f", - "fingerprint": null, - "hostname": "", - "id": "b0766b8d-bd1a-4d28-8415-639b29d3c83d", - "isOnline": false, - "isTunnelerEnabled": false, - "isVerified": false, - "name": "TestRouter-e33c837f-3222-4b40-bcd6-b3458fd5156e", - "noTraversal": false, - "roleAttributes": [ - "eastCoast", - "sales", - "test" - ], - "supportedProtocols": {}, - "tags": {}, - "updatedAt": "2020-03-16T17:13:31.5807454Z" - } - }, - "edgeRouterList": { - "description": "A list of edge router resources", - "type": "array", - "items": { - "$ref": "#/definitions/edgeRouterDetail" - } - }, - "edgeRouterPatch": { - "description": "An edge router patch object", - "type": "object", - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string", - "x-nullable": true - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyCreate": { - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "semantic", - "edgeRouterRoles", - "edgeRouterRolesDisplay", - "identityRoles", - "identityRolesDisplay", - "isSystem" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "edgeRouterRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "identityRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "isSystem": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ] - }, - "edgeRouterPolicyList": { - "type": "array", - "items": { - "$ref": "#/definitions/edgeRouterPolicyDetail" - } - }, - "edgeRouterPolicyPatch": { - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyUpdate": { - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterUpdate": { - "description": "An edge router update object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "empty": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "type": "object", - "example": {} - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "enrollmentCreate": { - "type": "object", - "required": [ - "method", - "expiresAt", - "identityId" - ], - "properties": { - "caId": { - "type": "string", - "x-nullable": true - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "identityId": { - "type": "string" - }, - "method": { - "type": "string", - "enum": [ - "ott", - "ottca", - "updb" - ] - }, - "username": { - "type": "string", - "x-nullable": true - } - } - }, - "enrollmentDetail": { - "description": "An enrollment object. Enrollments are tied to identities and potentially a CA. Depending on the\nmethod, different fields are utilized. For example ottca enrollments use the ` + "`" + `ca` + "`" + ` field and updb enrollments\nuse the username field, but not vice versa.\n", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "method", - "expiresAt", - "details" - ], - "properties": { - "caId": { - "type": "string", - "x-nullable": true - }, - "edgeRouter": { - "$ref": "#/definitions/entityRef" - }, - "edgeRouterId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "method": { - "type": "string" - }, - "token": { - "type": "string" - }, - "transitRouter": { - "$ref": "#/definitions/entityRef" - }, - "transitRouterId": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - ], - "example": { - "_links": { - "self": { - "href": "./enrollments/624fa53f-7629-4a7a-9e38-c1f4ce322c1d" - } - }, - "ca": null, - "createdAt": "0001-01-01T00:00:00Z", - "expiresAt": "2020-03-11T20:20:24.0055543Z", - "id": "624fa53f-7629-4a7a-9e38-c1f4ce322c1d", - "identity": { - "_links": { - "self": { - "href": "./identities/f047ac96-dc3a-408a-a6f2-0ba487c08ef9" - } - }, - "id": "f047ac96-dc3a-408a-a6f2-0ba487c08ef9", - "name": "updb--0f245140-7f2e-4326-badf-6aba55e52475", - "urlName": "identities" - }, - "method": "updb", - "tags": null, - "token": "1e727c8f-07e4-4a1d-a8b0-da0c7a01c6e1", - "updatedAt": "0001-01-01T00:00:00Z", - "username": "example-username" - } - }, - "enrollmentList": { - "description": "An array of enrollment resources", - "type": "array", - "items": { - "$ref": "#/definitions/enrollmentDetail" - } - }, - "enrollmentRefresh": { - "type": "object", - "required": [ - "expiresAt" - ], - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - }, - "entityRef": { - "description": "A reference to another resource and links to interact with it", - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "entity": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "envInfo": { - "description": "Environment information an authenticating client may provide", - "type": "object", - "properties": { - "arch": { - "type": "string" - }, - "os": { - "type": "string" - }, - "osRelease": { - "type": "string" - }, - "osVersion": { - "type": "string" - } - } - }, - "externalIdClaim": { - "type": "object", - "required": [ - "location", - "matcher", - "matcherCriteria", - "parser", - "parserCriteria", - "index" - ], - "properties": { - "index": { - "type": "integer", - "x-nullable": true - }, - "location": { - "type": "string", - "enum": [ - "COMMON_NAME", - "SAN_URI", - "SAN_EMAIL" - ], - "x-nullable": true - }, - "matcher": { - "type": "string", - "enum": [ - "ALL", - "PREFIX", - "SUFFIX", - "SCHEME" - ], - "x-nullable": true - }, - "matcherCriteria": { - "type": "string", - "x-nullable": true - }, - "parser": { - "type": "string", - "enum": [ - "NONE", - "SPLIT" - ], - "x-nullable": true - }, - "parserCriteria": { - "type": "string", - "x-nullable": true - } - } - }, - "externalIdClaimPatch": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "x-nullable": true - }, - "location": { - "type": "string", - "enum": [ - "COMMON_NAME", - "SAN_URI", - "SAN_EMAIL" - ], - "x-nullable": true - }, - "matcher": { - "type": "string", - "enum": [ - "ALL", - "PREFIX", - "SUFFIX", - "SCHEME" - ], - "x-nullable": true - }, - "matcherCriteria": { - "type": "string", - "x-nullable": true - }, - "parser": { - "type": "string", - "enum": [ - "NONE", - "SPLIT" - ], - "x-nullable": true - }, - "parserCriteria": { - "type": "string", - "x-nullable": true - } - } - }, - "externalJwtSignerCreate": { - "description": "A create Certificate Authority (CA) object", - "type": "object", - "required": [ - "name", - "enabled", - "issuer", - "audience" - ], - "properties": { - "audience": { - "type": "string", - "x-nullable": true - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string", - "x-nullable": true - }, - "enabled": { - "type": "boolean" - }, - "externalAuthUrl": { - "type": "string", - "format": "url", - "x-nullable": true - }, - "issuer": { - "type": "string" - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "example": "MyApps Signer" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "useExternalId": { - "type": "boolean", - "x-nullable": true - } - } - }, - "externalJwtSignerDetail": { - "description": "A External JWT Signer resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "certPem", - "jwksEndpoint", - "enabled", - "fingerprint", - "commonName", - "notAfter", - "notBefore", - "externalAuthUrl", - "claimsProperty", - "useExternalId", - "kid", - "issuer", - "audience" - ], - "properties": { - "audience": { - "type": "string" - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string" - }, - "commonName": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "externalAuthUrl": { - "type": "string", - "format": "url" - }, - "fingerprint": { - "type": "string" - }, - "issuer": { - "type": "string" - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string" - }, - "name": { - "type": "string", - "example": "MyApps Signer" - }, - "notAfter": { - "type": "string", - "format": "date-time" - }, - "notBefore": { - "type": "string", - "format": "date-time" - }, - "useExternalId": { - "type": "boolean" - } - } - } - ] - }, - "externalJwtSignerList": { - "description": "An array of External JWT Signers resources", - "type": "array", - "items": { - "$ref": "#/definitions/externalJwtSignerDetail" - } - }, - "externalJwtSignerPatch": { - "type": "object", - "properties": { - "audience": { - "type": "string", - "x-nullable": true - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string", - "x-nullable": true - }, - "enabled": { - "type": "boolean", - "x-nullable": true - }, - "externalAuthUrl": { - "type": "string", - "format": "url", - "x-nullable": true - }, - "issuer": { - "type": "string", - "x-nullable": true - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "x-nullable": true, - "example": "MyApps Signer" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "useExternalId": { - "type": "boolean", - "x-nullable": true - } - } - }, - "externalJwtSignerUpdate": { - "type": "object", - "required": [ - "name", - "enabled", - "issuer", - "audience" - ], - "properties": { - "audience": { - "type": "string", - "x-nullable": true - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string", - "x-nullable": true - }, - "enabled": { - "type": "boolean" - }, - "externalAuthUrl": { - "type": "string", - "format": "url", - "x-nullable": true - }, - "issuer": { - "type": "string" - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "example": "MyApps Signer" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "useExternalId": { - "type": "boolean", - "x-nullable": true - } - } - }, - "failedServiceRequest": { - "type": "object", - "properties": { - "apiSessionId": { - "type": "string" - }, - "policyFailures": { - "type": "array", - "items": { - "$ref": "#/definitions/policyFailure" - } - }, - "serviceId": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "sessionType": { - "$ref": "#/definitions/dialBind" - }, - "when": { - "type": "string", - "format": "date-time" - } - } - }, - "failedServiceRequestEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/failedServiceRequestList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "failedServiceRequestList": { - "type": "array", - "items": { - "$ref": "#/definitions/failedServiceRequest" - } - }, - "getIdentityPolicyAdviceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/policyAdvice" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityAuthenticators": { - "type": "object", - "properties": { - "cert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - } - }, - "identityCreate": { - "description": "An identity to create", - "type": "object", - "required": [ - "name", - "type", - "isAdmin" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string", - "x-nullable": true - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "enrollment": { - "type": "object", - "properties": { - "ott": { - "type": "boolean" - }, - "ottca": { - "type": "string" - }, - "updb": { - "type": "string" - } - } - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "isAdmin": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/identityType" - } - } - }, - "identityDetail": { - "description": "Detail of a specific identity", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "type", - "typeId", - "isDefaultAdmin", - "isAdmin", - "authenticators", - "enrollment", - "envInfo", - "sdkInfo", - "roleAttributes", - "hasEdgeRouterConnection", - "hasApiSession", - "isMfaEnabled", - "serviceHostingPrecedences", - "serviceHostingCosts", - "defaultHostingCost", - "authPolicyId", - "externalId", - "disabled" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string" - }, - "authenticators": { - "$ref": "#/definitions/identityAuthenticators" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "disabled": { - "type": "boolean" - }, - "disabledAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "disabledUntil": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollment": { - "$ref": "#/definitions/identityEnrollments" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "hasApiSession": { - "type": "boolean" - }, - "hasEdgeRouterConnection": { - "type": "boolean" - }, - "isAdmin": { - "type": "boolean" - }, - "isDefaultAdmin": { - "type": "boolean" - }, - "isMfaEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "type": { - "$ref": "#/definitions/entityRef" - }, - "typeId": { - "type": "string" - } - } - } - ] - }, - "identityEnrollments": { - "type": "object", - "properties": { - "ott": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "ottca": { - "type": "object", - "properties": { - "ca": { - "$ref": "#/definitions/entityRef" - }, - "caId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - } - } - }, - "identityExtendCerts": { - "type": "object", - "properties": { - "ca": { - "description": "A PEM encoded set of CA certificates", - "type": "string" - }, - "clientCert": { - "description": "A PEM encoded client certificate", - "type": "string" - } - } - }, - "identityExtendEnrollmentEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/identityExtendCerts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityExtendEnrollmentRequest": { - "type": "object", - "required": [ - "clientCertCsr" - ], - "properties": { - "clientCertCsr": { - "type": "string" - } - } - }, - "identityExtendValidateEnrollmentRequest": { - "type": "object", - "required": [ - "clientCert" - ], - "properties": { - "clientCert": { - "description": "A PEM encoded client certificate previously returned after an extension request", - "type": "string" - } - } - }, - "identityList": { - "description": "A list of identities", - "type": "array", - "items": { - "$ref": "#/definitions/identityDetail" - } - }, - "identityPatch": { - "type": "object", - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string", - "x-nullable": true - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "isAdmin": { - "type": "boolean", - "x-nullable": true - }, - "name": { - "type": "string", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/identityType" - } - } - }, - "identityType": { - "type": "string", - "enum": [ - "User", - "Device", - "Service", - "Router" - ] - }, - "identityTypeDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "identityTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/identityTypeDetail" - } - }, - "identityUpdate": { - "type": "object", - "required": [ - "type", - "name", - "isAdmin" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string", - "x-nullable": true - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "isAdmin": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/identityType" - } - } - }, - "link": { - "description": "A link to another resource", - "type": "object", - "required": [ - "href" - ], - "properties": { - "comment": { - "type": "string" - }, - "href": { - "type": "string", - "format": "uri" - }, - "method": { - "type": "string" - } - } - }, - "links": { - "description": "A map of named links", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/link" - }, - "x-omitempty": false - }, - "listApiSessionsEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/apiSessionList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listAuthPoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authPolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listAuthenticatorsEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/authenticatorList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCasEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/caList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listConfigTypesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listConfigsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listEdgeRouterPoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterPolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listEdgeRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listEnrollmentsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/enrollmentList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listExternalJwtSignersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/externalJwtSignerList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listIdentitiesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listIdentityTypesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listPostureCheckEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckDetail" - } - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listPostureCheckTypesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureCheckTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listRoleAttributesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/roleAttributesList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/routerList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServiceConfigsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceConfigList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServiceEdgeRouterPoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceEdgeRouterPolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServicePoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/servicePolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServicesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSessionsManagementEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionManagementList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSpecsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSummaryCounts": { - "type": "object", - "additionalProperties": { - "type": "integer" - } - }, - "listSummaryCountsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/listSummaryCounts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listTerminatorsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/terminatorList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listVersionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/version" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "meta": { - "type": "object", - "properties": { - "apiEnrollmentVersion": { - "type": "string" - }, - "apiVersion": { - "type": "string" - }, - "filterableFields": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": true - }, - "pagination": { - "$ref": "#/definitions/pagination" - } - } - }, - "mfaCode": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string" - } - } - }, - "mfaFormats": { - "type": "string", - "enum": [ - "numeric", - "alpha", - "alphaNumeric" - ] - }, - "mfaProviders": { - "type": "string", - "enum": [ - "ziti", - "url" - ] - }, - "namedRole": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "role": { - "type": "string" - } - } - }, - "namedRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/namedRole" - }, - "x-omitempty": false - }, - "operatingSystem": { - "type": "object", - "required": [ - "type", - "versions" - ], - "properties": { - "type": { - "$ref": "#/definitions/osType" - }, - "versions": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "osType": { - "type": "string", - "enum": [ - "Windows", - "WindowsServer", - "Android", - "iOS", - "Linux", - "macOS" - ] - }, - "pagination": { - "type": "object", - "required": [ - "limit", - "offset", - "totalCount" - ], - "properties": { - "limit": { - "type": "number", - "format": "int64" - }, - "offset": { - "type": "number", - "format": "int64" - }, - "totalCount": { - "type": "number", - "format": "int64" - } - } - }, - "password": { - "type": "string", - "maxLength": 100, - "minLength": 5 - }, - "passwordNullable": { - "type": "string", - "maxLength": 100, - "minLength": 5, - "x-nullable": true - }, - "policyAdvice": { - "type": "object", - "properties": { - "commonRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/routerEntityRef" - } - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "identityRouterCount": { - "type": "number", - "format": "int32" - }, - "isBindAllowed": { - "type": "boolean" - }, - "isDialAllowed": { - "type": "boolean" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - }, - "serviceRouterCount": { - "type": "number", - "format": "int32" - } - } - }, - "policyFailure": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckFailure" - } - }, - "policyId": { - "type": "string" - }, - "policyName": { - "type": "string" - } - } - }, - "postureCheckCreate": { - "type": "object", - "required": [ - "name", - "typeId" - ], - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureCheckDetail": { - "type": "object", - "required": [ - "name", - "typeId", - "version", - "roleAttributes", - "id", - "createdAt", - "updatedAt", - "_links", - "tags" - ], - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "type": "string" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "version": { - "type": "integer" - } - }, - "discriminator": "typeId" - }, - "postureCheckDomainCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "domains" - ], - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckDomainDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "domains" - ], - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckDomainPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckDomainUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "domains" - ], - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckFailure": { - "type": "object", - "required": [ - "postureCheckId", - "postureCheckName", - "postureCheckType" - ], - "properties": { - "postureCheckId": { - "type": "string" - }, - "postureCheckName": { - "type": "string" - }, - "postureCheckType": { - "type": "string" - } - }, - "discriminator": "postureCheckType" - }, - "postureCheckFailureDomain": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "type": "string" - }, - "expectedValue": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckFailureMacAddress": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "type": "array", - "items": { - "type": "string" - } - }, - "expectedValue": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckFailureMfa": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue", - "criteria" - ], - "properties": { - "actualValue": { - "$ref": "#/definitions/postureChecksFailureMfaValues" - }, - "criteria": { - "$ref": "#/definitions/postureChecksFailureMfaCriteria" - }, - "expectedValue": { - "$ref": "#/definitions/postureChecksFailureMfaValues" - } - } - } - ], - "x-class": "MFA" - }, - "postureCheckFailureOperatingSystem": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "$ref": "#/definitions/postureCheckFailureOperatingSystemActual" - }, - "expectedValue": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckFailureOperatingSystemActual": { - "type": "object", - "required": [ - "type", - "version" - ], - "properties": { - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "postureCheckFailureProcess": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "$ref": "#/definitions/postureCheckFailureProcessActual" - }, - "expectedValue": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckFailureProcessActual": { - "type": "object", - "required": [ - "isRunning", - "hash", - "signerFingerprints" - ], - "properties": { - "hash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "postureCheckFailureProcessMulti": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue", - "semantic" - ], - "properties": { - "actualValue": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckFailureProcessActual" - } - }, - "expectedValue": { - "type": "array", - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckMacAddressCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMacAddressDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMacAddressPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMacAddressUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMfaCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "$ref": "#/definitions/postureCheckMfaProperties" - } - ], - "x-class": "MFA" - }, - "postureCheckMfaDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "$ref": "#/definitions/postureCheckMfaProperties" - } - ], - "x-class": "MFA" - }, - "postureCheckMfaPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "$ref": "#/definitions/postureCheckMfaPropertiesPatch" - } - ], - "x-class": "MFA" - }, - "postureCheckMfaProperties": { - "type": "object", - "properties": { - "ignoreLegacyEndpoints": { - "type": "boolean" - }, - "promptOnUnlock": { - "type": "boolean" - }, - "promptOnWake": { - "type": "boolean" - }, - "timeoutSeconds": { - "type": "integer" - } - } - }, - "postureCheckMfaPropertiesPatch": { - "type": "object", - "properties": { - "ignoreLegacyEndpoints": { - "type": "boolean", - "x-nullable": true - }, - "promptOnUnlock": { - "type": "boolean", - "x-nullable": true - }, - "promptOnWake": { - "type": "boolean", - "x-nullable": true - }, - "timeoutSeconds": { - "type": "integer", - "x-nullable": true - } - } - }, - "postureCheckMfaUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "$ref": "#/definitions/postureCheckMfaProperties" - } - ], - "x-class": "MFA" - }, - "postureCheckOperatingSystemCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "operatingSystems" - ], - "properties": { - "operatingSystems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckOperatingSystemDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "operatingSystems" - ], - "properties": { - "operatingSystems": { - "type": "array", - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckOperatingSystemPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "operatingSystems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckOperatingSystemUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "operatingSystems" - ], - "properties": { - "operatingSystems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckPatch": { - "type": "object", - "required": [ - "typeId" - ], - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureCheckProcessCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckProcessDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckProcessMultiCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "semantic", - "processes" - ], - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessMultiDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "semantic", - "processes" - ], - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessMultiPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessMultiUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "semantic", - "processes" - ], - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckProcessUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckType": { - "type": "string", - "enum": [ - "OS", - "PROCESS", - "DOMAIN", - "MAC", - "MFA", - "PROCESS_MULTI" - ] - }, - "postureCheckTypeDetail": { - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "operatingSystems", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "operatingSystems": { - "type": "array", - "items": { - "$ref": "#/definitions/operatingSystem" - } - }, - "version": { - "type": "string" - } - } - } - ] - }, - "postureCheckTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckTypeDetail" - } - }, - "postureCheckUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureChecksFailureMfaCriteria": { - "type": "object", - "required": [ - "passedMfaAt", - "wokenAt", - "unlockedAt", - "timeoutSeconds", - "timeoutRemainingSeconds" - ], - "properties": { - "passedMfaAt": { - "type": "string", - "format": "date-time" - }, - "timeoutRemainingSeconds": { - "type": "integer" - }, - "timeoutSeconds": { - "type": "integer" - }, - "unlockedAt": { - "type": "string", - "format": "date-time" - }, - "wokenAt": { - "type": "string", - "format": "date-time" - } - } - }, - "postureChecksFailureMfaValues": { - "type": "object", - "properties": { - "passedMfa": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnUnlock": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnWake": { - "type": "boolean", - "x-omitempty": false - }, - "timedOut": { - "type": "boolean", - "x-omitempty": false - } - } - }, - "postureData": { - "type": "object", - "required": [ - "mac", - "domain", - "os", - "processes", - "apiSessionPostureData" - ], - "properties": { - "apiSessionPostureData": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/apiSessionPostureData" - } - }, - "domain": { - "$ref": "#/definitions/postureDataDomain" - }, - "mac": { - "$ref": "#/definitions/postureDataMac" - }, - "os": { - "$ref": "#/definitions/postureDataOs" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureDataProcess" - } - } - } - }, - "postureDataBase": { - "type": "object", - "required": [ - "postureCheckId", - "timedOut", - "lastUpdatedAt" - ], - "properties": { - "lastUpdatedAt": { - "type": "string", - "format": "date-time" - }, - "postureCheckId": { - "type": "string" - }, - "timedOut": { - "type": "boolean" - } - } - }, - "postureDataDomain": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "domain" - ], - "properties": { - "domain": { - "type": "string" - } - } - } - ] - }, - "postureDataEndpointState": { - "type": "object", - "required": [ - "wokenAt", - "unlockedAt" - ], - "properties": { - "unlockedAt": { - "type": "string", - "format": "date-time" - }, - "wokenAt": { - "type": "string", - "format": "date-time" - } - } - }, - "postureDataEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureData" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "postureDataMac": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "addresses" - ], - "properties": { - "addresses": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "postureDataMfa": { - "type": "object", - "required": [ - "apiSessionId", - "passedMfa", - "passedOnWake", - "passedOnUnlock", - "passedAt" - ], - "properties": { - "apiSessionId": { - "type": "string" - }, - "passedAt": { - "type": "string", - "format": "date-time", - "x-omitempty": false - }, - "passedMfa": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnUnlock": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnWake": { - "type": "boolean", - "x-omitempty": false - } - } - }, - "postureDataOs": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "type", - "version", - "build" - ], - "properties": { - "build": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - ] - }, - "postureDataProcess": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "properties": { - "binaryHash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "postureQueries": { - "type": "object", - "required": [ - "policyId", - "isPassing", - "postureQueries" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "policyId": { - "type": "string" - }, - "policyType": { - "$ref": "#/definitions/dialBind" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQuery" - } - } - } - }, - "postureQuery": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "queryType", - "isPassing", - "timeout", - "timeoutRemaining" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "process": { - "$ref": "#/definitions/postureQueryProcess" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueryProcess" - } - }, - "queryType": { - "$ref": "#/definitions/postureCheckType" - }, - "timeout": { - "type": "integer" - }, - "timeoutRemaining": { - "type": "integer" - } - } - } - ] - }, - "postureQueryProcess": { - "type": "object", - "properties": { - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - } - } - }, - "process": { - "type": "object", - "required": [ - "osType", - "path" - ], - "properties": { - "hashes": { - "type": "array", - "items": { - "type": "string" - } - }, - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - }, - "signerFingerprint": { - "type": "string" - } - } - }, - "processMulti": { - "type": "object", - "required": [ - "osType", - "path" - ], - "properties": { - "hashes": { - "type": "array", - "items": { - "type": "string" - } - }, - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "reEnroll": { - "type": "object", - "required": [ - "expiresAt" - ], - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - }, - "roleAttributesList": { - "description": "An array of role attributes", - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": false - }, - "routerCreate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "routerDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "isVerified", - "isOnline", - "fingerprint", - "cost", - "noTraversal" - ], - "properties": { - "cost": { - "type": "integer", - "maximum": 65535 - }, - "enrollmentCreatedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentJwt": { - "type": "string", - "x-nullable": true - }, - "enrollmentToken": { - "type": "string", - "x-nullable": true - }, - "fingerprint": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "isVerified": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean" - }, - "unverifiedCertPem": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "unverifiedFingerprint": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - } - } - } - ] - }, - "routerEntityRef": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/entityRef" - }, - { - "type": "object", - "required": [ - "isOnline" - ], - "properties": { - "isOnline": { - "type": "boolean" - } - } - } - ] - }, - "routerList": { - "type": "array", - "items": { - "$ref": "#/definitions/routerDetail" - } - }, - "routerPatch": { - "type": "object", - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "routerUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "x-nullable": true - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "sdkInfo": { - "description": "SDK information an authenticating client may provide", - "type": "object", - "properties": { - "appId": { - "type": "string" - }, - "appVersion": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "semantic": { - "type": "string", - "enum": [ - "AllOf", - "AnyOf" - ] - }, - "serviceConfigAssign": { - "type": "object", - "required": [ - "serviceId", - "configId" - ], - "properties": { - "configId": { - "type": "string" - }, - "serviceId": { - "type": "string" - } - } - }, - "serviceConfigDetail": { - "type": "object", - "required": [ - "serviceId", - "service", - "configId", - "config" - ], - "properties": { - "config": { - "$ref": "#/definitions/entityRef" - }, - "configId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - } - }, - "example": { - "config": { - "_links": { - "self": { - "href": "./identities/13347602-ba34-4ff7-8082-e533ba945744" - } - }, - "id": "13347602-ba34-4ff7-8082-e533ba945744", - "name": "test-config-02fade09-fcc3-426c-854e-18539726bdc6", - "urlName": "configs" - }, - "service": { - "_links": { - "self": { - "href": "./services/913a8c63-17a6-44d7-82b3-9f6eb997cf8e" - } - }, - "id": "913a8c63-17a6-44d7-82b3-9f6eb997cf8e", - "name": "netcat4545-egress-r2", - "urlName": "services" - } - } - }, - "serviceConfigList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceConfigDetail" - } - }, - "serviceConfigsAssignList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceConfigAssign" - } - }, - "serviceCreate": { - "type": "object", - "required": [ - "name", - "encryptionRequired" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "serviceDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "terminatorStrategy", - "roleAttributes", - "permissions", - "configs", - "config", - "encryptionRequired", - "postureQueries" - ], - "properties": { - "config": { - "description": "map of config data for this service keyed by the config type name. Only configs of the types requested will be returned.", - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/dialBindArray" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueries" - } - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "terminatorStrategy": { - "type": "string" - } - } - } - ] - }, - "serviceEdgeRouterPolicyCreate": { - "type": "object", - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "serviceEdgeRouterPolicyDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "semantic", - "edgeRouterRoles", - "edgeRouterRolesDisplay", - "serviceRoles", - "serviceRolesDisplay" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "edgeRouterRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "serviceRolesDisplay": { - "$ref": "#/definitions/namedRoles" - } - } - } - ] - }, - "serviceEdgeRouterPolicyList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceEdgeRouterPolicyDetail" - } - }, - "serviceEdgeRouterPolicyPatch": { - "type": "object", - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "serviceEdgeRouterPolicyUpdate": { - "type": "object", - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "serviceList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceDetail" - } - }, - "servicePatch": { - "type": "object", - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "servicePolicyCreate": { - "type": "object", - "required": [ - "name", - "type", - "semantic" - ], - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "servicePolicyDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "type", - "semantic", - "serviceRoles", - "serviceRolesDisplay", - "identityRoles", - "identityRolesDisplay", - "postureCheckRoles", - "postureCheckRolesDisplay" - ], - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "identityRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "postureCheckRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "serviceRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - } - ] - }, - "servicePolicyList": { - "type": "array", - "items": { - "$ref": "#/definitions/servicePolicyDetail" - } - }, - "servicePolicyPatch": { - "type": "object", - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "servicePolicyUpdate": { - "type": "object", - "required": [ - "name", - "type", - "semantic" - ], - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "serviceUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "sessionDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "type", - "apiSessionId", - "apiSession", - "serviceId", - "service", - "token", - "edgeRouters", - "identityId" - ], - "properties": { - "apiSession": { - "$ref": "#/definitions/entityRef" - }, - "apiSessionId": { - "type": "string" - }, - "edgeRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionEdgeRouter" - } - }, - "identityId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - } - ] - }, - "sessionEdgeRouter": { - "allOf": [ - { - "$ref": "#/definitions/commonEdgeRouterProperties" - }, - { - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - ] - }, - "sessionManagementDetail": { - "allOf": [ - { - "$ref": "#/definitions/sessionDetail" - }, - { - "type": "object", - "properties": { - "servicePolicies": { - "type": "array", - "items": { - "$ref": "#/definitions/entityRef" - } - } - } - } - ] - }, - "sessionManagementList": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionManagementDetail" - } - }, - "sessionRoutePathDetail": { - "type": "object", - "properties": { - "routePath": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "specBodyDetail": { - "type": "string" - }, - "specDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "specList": { - "type": "array", - "items": { - "$ref": "#/definitions/specDetail" - } - }, - "subTags": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "tags": { - "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", - "allOf": [ - { - "$ref": "#/definitions/subTags" - } - ], - "x-nullable": true - }, - "terminatorCost": { - "type": "integer", - "maximum": 65535 - }, - "terminatorCostMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorCost" - } - }, - "terminatorCreate": { - "type": "object", - "required": [ - "service", - "router", - "address", - "binding" - ], - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "identity": { - "type": "string" - }, - "identitySecret": { - "type": "string", - "format": "byte" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "type": "string" - }, - "service": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "terminatorDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "serviceId", - "service", - "routerId", - "router", - "binding", - "address", - "identity", - "cost", - "precedence", - "dynamicCost" - ], - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "dynamicCost": { - "$ref": "#/definitions/terminatorCost" - }, - "identity": { - "type": "string" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "$ref": "#/definitions/entityRef" - }, - "routerId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - } - } - } - ] - }, - "terminatorList": { - "type": "array", - "items": { - "$ref": "#/definitions/terminatorDetail" - } - }, - "terminatorPatch": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "type": "string" - }, - "service": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "terminatorPrecedence": { - "type": "string", - "enum": [ - "default", - "required", - "failed" - ] - }, - "terminatorPrecedenceMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorPrecedence" - } - }, - "terminatorUpdate": { - "type": "object", - "required": [ - "service", - "router", - "address", - "binding" - ], - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "type": "string" - }, - "service": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "traceDetail": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "traceId": { - "type": "string" - }, - "until": { - "type": "string", - "format": "date-time" - } - } - }, - "traceDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/traceDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "traceSpec": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "duration": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "traceId": { - "type": "string" - } - } - }, - "username": { - "type": "string", - "maxLength": 100, - "minLength": 4 - }, - "usernameNullable": { - "type": "string", - "maxLength": 100, - "minLength": 4, - "x-nullable": true - }, - "version": { - "type": "object", - "properties": { - "apiVersions": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/apiVersion" - } - } - }, - "buildDate": { - "type": "string", - "example": "2020-02-11 16:09:08" - }, - "revision": { - "type": "string", - "example": "ea556fc18740" - }, - "runtimeVersion": { - "type": "string", - "example": "go1.13.5" - }, - "version": { - "type": "string", - "example": "v0.9.0" - } - } - }, - "versionInfo": { - "type": "object", - "required": [ - "os", - "version", - "arch", - "buildDate", - "revision" - ], - "properties": { - "arch": { - "type": "string" - }, - "buildDate": { - "type": "string" - }, - "os": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "ztSession": { - "description": "An API Key that is provided post authentication", - "type": "apiKey", - "name": "zt-session", - "in": "header" - } - } -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "description": "OpenZiti Edge Management API", - "title": "Ziti Edge Management", - "contact": { - "name": "OpenZiti", - "url": "https://openziti.discourse.group", - "email": "help@openziti.org" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "0.25.5" - }, - "host": "demo.ziti.dev", - "basePath": "/edge/management/v1", - "paths": { - "/": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listRoot", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - }, - "/api-sessions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of active API sessions. The resources can be sorted, filtered, and paginated. This endpoint\nrequries admin access.\n", - "produces": [ - "application/json; charset=utf-8" - ], - "tags": [ - "API Session" - ], - "summary": "List active API sessions", - "operationId": "listAPISessions", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of active API Sessions", - "schema": { - "$ref": "#/definitions/listApiSessionsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/api-sessions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single API Session by id. Requires admin access.", - "tags": [ - "API Session" - ], - "summary": "Retrieves a single API Session", - "operationId": "detailAPISessions", - "responses": { - "200": { - "description": "Retrieves a singular API Session by id", - "schema": { - "$ref": "#/definitions/detailApiSessionEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Deletes and API sesion by id. Requires admin access.", - "tags": [ - "API Session" - ], - "summary": "Deletes an API Sessions", - "operationId": "deleteAPISessions", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "403": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/auth-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of Auth Policies", - "tags": [ - "Auth Policy" - ], - "summary": "List Auth Policies", - "operationId": "listAuthPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of Auth Policies", - "schema": { - "$ref": "#/definitions/listAuthPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an Auth Policy. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Creates an Auth Policy", - "operationId": "createAuthPolicy", - "parameters": [ - { - "description": "An Auth Policy to create", - "name": "authPolicy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authPolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/auth-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single Auth Policy by id. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Retrieves a single Auth Policy", - "operationId": "detailAuthPolicy", - "responses": { - "200": { - "description": "A singular Auth Policy resource", - "schema": { - "$ref": "#/definitions/detailAuthPolicyEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an Auth Policy by id. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Update all fields on an Auth Policy", - "operationId": "updateAuthPolicy", - "parameters": [ - { - "description": "An Auth Policy update object", - "name": "authPolicy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authPolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an Auth Policy by id. Requires admin access.\n", - "tags": [ - "Auth Policy" - ], - "summary": "Delete an Auth Policy", - "operationId": "deleteAuthPolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on an Auth Policy by id. Requires admin access.", - "tags": [ - "Auth Policy" - ], - "summary": "Update the supplied fields on an Auth Policy", - "operationId": "patchAuthPolicy", - "parameters": [ - { - "description": "An Auth Policy patch object", - "name": "authPolicy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authPolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/authenticate": { - "post": { - "security": [], - "description": "Allows authentication Methods include \"password\" and \"cert\"\n", - "tags": [ - "Authentication" - ], - "summary": "Authenticate via a method supplied via a query string parameter", - "operationId": "authenticate", - "parameters": [ - { - "name": "auth", - "in": "body", - "schema": { - "$ref": "#/definitions/authenticate" - } - } - ], - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": [], - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "403": { - "description": "The authentication request could not be processed as the credentials are invalid", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "INVALID_AUTH", - "message": "The authentication request failed", - "requestId": "5952ed10-3091-474f-a691-47ebab6990dc" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "enum": [ - "password", - "cert", - "ext-jwt" - ], - "type": "string", - "name": "method", - "in": "query", - "required": true - } - ] - }, - "/authenticate/mfa": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA authentication by submitting a MFA time based one time token or backup code.", - "tags": [ - "Authentication", - "MFA" - ], - "summary": "Complete MFA authentication", - "operationId": "authenticateMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaAuth", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - } - } - } - }, - "/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated.\nThis endpoint requires admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "List authenticators", - "operationId": "listAuthenticators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an authenticator for a specific identity. Requires admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "Creates an authenticator", - "operationId": "createAuthenticator", - "parameters": [ - { - "description": "A Authenticator create object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorCreate" - } - } - ], - "responses": { - "201": { - "description": "The create was successful", - "schema": { - "$ref": "#/definitions/authenticatorCreate" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/authenticators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single authenticator by id. Requires admin access.", - "tags": [ - "Authenticator" - ], - "summary": "Retrieves a single authenticator", - "operationId": "detailAuthenticator", - "responses": { - "200": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an authenticator by id. Requires admin access.", - "tags": [ - "Authenticator" - ], - "summary": "Update all fields on an authenticator", - "operationId": "updateAuthenticator", - "parameters": [ - { - "description": "An authenticator put object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in.\nRequires admin access.\n", - "tags": [ - "Authenticator" - ], - "summary": "Delete an Authenticator", - "operationId": "deleteAuthenticator", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an authenticator by id. Requires admin access.", - "tags": [ - "Authenticator" - ], - "summary": "Update the supplied fields on an authenticator", - "operationId": "patchAuthenticator", - "parameters": [ - { - "description": "An authenticator patch object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/authenticators/{id}/re-enroll": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an authenticator to be reverted to an enrollment and allows re-enrollment to occur. On success the \ncreated enrollment record response is provided and the source authenticator record will be deleted. The \nenrollment created depends on the authenticator. UPDB authenticators result in UPDB enrollments, CERT\nauthenticators result in OTT enrollments, CERT + CA authenticators result in OTTCA enrollments.\n", - "tags": [ - "Authenticator" - ], - "summary": "Reverts an authenticator to an enrollment", - "operationId": "reEnrollAuthenticator", - "parameters": [ - { - "description": "A reEnrollment request", - "name": "reEnroll", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/reEnroll" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/cas": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "List CAs", - "operationId": "listCas", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of Certificate Authorities (CAs)", - "schema": { - "$ref": "#/definitions/listCasEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates a CA in an unverified state. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Creates a CA", - "operationId": "createCa", - "parameters": [ - { - "description": "A CA to create", - "name": "ca", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/caCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/cas/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single CA by id. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Retrieves a single CA", - "operationId": "detailCa", - "responses": { - "200": { - "description": "A singular Certificate Authority (CA) resource", - "schema": { - "$ref": "#/definitions/detailCaEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a CA by id. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Update all fields on a CA", - "operationId": "updateCa", - "parameters": [ - { - "description": "A CA update object", - "name": "ca", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/caUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a CA by id. Deleting a CA will delete its associated certificate authenticators. This can make it\nimpossible for identities to authenticate if they no longer have any valid authenticators. Requires admin access.\n", - "tags": [ - "Certificate Authority" - ], - "summary": "Delete a CA", - "operationId": "deleteCa", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on a CA by id. Requires admin access.", - "tags": [ - "Certificate Authority" - ], - "summary": "Update the supplied fields on a CA", - "operationId": "patchCa", - "parameters": [ - { - "description": "A CA patch object", - "name": "ca", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/caPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/cas/{id}/jwt": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "For CA auto enrollment, the enrollment JWT is static and provided on each CA resource. This endpoint provides\nthe jwt as a text response.\n", - "produces": [ - "application/jwt" - ], - "tags": [ - "Certificate Authority" - ], - "summary": "Retrieve the enrollment JWT for a CA", - "operationId": "getCaJwt", - "responses": { - "200": { - "description": "The result is the JWT text to validate the CA", - "schema": { - "type": "string" - }, - "examples": { - "application/jwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImNhIiwiaXNzIjoiaHR0cHM6Ly9sb2NhbGhvc3Q6MTI 4MC8ifQ.Ot6lhNBSOw8ygHytdI5l7WDf9EWadOj44UPvJ0c-8mJ54fClWM3uMZrAHSSfV6KmOSZOeBBJe4VlNyoD-_MOECP0BzYSnSQP3E zJb0VlM-fFmGcKNGW157icyZNISfO43JL_Lw2QPBzTgikqSIj9eZnocC3BeAmZCHsVznnLfHWqDldcmuxnu-5MNOSrWV1x9iVcgLFlLHXK 2PLA4qIiZmlQTrQjpHJmUaoJ07mnj8hMKzxB3wBG8kpazjEo7HDRCO06aBH4eqFgf_l0iT8Dzcb31jquWMGUoSXPhf4lVJh_FiNcR1wVx- UiHLbG5h23Aqf1UJF-F38rc1FElKz0Zg" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/cas/{id}/verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows a CA to become verified by submitting a certificate in PEM format that has been signed by the target CA.\nThe common name on the certificate must match the verificationToken property of the CA. Unverfieid CAs can not\nbe used for enrollment/authentication. Requires admin access.\n", - "consumes": [ - "text/plain" - ], - "tags": [ - "Certificate Authority" - ], - "summary": "Verify a CA", - "operationId": "verifyCa", - "parameters": [ - { - "description": "A PEM formatted certificate signed by the target CA with the common name matching the CA's validationToken", - "name": "certificate", - "in": "body", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/config-types": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Config" - ], - "summary": "List config-types", - "operationId": "listConfigTypes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of config-types", - "schema": { - "$ref": "#/definitions/listConfigTypesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "tags": [ - "Config" - ], - "summary": "Create a config-type. Requires admin access.", - "operationId": "createConfigType", - "parameters": [ - { - "description": "A config-type to create", - "name": "configType", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configTypeCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/config-types/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single config-type by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Retrieves a single config-type", - "operationId": "detailConfigType", - "responses": { - "200": { - "description": "A singular config-type resource", - "schema": { - "$ref": "#/definitions/detailConfigTypeEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a config-type by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update all fields on a config-type", - "operationId": "updateConfigType", - "parameters": [ - { - "description": "A config-type update object", - "name": "configType", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configTypeUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a config-type by id. Removing a configuration type that are in use will result in a 409 conflict HTTP status code and error. All configurations of a type must be removed first.", - "tags": [ - "Config" - ], - "summary": "Delete a config-type", - "operationId": "deleteConfigType", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a config-type. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update the supplied fields on a config-type", - "operationId": "patchConfigType", - "parameters": [ - { - "description": "A config-type patch object", - "name": "configType", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configTypePatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/config-types/{id}/configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Lists the configs associated to a config-type. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Lists the configs of a specific config-type", - "operationId": "listConfigsForConfigType", - "responses": { - "200": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Config" - ], - "summary": "List configs", - "operationId": "listConfigs", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a config resource. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Create a config resource", - "operationId": "createConfig", - "parameters": [ - { - "description": "A config to create", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/configs/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Retrieves a single config", - "operationId": "detailConfig", - "responses": { - "200": { - "description": "A singular config resource", - "schema": { - "$ref": "#/definitions/detailConfigEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update all fields on a config", - "operationId": "updateConfig", - "parameters": [ - { - "description": "A config update object", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a config by id. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Delete a config", - "operationId": "deleteConfig", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a config. Requires admin access.", - "tags": [ - "Config" - ], - "summary": "Update the supplied fields on a config", - "operationId": "patchConfig", - "parameters": [ - { - "description": "A config patch object", - "name": "config", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/configPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-api-session": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves the API session that was used to issue the current request", - "tags": [ - "Current API Session" - ], - "summary": "Return the current API session", - "operationId": "getCurrentAPISession", - "responses": { - "200": { - "description": "The API session associated with the session used to issue the request", - "schema": { - "$ref": "#/definitions/currentApiSessionDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "self": { - "href": "./current-api-session" - } - }, - "configTypes": [], - "createdAt": "2020-03-09T19:03:49.1883693Z", - "expiresAt": "2020-03-09T19:34:21.5600897Z", - "id": "27343114-b44f-406e-9981-f3c4f2f28d54", - "identity": { - "_links": { - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - } - }, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "name": "Default Admin", - "urlName": "identities" - }, - "tags": [ - { - "userField1": 123 - }, - { - "userField2": "asdf" - } - ], - "token": "28bb0ed2-0577-4632-ae70-d17106b92871", - "updatedAt": "2020-03-09T19:04:21.5600897Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Terminates the current API session", - "tags": [ - "Current API Session" - ], - "summary": "Logout", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns the identity associated with the API sessions used to issue the current request", - "tags": [ - "Current Identity" - ], - "summary": "Return the current identity", - "operationId": "getCurrentIdentity", - "responses": { - "200": { - "description": "The identity associated with the API Session used to issue the request", - "schema": { - "$ref": "#/definitions/currentIdentityDetailEnvelope" - }, - "examples": { - "default": { - "data": { - "_links": { - "edge-router-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/edge-routers" - }, - "self": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d" - }, - "service-policies": { - "href": "./identities/66352d7b-a6b2-4ce9-85bb-9f18e318704d/identities" - } - }, - "authenticators": { - "updb": { - "username": "admin" - } - }, - "createdAt": "2020-01-13T16:38:13.6854788Z", - "enrollment": {}, - "id": "66352d7b-a6b2-4ce9-85bb-9f18e318704d", - "isAdmin": true, - "isDefaultAdmin": true, - "name": "Default Admin", - "roleAttributes": [], - "tags": {}, - "type": { - "_links": { - "self": { - "href": "./identity-types/User" - } - }, - "id": "User", - "name": "User", - "urlName": "identity-types" - }, - "updatedAt": "2020-01-13T16:38:13.6854788Z" - }, - "meta": {} - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination.", - "tags": [ - "Current API Session" - ], - "summary": "List authenticators for the current identity", - "operationId": "listCurrentIdentityAuthenticators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/authenticators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity.", - "tags": [ - "Current API Session" - ], - "summary": "Retrieve an authenticator for the current identity", - "operationId": "detailCurrentIdentityAuthenticator", - "responses": { - "200": { - "description": "A singular authenticator resource", - "schema": { - "$ref": "#/definitions/detailAuthenticatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's\nidentity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update all fields on an authenticator of this identity", - "operationId": "updateCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator put object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorUpdateWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API\nsession's identity.\n", - "tags": [ - "Current API Session" - ], - "summary": "Update the supplied fields on an authenticator of this identity", - "operationId": "patchCurrentIdentityAuthenticator", - "parameters": [ - { - "description": "An authenticator patch object", - "name": "authenticator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/authenticatorPatchWithCurrent" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled.\nAllows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation.\nThe response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint.\nAfter verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to recieve a new certificate associated with a certificate based authenticator", - "operationId": "extendCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "A response containg the identity's new certificate", - "schema": { - "$ref": "#/definitions/identityExtendEnrollmentEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/authenticators/{id}/extend-verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt.\nAfter receipt, the new client certificate must be used for new authentication requests.", - "tags": [ - "Current API Session", - "Enroll", - "Extend Enrollment" - ], - "summary": "Allows the current identity to validate reciept of a new client certificate", - "operationId": "extendVerifyCurrentIdentityAuthenticator", - "parameters": [ - { - "name": "extend", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityExtendValidateEnrollmentRequest" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/current-identity/mfa": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a ` + "`" + `POST /current-identity/mfa/verify` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Returns the current status of MFA enrollment", - "operationId": "detailMfa", - "responses": { - "200": { - "description": "The details of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via ` + "`" + `POST /current-identity/mfa/verify` + "`" + `\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Initiate MFA enrollment", - "operationId": "enrollMfa", - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The identity is already enrolled in MFA", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": null, - "cause": null, - "causeMessage": "", - "code": "ALREADY_MFA_ENROLLED", - "message": "The identity is already enrolled in MFA", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via ` + "`" + `DELETE /identities/\u003cid\u003e/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Disable MFA for the current identity", - "operationId": "deleteMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/qr-code": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started.\n", - "produces": [ - "application/json", - "image/png" - ], - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Show a QR code for unverified MFA enrollments", - "operationId": "detailMfaQrCode", - "responses": { - "200": { - "description": "OK" - }, - "404": { - "description": "No MFA enrollment or MFA enrollment is completed" - } - } - } - }, - "/current-identity/mfa/recovery-codes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment view the current recovery codes", - "operationId": "detailMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "schema": { - "$ref": "#/definitions/mfaCode" - } - }, - { - "type": "string", - "name": "mfa-validation-code", - "in": "header" - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "For a completed MFA enrollment regenerate the recovery codes", - "operationId": "createMfaRecoveryCodes", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "The recovery codes of an MFA enrollment", - "schema": { - "$ref": "#/definitions/detailMfaRecoveryCodesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/current-identity/mfa/verify": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via ` + "`" + `POST /current-identity/mfa` + "`" + `.\n", - "tags": [ - "Current Identity", - "MFA" - ], - "summary": "Complete MFA enrollment by verifying a time based one time token", - "operationId": "verifyMfa", - "parameters": [ - { - "description": "An MFA validation request", - "name": "mfaValidation", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/mfaCode" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/check-data-integrity": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Starts a data integrity scan on the datastore. Requires admin access. Only once instance may run at a time, including runs of fixDataIntegrity.", - "tags": [ - "Database" - ], - "summary": "Starts a data integrity scan on the datastore", - "operationId": "checkDataIntegrity", - "responses": { - "202": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "429": { - "description": "The resource requested is rate limited and the rate limit has been exceeded", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "causeMessage": "you have hit a rate limit in the requested operation", - "code": "RATE_LIMITED", - "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/data-integrity-results": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns any results found from in-progress integrity checks. Requires admin access.", - "tags": [ - "Database" - ], - "summary": "Returns any results found from in-progress integrity checks", - "operationId": "dataIntegrityResults", - "responses": { - "200": { - "description": "A list of data integrity issues found", - "schema": { - "$ref": "#/definitions/dataIntegrityCheckResultEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/fix-data-integrity": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Runs a data integrity scan on the datastore, attempts to fix any issues it can, and returns any found issues. Requires admin access. Only once instance may run at a time, including runs of checkDataIntegrity.", - "tags": [ - "Database" - ], - "summary": "Runs a data integrity scan on the datastore, attempts to fix any issues it can and returns any found issues", - "operationId": "fixDataIntegrity", - "responses": { - "202": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "429": { - "description": "The resource requested is rate limited and the rate limit has been exceeded", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "causeMessage": "you have hit a rate limit in the requested operation", - "code": "RATE_LIMITED", - "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/database/snapshot": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a new database snapshot. Requires admin access.", - "tags": [ - "Database" - ], - "summary": "Create a new database snapshot", - "operationId": "createDatabaseSnapshot", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "429": { - "description": "The resource requested is rate limited and the rate limit has been exceeded", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "causeMessage": "you have hit a rate limit in the requested operation", - "code": "RATE_LIMITED", - "message": "The resource is rate limited and the rate limit has been exceeded. Please try again later", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router policy resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router Policy" - ], - "summary": "List edge router policies", - "operationId": "listEdgeRouterPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create an edge router policy resource. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Create an edge router policy resource", - "operationId": "createEdgeRouterPolicy", - "parameters": [ - { - "description": "An edge router policy to create", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-router-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single edge router policy by id. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Retrieves a single edge router policy", - "operationId": "detailEdgeRouterPolicy", - "responses": { - "200": { - "description": "A single edge router policy", - "schema": { - "$ref": "#/definitions/detailEdgeRouterPolicyEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an edge router policy by id. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Update all fields on an edge router policy", - "operationId": "updateEdgeRouterPolicy", - "parameters": [ - { - "description": "An edge router policy update object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an edge router policy by id. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Delete an edge router policy", - "operationId": "deleteEdgeRouterPolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an edge router policy. Requires admin access.", - "tags": [ - "Edge Router Policy" - ], - "summary": "Update the supplied fields on an edge router policy", - "operationId": "patchEdgeRouterPolicy", - "parameters": [ - { - "description": "An edge router policy patch object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-router-policies/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge routers an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router Policy" - ], - "summary": "List edge routers a policy affects", - "operationId": "listEdgeRouterPolicyEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-router-policies/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identities an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router Policy" - ], - "summary": "List identities an edge router policy affects", - "operationId": "listEdgeRouterPolicyIdentities", - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-router-role-attributes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of role attributes in use by edge routers; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Role Attributes" - ], - "summary": "List role attributes in use by edge routers", - "operationId": "listEdgeRouterRoleAttributes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router" - ], - "summary": "List edge routers", - "operationId": "listEdgeRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a edge router resource. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Create an edge router", - "operationId": "createEdgeRouter", - "parameters": [ - { - "description": "A edge router to create", - "name": "edgeRouter", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/edge-routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single edge router by id. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Retrieves a single edge router", - "operationId": "detailEdgeRouter", - "responses": { - "200": { - "description": "A singular edge router resource", - "schema": { - "$ref": "#/definitions/detailedEdgeRouterEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an edge router by id. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Update all fields on an edge router", - "operationId": "updateEdgeRouter", - "parameters": [ - { - "description": "An edge router update object", - "name": "edgeRouter", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an edge router by id. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Delete an edge router", - "operationId": "deleteEdgeRouter", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an edge router. Requires admin access.", - "tags": [ - "Edge Router" - ], - "summary": "Update the supplied fields on an edge router", - "operationId": "patchEdgeRouter", - "parameters": [ - { - "description": "An edge router patch object", - "name": "edgeRouter", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/edgeRouterPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router policies that apply to the specified edge router.", - "tags": [ - "Edge Router" - ], - "summary": "List the edge router policies that affect an edge router", - "operationId": "listEdgeRouterEdgeRouterPolicies", - "responses": { - "200": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router" - ], - "summary": "List associated identities", - "operationId": "listEdgeRouterIdentities", - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/re-enroll": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Removes current certificate based authentication mechanisms and reverts the edge router into a state where enrollment must be performed.\nThe router retains all other properties and associations. If the router is currently connected, it will be disconnected and any\nattemps to reconnect will fail until the enrollment process is completed with the newly generated JWT.\n\nIf the edge router has an existing outstanding enrollment JWT it will be replaced. The previous JWT will no longer be usable to\ncomplete the enrollment process.\n", - "tags": [ - "Edge Router" - ], - "summary": "Re-enroll an edge router", - "operationId": "reEnrollEdgeRouter", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/service-edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policies policies that apply to the specified edge router.", - "tags": [ - "Edge Router" - ], - "summary": "List the service policies that affect an edge router", - "operationId": "listEdgeRouterServiceEdgeRouterPolicies", - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/edge-routers/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Edge Router" - ], - "summary": "List associated services", - "operationId": "listEdgeRouterServices", - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/enrollments": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Enrollment" - ], - "summary": "List outstanding enrollments", - "operationId": "listEnrollments", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of enrollments", - "schema": { - "$ref": "#/definitions/listEnrollmentsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates a new OTT, OTTCA, or UPDB enrollment for a specific identity. If an enrollment of the same type is already outstanding the request will fail with a 409 conflict. If desired, an existing enrollment can be refreshed by ` + "`" + `enrollments/:id/refresh` + "`" + ` or deleted.", - "tags": [ - "Enrollment" - ], - "summary": "Create an outstanding enrollment for an identity", - "operationId": "createEnrollment", - "parameters": [ - { - "description": "An enrollment to create", - "name": "enrollment", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/enrollmentCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The request could not be completed due to a conflict of configuration or state", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - } - } - } - } - }, - "/enrollments/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single outstanding enrollment by id. Requires admin access.", - "tags": [ - "Enrollment" - ], - "summary": "Retrieves an outstanding enrollment", - "operationId": "detailEnrollment", - "responses": { - "200": { - "description": "A singular enrollment resource", - "schema": { - "$ref": "#/definitions/detailEnrollmentEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an outstanding enrollment by id. Requires admin access.", - "tags": [ - "Enrollment" - ], - "summary": "Delete an outstanding enrollment", - "operationId": "deleteEnrollment", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/enrollments/{id}/refresh": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "For expired or unexpired enrollments, reset the expiration window. A new JWT will be generated and must be used for the enrollment.", - "tags": [ - "Enrollment" - ], - "summary": "Refreshes an enrollment record's expiration window", - "operationId": "refreshEnrollment", - "parameters": [ - { - "description": "An enrollment refresh request", - "name": "refresh", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/enrollmentRefresh" - } - } - ], - "responses": { - "200": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/external-jwt-signers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of external JWT signers for authentication", - "tags": [ - "External JWT Signer" - ], - "summary": "List External JWT Signers", - "operationId": "listExternalJwtSigners", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of External JWT Signers", - "schema": { - "$ref": "#/definitions/listExternalJwtSignersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates an External JWT Signer. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Creates an External JWT Signer", - "operationId": "createExternalJwtSigner", - "parameters": [ - { - "description": "An External JWT Signer to create", - "name": "externalJwtSigner", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/externalJwtSignerCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/external-jwt-signers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single External JWT Signer by id. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Retrieves a single External JWT Signer", - "operationId": "detailExternalJwtSigner", - "responses": { - "200": { - "description": "A singular External JWT Signer resource", - "schema": { - "$ref": "#/definitions/detailExternalJwtSignerEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an External JWT Signer by id. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Update all fields on an External JWT Signer", - "operationId": "updateExternalJwtSigner", - "parameters": [ - { - "description": "An External JWT Signer update object", - "name": "externalJwtSigner", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/externalJwtSignerUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an External JWT Signer by id. Requires admin access.\n", - "tags": [ - "External JWT Signer" - ], - "summary": "Delete an External JWT Signer", - "operationId": "deleteExternalJwtSigner", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on an External JWT Signer by id. Requires admin access.", - "tags": [ - "External JWT Signer" - ], - "summary": "Update the supplied fields on an External JWT Signer", - "operationId": "patchExternalJwtSigner", - "parameters": [ - { - "description": "An External JWT Signer patch object", - "name": "externalJwtSigner", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/externalJwtSignerPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List identities", - "operationId": "listIdentities", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create an identity resource. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Create an identity resource", - "operationId": "createIdentity", - "parameters": [ - { - "description": "An identity to create", - "name": "identity", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/identities/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Retrieves a single identity", - "operationId": "detailIdentity", - "responses": { - "200": { - "description": "A single identity", - "schema": { - "$ref": "#/definitions/detailIdentityEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on an identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Update all fields on an identity", - "operationId": "updateIdentity", - "parameters": [ - { - "description": "An identity update object", - "name": "identity", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete an identity by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Delete an identity", - "operationId": "deleteIdentity", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on an identity. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Update the supplied fields on an identity", - "operationId": "patchIdentity", - "parameters": [ - { - "description": "An identity patch object", - "name": "identity", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/identityPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/authenticators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of authenticators associated to the identity specified\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve the current authenticators of a specific identity", - "operationId": "getIdentityAuthenticators", - "responses": { - "200": { - "description": "A list of authenticators", - "schema": { - "$ref": "#/definitions/listAuthenticatorsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/disable": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin disable an identity for a set amount of time or indefinitely.\n", - "tags": [ - "Identity" - ], - "summary": "Set an identity as disabled", - "operationId": "disableIdentity", - "parameters": [ - { - "description": "Disable parameters", - "name": "disable", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/disableParams" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge router policies that apply to the specified identity.", - "tags": [ - "Identity" - ], - "summary": "List the edge router policies that affect an identity", - "operationId": "listIdentitysEdgeRouterPolicies", - "responses": { - "200": { - "description": "A list of edge router policies", - "schema": { - "$ref": "#/definitions/listEdgeRouterPoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge-routers that the given identity may use to access services. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List accessible edge-routers", - "operationId": "listIdentityEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/enable": { - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin to remove disabled statuses from an identity.\n", - "tags": [ - "Identity" - ], - "summary": "Clears all disabled state from an identity", - "operationId": "enableIdentity", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/enrollments": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of enrollments associated to the identity specified\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve the current enrollments of a specific identity", - "operationId": "getIdentityEnrollments", - "responses": { - "200": { - "description": "A list of enrollments", - "schema": { - "$ref": "#/definitions/listEnrollmentsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/failed-service-requests": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a list of service session requests that failed due to posture checks. The entries will contain\nevery policy that was verified against and every failed check in each policy. Each check will include\nthe historical posture data and posture check configuration.\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve a list of the most recent service failure requests due to posture checks", - "operationId": "getIdentityFailedServiceRequests", - "responses": { - "200": { - "description": "Returns a list of service request failures", - "schema": { - "$ref": "#/definitions/failedServiceRequestEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/mfa": { - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin to remove MFA enrollment from a specific identity. Requires admin.\n", - "tags": [ - "Identity", - "MFA" - ], - "summary": "Remove MFA from an identitity", - "operationId": "removeIdentityMfa", - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/policy-advice/{serviceId}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Analyzes policies to see if the given identity should be able to dial or bind the given service. |\nWill check services policies to see if the identity can access the service. Will check edge router policies |\nto check if the identity and service have access to common edge routers so that a connnection can be made. |\nWill also check if at least one edge router is on-line. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "Analyze policies relating the given identity and service", - "operationId": "getIdentityPolicyAdvice", - "responses": { - "200": { - "description": "Returns the document that represents the policy advice", - "schema": { - "$ref": "#/definitions/getIdentityPolicyAdviceEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "The id of a service", - "name": "serviceId", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/posture-data": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Returns a nested map data represeting the posture data of the identity.\nThis data should be considered volatile.\n", - "tags": [ - "Identity" - ], - "summary": "Retrieve the curent posture data for a specific identity.", - "operationId": "getIdentityPostureData", - "responses": { - "200": { - "description": "Returns the document that represents posture data", - "schema": { - "$ref": "#/definitions/postureDataEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/service-configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service configs associated to a specific identity", - "tags": [ - "Identity" - ], - "summary": "List the service configs associated a specific identity", - "operationId": "listIdentitysServiceConfigs", - "responses": { - "200": { - "description": "A list of service configs", - "schema": { - "$ref": "#/definitions/listServiceConfigsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Associate service configs to a specific identity", - "tags": [ - "Identity" - ], - "summary": "Associate service configs for a specific identity", - "operationId": "associateIdentitysServiceConfigs", - "parameters": [ - { - "description": "A service config patch object", - "name": "serviceConfigs", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceConfigsAssignList" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Remove service configs from a specific identity", - "tags": [ - "Identity" - ], - "summary": "Remove associated service configs from a specific identity", - "operationId": "disassociateIdentitysServiceConfigs", - "parameters": [ - { - "description": "An array of service and config id pairs to remove", - "name": "serviceConfigIdPairs", - "in": "body", - "schema": { - "$ref": "#/definitions/serviceConfigsAssignList" - } - } - ], - "responses": { - "200": { - "description": "Base empty response", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/service-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policies that apply to the specified identity.", - "tags": [ - "Identity" - ], - "summary": "List the service policies that affect an identity", - "operationId": "listIdentityServicePolicies", - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of services that the given identity has access to. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List accessible services", - "operationId": "listIdentityServices", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identities/{id}/trace": { - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Allows an admin to enable/disable data flow tracing for an identity\n", - "tags": [ - "Identity", - "Tracing" - ], - "summary": "Enable/disable data flow tracing for an identity", - "operationId": "updateIdentityTracing", - "parameters": [ - { - "description": "A traceSpec object", - "name": "traceSpec", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/traceSpec" - } - } - ], - "responses": { - "200": { - "description": "Returns the document that represents the trace state", - "schema": { - "$ref": "#/definitions/traceDetailEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/identity-role-attributes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of role attributes in use by identities; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Role Attributes" - ], - "summary": "List role attributes in use by identities", - "operationId": "listIdentityRoleAttributes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/identity-types": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Identity" - ], - "summary": "List available identity types", - "operationId": "listIdentityTypes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identity types", - "schema": { - "$ref": "#/definitions/listIdentityTypesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/identity-types/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single identity type by id. Requires admin access.", - "tags": [ - "Identity" - ], - "summary": "Retrieves a identity type", - "operationId": "detailIdentityType", - "responses": { - "200": { - "description": "A single identity type", - "schema": { - "$ref": "#/definitions/detailIdentityTypeEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/posture-check-types": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of posture check types\n", - "produces": [ - "application/json; charset=utf-8" - ], - "tags": [ - "Posture Checks" - ], - "summary": "List a subset of posture check types", - "operationId": "listPostureCheckTypes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of posture check types", - "schema": { - "$ref": "#/definitions/listPostureCheckTypesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-check-types/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single posture check type by id", - "tags": [ - "Posture Checks" - ], - "summary": "Retrieves a single posture check type", - "operationId": "detailPostureCheckType", - "responses": { - "200": { - "description": "Retrieves a singular posture check type by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckTypeEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/posture-checks": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of posture checks\n", - "produces": [ - "application/json; charset=utf-8" - ], - "tags": [ - "Posture Checks" - ], - "summary": "List a subset of posture checks", - "operationId": "listPostureChecks", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of posture checks", - "schema": { - "$ref": "#/definitions/listPostureCheckEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Creates a Posture Checks", - "tags": [ - "Posture Checks" - ], - "summary": "Creates a Posture Checks", - "operationId": "createPostureCheck", - "parameters": [ - { - "description": "A Posture Check to create", - "name": "postureCheck", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureCheckCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/posture-checks/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Retrieves a single Posture Checks", - "operationId": "detailPostureCheck", - "responses": { - "200": { - "description": "Retrieves a singular posture check by id", - "schema": { - "$ref": "#/definitions/detailPostureCheckEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Update all fields on a Posture Checks", - "operationId": "updatePostureCheck", - "parameters": [ - { - "description": "A Posture Check update object", - "name": "postureCheck", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureCheckUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Deletes and Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Deletes an Posture Checks", - "operationId": "deletePostureCheck", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "403": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update only the supplied fields on a Posture Checks by id", - "tags": [ - "Posture Checks" - ], - "summary": "Update the supplied fields on a Posture Checks", - "operationId": "patchPostureCheck", - "parameters": [ - { - "description": "A Posture Check patch object", - "name": "postureCheck", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/postureCheckPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Router" - ], - "summary": "List routers", - "operationId": "listRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a router resource. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Create a router resource", - "operationId": "createRouter", - "parameters": [ - { - "description": "A router to create", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Retrieves a single router", - "operationId": "detailRouter", - "responses": { - "200": { - "description": "A single router", - "schema": { - "$ref": "#/definitions/detailRouterEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update all fields on a router", - "operationId": "updateRouter", - "parameters": [ - { - "description": "A router update object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Delete a router", - "operationId": "deleteRouter", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a router. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update the supplied fields on a router", - "operationId": "patchRouter", - "parameters": [ - { - "description": "A router patch object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service edge router policy resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "List service edge router policies", - "operationId": "listServiceEdgeRouterPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service edge router policies", - "schema": { - "$ref": "#/definitions/listServiceEdgeRouterPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a service edge router policy resource. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Create a service edge router policy resource", - "operationId": "createServiceEdgeRouterPolicy", - "parameters": [ - { - "description": "A service edge router policy to create", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceEdgeRouterPolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/service-edge-router-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service edge policy by id. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Retrieves a single service edge policy", - "operationId": "detailServiceEdgeRouterPolicy", - "responses": { - "200": { - "description": "A single service edge router policy", - "schema": { - "$ref": "#/definitions/detailServiceEdgePolicyEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service edge policy by id. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Update all fields on a service edge policy", - "operationId": "updateServiceEdgeRouterPolicy", - "parameters": [ - { - "description": "A service edge router policy update object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceEdgeRouterPolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service edge policy by id. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Delete a service edge policy", - "operationId": "deleteServiceEdgeRouterPolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service edge policy. Requires admin access.", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "Update the supplied fields on a service edge policy", - "operationId": "patchServiceEdgeRouterPolicy", - "parameters": [ - { - "description": "A service edge router policy patch object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceEdgeRouterPolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-edge-router-policies/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "List the edge routers that a service edge router policy applies to", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "List the edge routers that a service edge router policy applies to", - "operationId": "listServiceEdgeRouterPolicyEdgeRouters", - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-edge-router-policies/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "List the services that a service edge router policy applies to", - "tags": [ - "Service Edge Router Policy" - ], - "summary": "List the services that a service edge router policy applies to", - "operationId": "listServiceEdgeRouterPolicyServices", - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List service policies", - "operationId": "listServicePolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a service policy resource. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Create a service policy resource", - "operationId": "createServicePolicy", - "parameters": [ - { - "description": "A service policy to create", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePolicyCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/service-policies/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service policy by id. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Retrieves a single service policy", - "operationId": "detailServicePolicy", - "responses": { - "200": { - "description": "A single service policy", - "schema": { - "$ref": "#/definitions/detailServicePolicyEnvelop" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service policy by id. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Update all fields on a service policy", - "operationId": "updateServicePolicy", - "parameters": [ - { - "description": "A service policy update object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePolicyUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service policy by id. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Delete a service policy", - "operationId": "deleteServicePolicy", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service policy. Requires admin access.", - "tags": [ - "Service Policy" - ], - "summary": "Update the supplied fields on a service policy", - "operationId": "patchServicePolicy", - "parameters": [ - { - "description": "A service policy patch object", - "name": "policy", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePolicyPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identity resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List identities a service policy affects", - "operationId": "listServicePolicyIdentities", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "400": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies/{id}/posture-checks": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of posture check resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List posture check a service policy includes", - "operationId": "listServicePolicyPostureChecks", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of posture checks", - "schema": { - "$ref": "#/definitions/listPostureCheckEnvelope" - } - }, - "400": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-policies/{id}/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service Policy" - ], - "summary": "List services a service policy affects", - "operationId": "listServicePolicyServices", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "400": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/service-role-attributes": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of role attributes in use by services; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Role Attributes" - ], - "summary": "List role attributes in use by services", - "operationId": "listServiceRoleAttributes", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of role attributes", - "schema": { - "$ref": "#/definitions/listRoleAttributesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/services": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List services", - "operationId": "listServices", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "roleFilter", - "in": "query" - }, - { - "type": "string", - "name": "roleSemantic", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of services", - "schema": { - "$ref": "#/definitions/listServicesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a services resource. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Create a services resource", - "operationId": "createService", - "parameters": [ - { - "description": "A service to create", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/services/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Retrieves a single service", - "operationId": "detailService", - "responses": { - "200": { - "description": "A single service", - "schema": { - "$ref": "#/definitions/detailServiceEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update all fields on a service", - "operationId": "updateService", - "parameters": [ - { - "description": "A service update object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/serviceUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a service by id. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Delete a service", - "operationId": "deleteService", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a service. Requires admin access.", - "tags": [ - "Service" - ], - "summary": "Update the supplied fields on a service", - "operationId": "patchService", - "parameters": [ - { - "description": "A service patch object", - "name": "service", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/servicePatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/configs": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of config resources associated to a specific service; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List configs associated to a specific service", - "operationId": "listServiceConfig", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of configs", - "schema": { - "$ref": "#/definitions/listConfigsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/edge-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of edge-routers that may be used to access the given service. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List accessible edge-routers", - "operationId": "listServiceEdgeRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of edge routers", - "schema": { - "$ref": "#/definitions/listEdgeRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/identities": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of identities that have access to this service. Supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List identities with access", - "operationId": "listServiceIdentities", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of identities", - "schema": { - "$ref": "#/definitions/listIdentitiesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/service-edge-router-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service edge router policy resources that affect a specific service; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List service edge router policies that affect a specific service", - "operationId": "listServiceServiceEdgeRouterPolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service edge router policies", - "schema": { - "$ref": "#/definitions/listServiceEdgeRouterPoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/service-policies": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of service policy resources that affect specific service; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Service" - ], - "summary": "List service policies that affect a specific service", - "operationId": "listServiceServicePolicies", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of service policies", - "schema": { - "$ref": "#/definitions/listServicePoliciesEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/services/{id}/terminators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination.\n", - "tags": [ - "Service" - ], - "summary": "List of terminators assigned to a service", - "operationId": "listServiceTerminators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listTerminatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/sessions": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of active sessions resources; supports filtering, sorting, and pagination. Requires admin access.\n\nSessions are tied to an API session and are moved when an API session times out or logs out. Active sessions\n(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active.\n", - "tags": [ - "Session" - ], - "summary": "List sessions", - "operationId": "listSessions", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of sessions", - "schema": { - "$ref": "#/definitions/listSessionsManagementEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/sessions/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single session by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Retrieves a single session", - "operationId": "detailSession", - "responses": { - "200": { - "description": "A single session", - "schema": { - "$ref": "#/definitions/detailSessionManagementEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a session by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Delete a session", - "operationId": "deleteSession", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/sessions/{id}/route-path": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single session's route path by id. Requires admin access.", - "tags": [ - "Session" - ], - "summary": "Retrieves a single session's router path", - "operationId": "detailSessionRoutePath", - "responses": { - "200": { - "description": "A single session's route path", - "schema": { - "$ref": "#/definitions/detailSessionRoutePathEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs": { - "get": { - "security": [], - "description": "Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Returns a list of API specs", - "operationId": "listSpecs", - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listSpecsEnvelope" - } - } - } - } - }, - "/specs/{id}": { - "get": { - "security": [], - "description": "Returns single spec resource embedded within the controller for consumption/documentation/code geneartion", - "tags": [ - "Informational" - ], - "summary": "Return a single spec resource", - "operationId": "detailSpec", - "responses": { - "200": { - "description": "A single specification", - "schema": { - "$ref": "#/definitions/detailSpecEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/specs/{id}/spec": { - "get": { - "security": [], - "description": "Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc).", - "produces": [ - "application/json", - "text/yaml" - ], - "tags": [ - "Informational" - ], - "summary": "Returns the spec's file", - "operationId": "detailSpecBody", - "responses": { - "200": { - "description": "Returns the document that represents the specification", - "schema": { - "$ref": "#/definitions/detailSpecBodyEnvelope" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/summary": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "This endpoint is usefull for UIs that wish to display UI elements with counts.", - "tags": [ - "Informational" - ], - "summary": "Returns a list of accessible resource counts", - "operationId": "listSummary", - "responses": { - "200": { - "description": "Entity counts scopped to the current identitie's access", - "schema": { - "$ref": "#/definitions/listSummaryCountsEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/terminators": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Terminator" - ], - "summary": "List terminators", - "operationId": "listTerminators", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of terminators", - "schema": { - "$ref": "#/definitions/listTerminatorsEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a terminator resource. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Create a terminator resource", - "operationId": "createTerminator", - "parameters": [ - { - "description": "A terminator to create", - "name": "terminator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/terminatorCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/terminators/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Retrieves a single terminator", - "operationId": "detailTerminator", - "responses": { - "200": { - "description": "A single terminator", - "schema": { - "$ref": "#/definitions/detailTerminatorEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Update all fields on a terminator", - "operationId": "updateTerminator", - "parameters": [ - { - "description": "A terminator update object", - "name": "terminator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/terminatorUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a terminator by id. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Delete a terminator", - "operationId": "deleteTerminator", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a terminator. Requires admin access.", - "tags": [ - "Terminator" - ], - "summary": "Update the supplied fields on a terminator", - "operationId": "patchTerminator", - "parameters": [ - { - "description": "A terminator patch object", - "name": "terminator", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/terminatorPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/transit-routers": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access.\n", - "tags": [ - "Router" - ], - "summary": "List routers", - "operationId": "listTransitRouters", - "parameters": [ - { - "type": "integer", - "name": "limit", - "in": "query" - }, - { - "type": "integer", - "name": "offset", - "in": "query" - }, - { - "type": "string", - "name": "filter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "A list of specifications", - "schema": { - "$ref": "#/definitions/listRoutersEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "post": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Create a router resource. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Create a router resource", - "operationId": "createTransitRouter", - "parameters": [ - { - "description": "A router to create", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerCreate" - } - } - ], - "responses": { - "201": { - "description": "The create request was successful and the resource has been added at the following location", - "schema": { - "$ref": "#/definitions/createEnvelope" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - } - }, - "/transit-routers/{id}": { - "get": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Retrieves a single router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Retrieves a single router", - "operationId": "detailTransitRouter", - "responses": { - "200": { - "description": "A single router", - "schema": { - "$ref": "#/definitions/detailRouterEnvelope" - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "put": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update all fields on a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update all fields on a router", - "operationId": "updateTransitRouter", - "parameters": [ - { - "description": "A router update object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerUpdate" - } - } - ], - "responses": { - "200": { - "description": "The update request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "delete": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Delete a router by id. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Delete a router", - "operationId": "deleteTransitRouter", - "responses": { - "200": { - "description": "The delete request was successful and the resource has been removed", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "409": { - "description": "The resource requested to be removed/altered cannot be as it is referenced by another object.", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "causeMessage": "referenced by /some-resource/05f4f710-c155-4a74-86d5-77558eb9cb42", - "code": "CONFLICT_CANNOT_MODIFY_REFERENCED", - "message": "The resource cannot be deleted/modified. Remove all referencing resources first.", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "patch": { - "security": [ - { - "ztSession": [] - } - ], - "description": "Update the supplied fields on a router. Requires admin access.", - "tags": [ - "Router" - ], - "summary": "Update the supplied fields on a router", - "operationId": "patchTransitRouter", - "parameters": [ - { - "description": "A router patch object", - "name": "router", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/routerPatch" - } - } - ], - "responses": { - "200": { - "description": "The patch request was successful and the resource has been altered", - "schema": { - "$ref": "#/definitions/empty" - } - }, - "400": { - "description": "The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": { - "details": { - "context": "(root)", - "field": "(root)", - "property": "fooField3" - }, - "field": "(root)", - "message": "(root): fooField3 is required", - "type": "required", - "value": { - "fooField": "abc", - "fooField2": "def" - } - }, - "causeMessage": "schema validation failed", - "code": "COULD_NOT_VALIDATE", - "message": "The supplied request contains an invalid document", - "requestId": "ac6766d6-3a09-44b3-8d8a-1b541d97fdd9" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "401": { - "description": "The currently supplied session does not have the correct access rights to request this resource", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": {} - }, - "cause": "", - "causeMessage": "", - "code": "UNAUTHORIZED", - "message": "The request could not be completed. The session is not authorized or the credentials are invalid", - "requestId": "0bfe7a04-9229-4b7a-812c-9eb3cc0eac0f" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - }, - "404": { - "description": "The requested resource does not exist", - "schema": { - "$ref": "#/definitions/apiErrorEnvelope" - }, - "examples": { - "application/json": { - "error": { - "args": { - "urlVars": { - "id": "71a3000f-7dda-491a-9b90-a19f4ee6c406" - } - }, - "cause": null, - "causeMessage": "", - "code": "NOT_FOUND", - "message": "The resource requested was not found or is no longer available", - "requestId": "270908d6-f2ef-4577-b973-67bec18ae376" - }, - "meta": { - "apiEnrollmentVersion": "0.0.1", - "apiVersion": "0.0.1" - } - } - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "The id of the requested resource", - "name": "id", - "in": "path", - "required": true - } - ] - }, - "/version": { - "get": { - "security": [], - "tags": [ - "Informational" - ], - "summary": "Returns version information", - "operationId": "listVersion", - "responses": { - "200": { - "description": "Version information for the controller", - "schema": { - "$ref": "#/definitions/listVersionEnvelope" - } - } - } - } - } - }, - "definitions": { - "IdentityAuthenticatorsCert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "IdentityAuthenticatorsUpdb": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "IdentityCreateEnrollment": { - "type": "object", - "properties": { - "ott": { - "type": "boolean" - }, - "ottca": { - "type": "string" - }, - "updb": { - "type": "string" - } - } - }, - "IdentityEnrollmentsOtt": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "IdentityEnrollmentsOttca": { - "type": "object", - "properties": { - "ca": { - "$ref": "#/definitions/entityRef" - }, - "caId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "IdentityEnrollmentsUpdb": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "apiError": { - "type": "object", - "properties": { - "args": { - "$ref": "#/definitions/apiErrorArgs" - }, - "cause": { - "$ref": "#/definitions/apiErrorCause" - }, - "causeMessage": { - "type": "string" - }, - "code": { - "type": "string" - }, - "data": { - "type": "object", - "additionalProperties": true - }, - "message": { - "type": "string" - }, - "requestId": { - "type": "string" - } - } - }, - "apiErrorArgs": { - "type": "object", - "properties": { - "urlVars": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "apiErrorCause": { - "allOf": [ - { - "$ref": "#/definitions/apiFieldError" - }, - { - "$ref": "#/definitions/apiError" - } - ] - }, - "apiErrorEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/apiError" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "apiFieldError": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "reason": { - "type": "string" - }, - "value": { - "description": "can be any value - string, number, boolean, array or object" - } - } - }, - "apiSessionDetail": { - "description": "An API Session object", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "identity", - "identityId", - "configTypes", - "ipAddress", - "authQueries", - "cachedUpdatedAt", - "isMfaRequired", - "isMfaComplete", - "authenticatorId" - ], - "properties": { - "authQueries": { - "$ref": "#/definitions/authQueryList" - }, - "authenticatorId": { - "type": "string" - }, - "cachedLastActivityAt": { - "type": "string", - "format": "date-time" - }, - "configTypes": { - "type": "array", - "items": { - "type": "string" - } - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "ipAddress": { - "type": "string" - }, - "isMfaComplete": { - "type": "boolean" - }, - "isMfaRequired": { - "type": "boolean" - }, - "lastActivityAt": { - "type": "string", - "format": "date-time" - }, - "token": { - "type": "string" - } - } - } - ] - }, - "apiSessionList": { - "type": "array", - "items": { - "$ref": "#/definitions/apiSessionDetail" - } - }, - "apiSessionPostureData": { - "type": "object", - "required": [ - "mfa" - ], - "properties": { - "endpointState": { - "$ref": "#/definitions/postureDataEndpointState" - }, - "mfa": { - "$ref": "#/definitions/postureDataMfa" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - } - } - }, - "apiVersion": { - "type": "object", - "required": [ - "path" - ], - "properties": { - "apiBaseUrls": { - "type": "array", - "items": { - "type": "string" - } - }, - "path": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "attributes": { - "description": "A set of strings used to loosly couple this resource to policies", - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true, - "x-omitempty": true - }, - "authPolicyCreate": { - "description": "A Auth Policy resource", - "type": "object", - "required": [ - "name", - "primary", - "secondary" - ], - "properties": { - "name": { - "type": "string" - }, - "primary": { - "$ref": "#/definitions/authPolicyPrimary" - }, - "secondary": { - "$ref": "#/definitions/authPolicySecondary" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "authPolicyDetail": { - "description": "A Auth Policy resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "primary", - "secondary" - ], - "properties": { - "name": { - "type": "string" - }, - "primary": { - "$ref": "#/definitions/authPolicyPrimary" - }, - "secondary": { - "$ref": "#/definitions/authPolicySecondary" - } - } - } - ] - }, - "authPolicyList": { - "description": "An array of Auth Policies resources", - "type": "array", - "items": { - "$ref": "#/definitions/authPolicyDetail" - } - }, - "authPolicyPatch": { - "description": "A Auth Policy resource", - "type": "object", - "properties": { - "name": { - "type": "string", - "x-nullable": true - }, - "primary": { - "$ref": "#/definitions/authPolicyPrimaryPatch" - }, - "secondary": { - "$ref": "#/definitions/authPolicySecondaryPatch" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "authPolicyPrimary": { - "type": "object", - "required": [ - "updb", - "cert", - "extJwt" - ], - "properties": { - "cert": { - "$ref": "#/definitions/authPolicyPrimaryCert" - }, - "extJwt": { - "$ref": "#/definitions/authPolicyPrimaryExtJwt" - }, - "updb": { - "$ref": "#/definitions/authPolicyPrimaryUpdb" - } - } - }, - "authPolicyPrimaryCert": { - "type": "object", - "required": [ - "allowed", - "allowExpiredCerts" - ], - "properties": { - "allowExpiredCerts": { - "type": "boolean" - }, - "allowed": { - "type": "boolean" - } - } - }, - "authPolicyPrimaryCertPatch": { - "type": "object", - "properties": { - "allowExpiredCerts": { - "type": "boolean", - "x-nullable": true - }, - "allowed": { - "type": "boolean", - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicyPrimaryExtJwt": { - "type": "object", - "required": [ - "allowed", - "allowedSigners" - ], - "properties": { - "allowed": { - "type": "boolean" - }, - "allowedSigners": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "authPolicyPrimaryExtJwtPatch": { - "type": "object", - "properties": { - "allowed": { - "type": "boolean", - "x-nullable": true - }, - "allowedSigners": { - "type": "array", - "items": { - "type": "string" - }, - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicyPrimaryPatch": { - "type": "object", - "properties": { - "cert": { - "$ref": "#/definitions/authPolicyPrimaryCertPatch" - }, - "extJwt": { - "$ref": "#/definitions/authPolicyPrimaryExtJwtPatch" - }, - "updb": { - "$ref": "#/definitions/authPolicyPrimaryUpdbPatch" - } - } - }, - "authPolicyPrimaryUpdb": { - "type": "object", - "required": [ - "allowed", - "minPasswordLength", - "requireSpecialChar", - "requireNumberChar", - "requireMixedCase", - "maxAttempts", - "lockoutDurationMinutes" - ], - "properties": { - "allowed": { - "type": "boolean" - }, - "lockoutDurationMinutes": { - "type": "integer" - }, - "maxAttempts": { - "type": "integer" - }, - "minPasswordLength": { - "type": "integer" - }, - "requireMixedCase": { - "type": "boolean" - }, - "requireNumberChar": { - "type": "boolean" - }, - "requireSpecialChar": { - "type": "boolean" - } - } - }, - "authPolicyPrimaryUpdbPatch": { - "type": "object", - "properties": { - "allowed": { - "type": "boolean", - "x-nullable": true - }, - "lockoutDurationMinutes": { - "type": "integer", - "x-nullable": true - }, - "maxAttempts": { - "type": "integer", - "x-nullable": true - }, - "minPasswordLength": { - "type": "integer", - "x-nullable": true - }, - "requireMixedCase": { - "type": "boolean", - "x-nullable": true - }, - "requireNumberChar": { - "type": "boolean", - "x-nullable": true - }, - "requireSpecialChar": { - "type": "boolean", - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicySecondary": { - "type": "object", - "required": [ - "requireTotp" - ], - "properties": { - "requireExtJwtSigner": { - "type": "string", - "x-nullable": true, - "x-omit-empty": false - }, - "requireTotp": { - "type": "boolean" - } - } - }, - "authPolicySecondaryPatch": { - "type": "object", - "properties": { - "requireExtJwtSigner": { - "type": "string", - "x-nullable": true - }, - "requireTotp": { - "type": "boolean", - "x-nullable": true - } - }, - "x-nullable": true - }, - "authPolicyUpdate": { - "$ref": "#/definitions/authPolicyCreate" - }, - "authQueryDetail": { - "type": "object", - "required": [ - "provider" - ], - "properties": { - "format": { - "$ref": "#/definitions/mfaFormats" - }, - "httpMethod": { - "type": "string" - }, - "httpUrl": { - "type": "string" - }, - "maxLength": { - "type": "integer" - }, - "minLength": { - "type": "integer" - }, - "provider": { - "$ref": "#/definitions/mfaProviders" - }, - "typeId": { - "type": "string" - } - } - }, - "authQueryList": { - "type": "array", - "items": { - "$ref": "#/definitions/authQueryDetail" - } - }, - "authenticate": { - "description": "A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method.", - "type": "object", - "properties": { - "configTypes": { - "$ref": "#/definitions/configTypes" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "password": { - "$ref": "#/definitions/password" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorCreate": { - "description": "Creates an authenticator for a specific identity which can be used for API authentication", - "type": "object", - "required": [ - "method", - "identityId" - ], - "properties": { - "certPem": { - "description": "The client certificate the identity will login with. Used only for method='cert'", - "type": "string" - }, - "identityId": { - "description": "The id of an existing identity that will be assigned this authenticator", - "type": "string" - }, - "method": { - "description": "The type of authenticator to create; which will dictate which properties on this object are required.", - "type": "string" - }, - "password": { - "description": "The password the identity will login with. Used only for method='updb'", - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "description": "The username that the identity will login with. Used only for method='updb'", - "type": "string" - } - } - }, - "authenticatorDetail": { - "description": "A singular authenticator resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "method", - "identityId", - "identity" - ], - "properties": { - "certPem": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "method": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - ] - }, - "authenticatorList": { - "description": "An array of authenticator resources", - "type": "array", - "items": { - "$ref": "#/definitions/authenticatorDetail" - } - }, - "authenticatorPatch": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "properties": { - "password": { - "$ref": "#/definitions/passwordNullable" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/usernameNullable" - } - } - }, - "authenticatorPatchWithCurrent": { - "description": "All of the fields on an authenticator that may be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorPatch" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "authenticatorUpdate": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "required": [ - "username", - "password" - ], - "properties": { - "password": { - "$ref": "#/definitions/password" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "username": { - "$ref": "#/definitions/username" - } - } - }, - "authenticatorUpdateWithCurrent": { - "description": "All of the fields on an authenticator that will be updated", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/authenticatorUpdate" - }, - { - "type": "object", - "required": [ - "currentPassword" - ], - "properties": { - "currentPassword": { - "$ref": "#/definitions/password" - } - } - } - ] - }, - "baseEntity": { - "description": "Fields shared by all Edge API entities", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "_links" - ], - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "caCreate": { - "description": "A create Certificate Authority (CA) object", - "type": "object", - "required": [ - "name", - "certPem", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles" - ], - "properties": { - "certPem": { - "type": "string", - "example": "-----BEGIN CERTIFICATE-----\nMIICUjCCAdmgAwIBAgIJANooo7NB+dZZMAoGCCqGSM49BAMCMF4xCzAJBgNVBAYT\nAlVTMQswCQYDVQQIDAJOQzETMBEGA1UECgwKTmV0Rm91bmRyeTEtMCsGA1UEAwwk\nTmV0Rm91bmRyeSBaaXRpIEV4dGVybmFsIEFQSSBSb290IENBMB4XDTE4MTExNTEy\nNTcwOVoXDTM4MTExMDEyNTcwOVowXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5D\nMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0wKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkg\nRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARwq61Z\nIaqbaw0PDt3frJZaHjkxfZhwYrykI1GlbRNd/jix03lVG9qvpN5Og9fQfFFcFmD/\n3vCE9S6O0npm0mADQxcBcxbMRAH5dtBuCuiJW6qAAbPgiM32vqSxBiFt0KejYzBh\nMB0GA1UdDgQWBBRx1OVGuc/jdltDc8YBtkw8Tbr4fjAfBgNVHSMEGDAWgBRx1OVG\nuc/jdltDc8YBtkw8Tbr4fjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB\nhjAKBggqhkjOPQQDAgNnADBkAjBDRxNZUaIVpkQKnAgJukl3ysd3/i7Z6hDyIEms\nkllz/+ZvmdBp9iedV5o5BvJUggACMCv+UBFlJH7pmsOCo/F45Kk178YsCC7gaMxE\n1ZG1zveyMvsYsH04C9FndE6w2MLvlA==\n-----END CERTIFICATE-----\n" - }, - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaim" - }, - "identityNameFormat": { - "type": "string" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "name": { - "type": "string", - "example": "Test 3rd Party External CA" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "caDetail": { - "description": "A Certificate Authority (CA) resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "fingerprint", - "certPem", - "isVerified", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles", - "identityNameFormat" - ], - "properties": { - "certPem": { - "type": "string" - }, - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaim" - }, - "fingerprint": { - "type": "string" - }, - "identityNameFormat": { - "type": "string" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isVerified": { - "type": "boolean", - "example": false - }, - "name": { - "type": "string" - }, - "verificationToken": { - "type": "string", - "format": "uuid" - } - } - } - ] - }, - "caList": { - "description": "An array of Certificate Authority (CA) resources", - "type": "array", - "items": { - "$ref": "#/definitions/caDetail" - } - }, - "caPatch": { - "type": "object", - "properties": { - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaimPatch" - }, - "identityNameFormat": { - "type": "string", - "x-nullable": true - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "name": { - "type": "string", - "x-nullable": true, - "example": "My CA" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "caUpdate": { - "type": "object", - "required": [ - "name", - "isAutoCaEnrollmentEnabled", - "isOttCaEnrollmentEnabled", - "isAuthEnabled", - "identityRoles", - "identityNameFormat" - ], - "properties": { - "externalIdClaim": { - "$ref": "#/definitions/externalIdClaim" - }, - "identityNameFormat": { - "type": "string" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "isAuthEnabled": { - "type": "boolean", - "example": true - }, - "isAutoCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "isOttCaEnrollmentEnabled": { - "type": "boolean", - "example": true - }, - "name": { - "type": "string", - "example": "My CA" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "commonEdgeRouterProperties": { - "type": "object", - "required": [ - "hostname", - "name", - "supportedProtocols", - "syncStatus", - "isOnline", - "cost", - "noTraversal" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "hostname": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "supportedProtocols": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "syncStatus": { - "type": "string" - } - } - }, - "configCreate": { - "description": "A config create object", - "type": "object", - "required": [ - "name", - "configTypeId", - "data" - ], - "properties": { - "configTypeId": { - "description": "The id of a config-type that the data section will match", - "type": "string" - }, - "data": { - "description": "Data payload is defined by the schema of the config-type defined in the type parameter", - "type": "object", - "additionalProperties": true, - "x-nullable": false - }, - "name": { - "type": "string", - "example": "default.ziti-tunneler-server.v1" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "example": { - "configTypeId": "cea49285-6c07-42cf-9f52-09a9b115c783", - "data": { - "hostname": "example.com", - "port": 80 - }, - "name": "test-config" - } - }, - "configDetail": { - "description": "A config resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "configTypeId", - "configType", - "data" - ], - "properties": { - "configType": { - "$ref": "#/definitions/entityRef" - }, - "configTypeId": { - "type": "string" - }, - "data": { - "description": "The data section of a config is based on the schema of its type", - "type": "object" - }, - "name": { - "type": "string" - } - } - } - ] - }, - "configList": { - "description": "An array of config resources", - "type": "array", - "items": { - "$ref": "#/definitions/configDetail" - } - }, - "configPatch": { - "description": "A config patch object", - "type": "object", - "properties": { - "data": { - "description": "Data payload is defined by the schema of the config-type defined in the type parameter", - "type": "object", - "additionalProperties": true - }, - "name": { - "type": "string", - "example": "default.ziti-tunneler-server.v1" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "example": { - "data": { - "hostname": "example.com", - "port": 80 - }, - "name": "example-config-name" - } - }, - "configTypeCreate": { - "description": "A config-type create object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "configTypeDetail": { - "description": "A config-type resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "schema" - ], - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - } - } - } - ] - }, - "configTypeList": { - "description": "An array of config-type resources", - "type": "array", - "items": { - "$ref": "#/definitions/configTypeDetail" - } - }, - "configTypePatch": { - "description": "A config-type patch object", - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "configTypeUpdate": { - "description": "A config-type update object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "example": "ziti-tunneler-server.v1" - }, - "schema": { - "description": "A JSON schema to enforce configuration against", - "type": "object", - "additionalProperties": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "configTypes": { - "description": "Specific configuration types that should be returned", - "type": "array", - "items": { - "type": "string" - } - }, - "configUpdate": { - "description": "A config update object", - "type": "object", - "required": [ - "name", - "data" - ], - "properties": { - "data": { - "description": "Data payload is defined by the schema of the config-type defined in the type parameter", - "type": "object", - "additionalProperties": true, - "x-nullable": false - }, - "name": { - "type": "string", - "example": "default.ziti-tunneler-server.v1" - }, - "tags": { - "$ref": "#/definitions/tags" - } - }, - "example": { - "data": { - "hostname": "example.com", - "port": 80 - }, - "name": "example-config-name" - } - }, - "createEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/createLocation" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "createLocation": { - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "id": { - "type": "string" - } - } - }, - "currentApiSessionDetail": { - "description": "An API Session object for the current API session", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/apiSessionDetail" - }, - { - "type": "object", - "required": [ - "expiresAt", - "expirationSeconds" - ], - "properties": { - "expirationSeconds": { - "type": "integer" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - } - ] - }, - "currentApiSessionDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/currentApiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "currentIdentityDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "dataIntegrityCheckDetail": { - "type": "object", - "required": [ - "description", - "fixed" - ], - "properties": { - "description": { - "type": "string" - }, - "fixed": { - "type": "boolean" - } - } - }, - "dataIntegrityCheckDetailList": { - "type": "array", - "items": { - "$ref": "#/definitions/dataIntegrityCheckDetail" - } - }, - "dataIntegrityCheckDetails": { - "type": "object", - "required": [ - "inProgress", - "fixingErrors", - "tooManyErrors", - "startTime", - "endTime", - "error", - "results" - ], - "properties": { - "endTime": { - "type": "string", - "format": "date-time" - }, - "error": { - "type": "string" - }, - "fixingErrors": { - "type": "boolean" - }, - "inProgress": { - "type": "boolean" - }, - "results": { - "$ref": "#/definitions/dataIntegrityCheckDetailList" - }, - "startTime": { - "type": "string", - "format": "date-time" - }, - "tooManyErrors": { - "type": "boolean" - } - } - }, - "dataIntegrityCheckResultEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/dataIntegrityCheckDetails" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailApiSessionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/apiSessionDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailAuthPolicyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authPolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailAuthenticatorEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authenticatorDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailCaEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/caDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailConfigEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailConfigTypeEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configTypeDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailEdgeRouterPolicyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterPolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailEnrollmentEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/enrollmentDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailExternalJwtSignerEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/externalJwtSignerDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailIdentityEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailIdentityTypeEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityTypeDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfa": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "isVerified" - ], - "properties": { - "isVerified": { - "type": "boolean" - }, - "provisioningUrl": { - "description": "Not provided if MFA verification has been completed", - "type": "string" - }, - "recoveryCodes": { - "description": "Not provided if MFA verification has been completed", - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/detailMfa" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailMfaRecoveryCodes": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "required": [ - "recoveryCodes" - ], - "properties": { - "recoveryCodes": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "detailMfaRecoveryCodesEnvelope": { - "type": "object", - "required": [ - "meta", - "error" - ], - "properties": { - "error": { - "$ref": "#/definitions/detailMfaRecoveryCodes" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailPostureCheckEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureCheckDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailPostureCheckTypeEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureCheckTypeDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailRouterEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/routerDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServiceEdgePolicyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceEdgeRouterPolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServiceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailServicePolicyEnvelop": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/servicePolicyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSessionManagementEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionManagementDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSessionRoutePathEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionRoutePathDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecBodyEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specBodyDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailSpecEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailTerminatorEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/terminatorDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "detailedEdgeRouterEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "dialBind": { - "type": "string", - "enum": [ - "Dial", - "Bind" - ] - }, - "dialBindArray": { - "type": "array", - "items": { - "$ref": "#/definitions/dialBind" - } - }, - "disableParams": { - "type": "object", - "required": [ - "durationMinutes" - ], - "properties": { - "durationMinutes": { - "type": "integer" - } - } - }, - "edgeRouterCreate": { - "description": "An edge router create object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterDetail": { - "description": "A detail edge router resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "$ref": "#/definitions/commonEdgeRouterProperties" - }, - { - "type": "object", - "required": [ - "isVerified", - "roleAttributes", - "os", - "version", - "arch", - "buildDate", - "revision", - "isTunnelerEnabled" - ], - "properties": { - "certPem": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "enrollmentCreatedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentJwt": { - "type": "string", - "x-nullable": true - }, - "enrollmentToken": { - "type": "string", - "x-nullable": true - }, - "fingerprint": { - "type": "string" - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "isVerified": { - "type": "boolean" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "unverifiedCertPem": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "unverifiedFingerprint": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "versionInfo": { - "$ref": "#/definitions/versionInfo" - } - } - } - ], - "example": { - "_links": { - "edge-router-policies": { - "href": "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d/edge-routers" - }, - "self": { - "href": "./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d" - } - }, - "cost": 0, - "createdAt": "2020-03-16T17:13:31.5807454Z", - "enrollmentCreatedAt": "2020-03-16T17:13:31.5777637Z", - "enrollmentExpiresAt": "2020-03-16T17:18:31.5777637Z", - "enrollmentJwt": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImVyb3R0IiwiZXhwIjoxNTg0Mzc5MTExLCJpc3MiOiJodHRwczovL 2xvY2FsaG9zdDoxMjgwIiwianRpIjoiMzBhMWYwZWEtZDM5Yi00YWFlLWI4NTItMzA0Y2YxYzMwZDFmIiwic3ViIjoiYjA3NjZiOGQtYmQxYS00ZDI 4LTg0MTUtNjM5YjI5ZDNjODNkIn0.UsyQhCPORQ5tQnYWY7S88LNvV9iFS5Hy-P4aJaClZzEICobKgnQoyQblJcdMvk3cGKwyFqAnQtt0tDZkb8tHz Vqyv6bilHcAFuMRrdwXRqdXquabSN5geu2qBUnyzL7Mf2X85if8sbMida6snB4oLZsVRF3CRn4ODBJdeiVJ_Z4rgD-zW2IwtXPApT7ALyiiw2cN4EH 8pqQ7tpZKqztE0PGEbBQFPGKUFnm7oXyvSUo17EsFJUv5gUlBzfKKGolh5io4ptp22HZrqsqSnqDSOnYEZHonr5Yljuwiktrlh-JKiK6GGns5OAJMP dO9lgM4yHSpF2ILbqhWMV93Y3zMOg", - "enrollmentToken": "30a1f0ea-d39b-4aae-b852-304cf1c30d1f", - "fingerprint": null, - "hostname": "", - "id": "b0766b8d-bd1a-4d28-8415-639b29d3c83d", - "isOnline": false, - "isTunnelerEnabled": false, - "isVerified": false, - "name": "TestRouter-e33c837f-3222-4b40-bcd6-b3458fd5156e", - "noTraversal": false, - "roleAttributes": [ - "eastCoast", - "sales", - "test" - ], - "supportedProtocols": {}, - "tags": {}, - "updatedAt": "2020-03-16T17:13:31.5807454Z" - } - }, - "edgeRouterList": { - "description": "A list of edge router resources", - "type": "array", - "items": { - "$ref": "#/definitions/edgeRouterDetail" - } - }, - "edgeRouterPatch": { - "description": "An edge router patch object", - "type": "object", - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string", - "x-nullable": true - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyCreate": { - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "semantic", - "edgeRouterRoles", - "edgeRouterRolesDisplay", - "identityRoles", - "identityRolesDisplay", - "isSystem" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "edgeRouterRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "identityRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "isSystem": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ] - }, - "edgeRouterPolicyList": { - "type": "array", - "items": { - "$ref": "#/definitions/edgeRouterPolicyDetail" - } - }, - "edgeRouterPolicyPatch": { - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterPolicyUpdate": { - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "edgeRouterUpdate": { - "description": "An edge router update object", - "type": "object", - "required": [ - "name" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "isTunnelerEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "empty": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "type": "object", - "example": {} - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "enrollmentCreate": { - "type": "object", - "required": [ - "method", - "expiresAt", - "identityId" - ], - "properties": { - "caId": { - "type": "string", - "x-nullable": true - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "identityId": { - "type": "string" - }, - "method": { - "type": "string", - "enum": [ - "ott", - "ottca", - "updb" - ] - }, - "username": { - "type": "string", - "x-nullable": true - } - } - }, - "enrollmentDetail": { - "description": "An enrollment object. Enrollments are tied to identities and potentially a CA. Depending on the\nmethod, different fields are utilized. For example ottca enrollments use the ` + "`" + `ca` + "`" + ` field and updb enrollments\nuse the username field, but not vice versa.\n", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "token", - "method", - "expiresAt", - "details" - ], - "properties": { - "caId": { - "type": "string", - "x-nullable": true - }, - "edgeRouter": { - "$ref": "#/definitions/entityRef" - }, - "edgeRouterId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "method": { - "type": "string" - }, - "token": { - "type": "string" - }, - "transitRouter": { - "$ref": "#/definitions/entityRef" - }, - "transitRouterId": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - ], - "example": { - "_links": { - "self": { - "href": "./enrollments/624fa53f-7629-4a7a-9e38-c1f4ce322c1d" - } - }, - "ca": null, - "createdAt": "0001-01-01T00:00:00Z", - "expiresAt": "2020-03-11T20:20:24.0055543Z", - "id": "624fa53f-7629-4a7a-9e38-c1f4ce322c1d", - "identity": { - "_links": { - "self": { - "href": "./identities/f047ac96-dc3a-408a-a6f2-0ba487c08ef9" - } - }, - "id": "f047ac96-dc3a-408a-a6f2-0ba487c08ef9", - "name": "updb--0f245140-7f2e-4326-badf-6aba55e52475", - "urlName": "identities" - }, - "method": "updb", - "tags": null, - "token": "1e727c8f-07e4-4a1d-a8b0-da0c7a01c6e1", - "updatedAt": "0001-01-01T00:00:00Z", - "username": "example-username" - } - }, - "enrollmentList": { - "description": "An array of enrollment resources", - "type": "array", - "items": { - "$ref": "#/definitions/enrollmentDetail" - } - }, - "enrollmentRefresh": { - "type": "object", - "required": [ - "expiresAt" - ], - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - }, - "entityRef": { - "description": "A reference to another resource and links to interact with it", - "type": "object", - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "entity": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "envInfo": { - "description": "Environment information an authenticating client may provide", - "type": "object", - "properties": { - "arch": { - "type": "string" - }, - "os": { - "type": "string" - }, - "osRelease": { - "type": "string" - }, - "osVersion": { - "type": "string" - } - } - }, - "externalIdClaim": { - "type": "object", - "required": [ - "location", - "matcher", - "matcherCriteria", - "parser", - "parserCriteria", - "index" - ], - "properties": { - "index": { - "type": "integer", - "x-nullable": true - }, - "location": { - "type": "string", - "enum": [ - "COMMON_NAME", - "SAN_URI", - "SAN_EMAIL" - ], - "x-nullable": true - }, - "matcher": { - "type": "string", - "enum": [ - "ALL", - "PREFIX", - "SUFFIX", - "SCHEME" - ], - "x-nullable": true - }, - "matcherCriteria": { - "type": "string", - "x-nullable": true - }, - "parser": { - "type": "string", - "enum": [ - "NONE", - "SPLIT" - ], - "x-nullable": true - }, - "parserCriteria": { - "type": "string", - "x-nullable": true - } - } - }, - "externalIdClaimPatch": { - "type": "object", - "properties": { - "index": { - "type": "integer", - "x-nullable": true - }, - "location": { - "type": "string", - "enum": [ - "COMMON_NAME", - "SAN_URI", - "SAN_EMAIL" - ], - "x-nullable": true - }, - "matcher": { - "type": "string", - "enum": [ - "ALL", - "PREFIX", - "SUFFIX", - "SCHEME" - ], - "x-nullable": true - }, - "matcherCriteria": { - "type": "string", - "x-nullable": true - }, - "parser": { - "type": "string", - "enum": [ - "NONE", - "SPLIT" - ], - "x-nullable": true - }, - "parserCriteria": { - "type": "string", - "x-nullable": true - } - } - }, - "externalJwtSignerCreate": { - "description": "A create Certificate Authority (CA) object", - "type": "object", - "required": [ - "name", - "enabled", - "issuer", - "audience" - ], - "properties": { - "audience": { - "type": "string", - "x-nullable": true - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string", - "x-nullable": true - }, - "enabled": { - "type": "boolean" - }, - "externalAuthUrl": { - "type": "string", - "format": "url", - "x-nullable": true - }, - "issuer": { - "type": "string" - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "example": "MyApps Signer" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "useExternalId": { - "type": "boolean", - "x-nullable": true - } - } - }, - "externalJwtSignerDetail": { - "description": "A External JWT Signer resource", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "certPem", - "jwksEndpoint", - "enabled", - "fingerprint", - "commonName", - "notAfter", - "notBefore", - "externalAuthUrl", - "claimsProperty", - "useExternalId", - "kid", - "issuer", - "audience" - ], - "properties": { - "audience": { - "type": "string" - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string" - }, - "commonName": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "externalAuthUrl": { - "type": "string", - "format": "url" - }, - "fingerprint": { - "type": "string" - }, - "issuer": { - "type": "string" - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string" - }, - "name": { - "type": "string", - "example": "MyApps Signer" - }, - "notAfter": { - "type": "string", - "format": "date-time" - }, - "notBefore": { - "type": "string", - "format": "date-time" - }, - "useExternalId": { - "type": "boolean" - } - } - } - ] - }, - "externalJwtSignerList": { - "description": "An array of External JWT Signers resources", - "type": "array", - "items": { - "$ref": "#/definitions/externalJwtSignerDetail" - } - }, - "externalJwtSignerPatch": { - "type": "object", - "properties": { - "audience": { - "type": "string", - "x-nullable": true - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string", - "x-nullable": true - }, - "enabled": { - "type": "boolean", - "x-nullable": true - }, - "externalAuthUrl": { - "type": "string", - "format": "url", - "x-nullable": true - }, - "issuer": { - "type": "string", - "x-nullable": true - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "x-nullable": true, - "example": "MyApps Signer" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "useExternalId": { - "type": "boolean", - "x-nullable": true - } - } - }, - "externalJwtSignerUpdate": { - "type": "object", - "required": [ - "name", - "enabled", - "issuer", - "audience" - ], - "properties": { - "audience": { - "type": "string", - "x-nullable": true - }, - "certPem": { - "type": "string", - "x-nullable": true - }, - "claimsProperty": { - "type": "string", - "x-nullable": true - }, - "enabled": { - "type": "boolean" - }, - "externalAuthUrl": { - "type": "string", - "format": "url", - "x-nullable": true - }, - "issuer": { - "type": "string" - }, - "jwksEndpoint": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "kid": { - "type": "string", - "x-nullable": true - }, - "name": { - "type": "string", - "example": "MyApps Signer" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "useExternalId": { - "type": "boolean", - "x-nullable": true - } - } - }, - "failedServiceRequest": { - "type": "object", - "properties": { - "apiSessionId": { - "type": "string" - }, - "policyFailures": { - "type": "array", - "items": { - "$ref": "#/definitions/policyFailure" - } - }, - "serviceId": { - "type": "string" - }, - "serviceName": { - "type": "string" - }, - "sessionType": { - "$ref": "#/definitions/dialBind" - }, - "when": { - "type": "string", - "format": "date-time" - } - } - }, - "failedServiceRequestEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/failedServiceRequestList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "failedServiceRequestList": { - "type": "array", - "items": { - "$ref": "#/definitions/failedServiceRequest" - } - }, - "getIdentityPolicyAdviceEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/policyAdvice" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityAuthenticators": { - "type": "object", - "properties": { - "cert": { - "type": "object", - "properties": { - "fingerprint": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "username": { - "type": "string" - } - } - } - } - }, - "identityCreate": { - "description": "An identity to create", - "type": "object", - "required": [ - "name", - "type", - "isAdmin" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string", - "x-nullable": true - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "enrollment": { - "type": "object", - "properties": { - "ott": { - "type": "boolean" - }, - "ottca": { - "type": "string" - }, - "updb": { - "type": "string" - } - } - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "isAdmin": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/identityType" - } - } - }, - "identityDetail": { - "description": "Detail of a specific identity", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "type", - "typeId", - "isDefaultAdmin", - "isAdmin", - "authenticators", - "enrollment", - "envInfo", - "sdkInfo", - "roleAttributes", - "hasEdgeRouterConnection", - "hasApiSession", - "isMfaEnabled", - "serviceHostingPrecedences", - "serviceHostingCosts", - "defaultHostingCost", - "authPolicyId", - "externalId", - "disabled" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string" - }, - "authenticators": { - "$ref": "#/definitions/identityAuthenticators" - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "disabled": { - "type": "boolean" - }, - "disabledAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "disabledUntil": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollment": { - "$ref": "#/definitions/identityEnrollments" - }, - "envInfo": { - "$ref": "#/definitions/envInfo" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "hasApiSession": { - "type": "boolean" - }, - "hasEdgeRouterConnection": { - "type": "boolean" - }, - "isAdmin": { - "type": "boolean" - }, - "isDefaultAdmin": { - "type": "boolean" - }, - "isMfaEnabled": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "sdkInfo": { - "$ref": "#/definitions/sdkInfo" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "type": { - "$ref": "#/definitions/entityRef" - }, - "typeId": { - "type": "string" - } - } - } - ] - }, - "identityEnrollments": { - "type": "object", - "properties": { - "ott": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "ottca": { - "type": "object", - "properties": { - "ca": { - "$ref": "#/definitions/entityRef" - }, - "caId": { - "type": "string" - }, - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - }, - "updb": { - "type": "object", - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "jwt": { - "type": "string" - }, - "token": { - "type": "string" - } - } - } - } - }, - "identityExtendCerts": { - "type": "object", - "properties": { - "ca": { - "description": "A PEM encoded set of CA certificates", - "type": "string" - }, - "clientCert": { - "description": "A PEM encoded client certificate", - "type": "string" - } - } - }, - "identityExtendEnrollmentEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/identityExtendCerts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "identityExtendEnrollmentRequest": { - "type": "object", - "required": [ - "clientCertCsr" - ], - "properties": { - "clientCertCsr": { - "type": "string" - } - } - }, - "identityExtendValidateEnrollmentRequest": { - "type": "object", - "required": [ - "clientCert" - ], - "properties": { - "clientCert": { - "description": "A PEM encoded client certificate previously returned after an extension request", - "type": "string" - } - } - }, - "identityList": { - "description": "A list of identities", - "type": "array", - "items": { - "$ref": "#/definitions/identityDetail" - } - }, - "identityPatch": { - "type": "object", - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string", - "x-nullable": true - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "isAdmin": { - "type": "boolean", - "x-nullable": true - }, - "name": { - "type": "string", - "x-nullable": true - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/identityType" - } - } - }, - "identityType": { - "type": "string", - "enum": [ - "User", - "Device", - "Service", - "Router" - ] - }, - "identityTypeDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "identityTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/identityTypeDetail" - } - }, - "identityUpdate": { - "type": "object", - "required": [ - "type", - "name", - "isAdmin" - ], - "properties": { - "appData": { - "$ref": "#/definitions/tags" - }, - "authPolicyId": { - "type": "string", - "x-nullable": true - }, - "defaultHostingCost": { - "$ref": "#/definitions/terminatorCost" - }, - "defaultHostingPrecedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "externalId": { - "type": "string", - "x-nullable": true - }, - "isAdmin": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "serviceHostingCosts": { - "$ref": "#/definitions/terminatorCostMap" - }, - "serviceHostingPrecedences": { - "$ref": "#/definitions/terminatorPrecedenceMap" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/identityType" - } - } - }, - "link": { - "description": "A link to another resource", - "type": "object", - "required": [ - "href" - ], - "properties": { - "comment": { - "type": "string" - }, - "href": { - "type": "string", - "format": "uri" - }, - "method": { - "type": "string" - } - } - }, - "links": { - "description": "A map of named links", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/link" - }, - "x-omitempty": false - }, - "listApiSessionsEnvelope": { - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/apiSessionList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listAuthPoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/authPolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listAuthenticatorsEnvelope": { - "type": "object", - "properties": { - "data": { - "$ref": "#/definitions/authenticatorList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listCasEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/caList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listConfigTypesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listConfigsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/configList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listEdgeRouterPoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterPolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listEdgeRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/edgeRouterList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listEnrollmentsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/enrollmentList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listExternalJwtSignersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/externalJwtSignerList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listIdentitiesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listIdentityTypesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/identityTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listPostureCheckEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckDetail" - } - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listPostureCheckTypesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureCheckTypeList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listRoleAttributesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/roleAttributesList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listRoutersEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/routerList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServiceConfigsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceConfigList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServiceEdgeRouterPoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceEdgeRouterPolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServicePoliciesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/servicePolicyList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listServicesEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/serviceList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSessionsManagementEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/sessionManagementList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSpecsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/specList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listSummaryCounts": { - "type": "object", - "additionalProperties": { - "type": "integer" - } - }, - "listSummaryCountsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/listSummaryCounts" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listTerminatorsEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/terminatorList" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "listVersionEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/version" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "meta": { - "type": "object", - "properties": { - "apiEnrollmentVersion": { - "type": "string" - }, - "apiVersion": { - "type": "string" - }, - "filterableFields": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": true - }, - "pagination": { - "$ref": "#/definitions/pagination" - } - } - }, - "mfaCode": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string" - } - } - }, - "mfaFormats": { - "type": "string", - "enum": [ - "numeric", - "alpha", - "alphaNumeric" - ] - }, - "mfaProviders": { - "type": "string", - "enum": [ - "ziti", - "url" - ] - }, - "namedRole": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "role": { - "type": "string" - } - } - }, - "namedRoles": { - "type": "array", - "items": { - "$ref": "#/definitions/namedRole" - }, - "x-omitempty": false - }, - "operatingSystem": { - "type": "object", - "required": [ - "type", - "versions" - ], - "properties": { - "type": { - "$ref": "#/definitions/osType" - }, - "versions": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "osType": { - "type": "string", - "enum": [ - "Windows", - "WindowsServer", - "Android", - "iOS", - "Linux", - "macOS" - ] - }, - "pagination": { - "type": "object", - "required": [ - "limit", - "offset", - "totalCount" - ], - "properties": { - "limit": { - "type": "number", - "format": "int64" - }, - "offset": { - "type": "number", - "format": "int64" - }, - "totalCount": { - "type": "number", - "format": "int64" - } - } - }, - "password": { - "type": "string", - "maxLength": 100, - "minLength": 5 - }, - "passwordNullable": { - "type": "string", - "maxLength": 100, - "minLength": 5, - "x-nullable": true - }, - "policyAdvice": { - "type": "object", - "properties": { - "commonRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/routerEntityRef" - } - }, - "identity": { - "$ref": "#/definitions/entityRef" - }, - "identityId": { - "type": "string" - }, - "identityRouterCount": { - "type": "number", - "format": "int32" - }, - "isBindAllowed": { - "type": "boolean" - }, - "isDialAllowed": { - "type": "boolean" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - }, - "serviceRouterCount": { - "type": "number", - "format": "int32" - } - } - }, - "policyFailure": { - "type": "object", - "properties": { - "checks": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckFailure" - } - }, - "policyId": { - "type": "string" - }, - "policyName": { - "type": "string" - } - } - }, - "postureCheckCreate": { - "type": "object", - "required": [ - "name", - "typeId" - ], - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureCheckDetail": { - "type": "object", - "required": [ - "name", - "typeId", - "version", - "roleAttributes", - "id", - "createdAt", - "updatedAt", - "_links", - "tags" - ], - "properties": { - "_links": { - "$ref": "#/definitions/links" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "type": "string" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "version": { - "type": "integer" - } - }, - "discriminator": "typeId" - }, - "postureCheckDomainCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "domains" - ], - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckDomainDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "domains" - ], - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckDomainPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckDomainUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "domains" - ], - "properties": { - "domains": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckFailure": { - "type": "object", - "required": [ - "postureCheckId", - "postureCheckName", - "postureCheckType" - ], - "properties": { - "postureCheckId": { - "type": "string" - }, - "postureCheckName": { - "type": "string" - }, - "postureCheckType": { - "type": "string" - } - }, - "discriminator": "postureCheckType" - }, - "postureCheckFailureDomain": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "type": "string" - }, - "expectedValue": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "DOMAIN" - }, - "postureCheckFailureMacAddress": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "type": "array", - "items": { - "type": "string" - } - }, - "expectedValue": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckFailureMfa": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue", - "criteria" - ], - "properties": { - "actualValue": { - "$ref": "#/definitions/postureChecksFailureMfaValues" - }, - "criteria": { - "$ref": "#/definitions/postureChecksFailureMfaCriteria" - }, - "expectedValue": { - "$ref": "#/definitions/postureChecksFailureMfaValues" - } - } - } - ], - "x-class": "MFA" - }, - "postureCheckFailureOperatingSystem": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "$ref": "#/definitions/postureCheckFailureOperatingSystemActual" - }, - "expectedValue": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckFailureOperatingSystemActual": { - "type": "object", - "required": [ - "type", - "version" - ], - "properties": { - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "postureCheckFailureProcess": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue" - ], - "properties": { - "actualValue": { - "$ref": "#/definitions/postureCheckFailureProcessActual" - }, - "expectedValue": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckFailureProcessActual": { - "type": "object", - "required": [ - "isRunning", - "hash", - "signerFingerprints" - ], - "properties": { - "hash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "postureCheckFailureProcessMulti": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckFailure" - }, - { - "type": "object", - "required": [ - "actualValue", - "expectedValue", - "semantic" - ], - "properties": { - "actualValue": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckFailureProcessActual" - } - }, - "expectedValue": { - "type": "array", - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckMacAddressCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMacAddressDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMacAddressPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMacAddressUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "macAddresses" - ], - "properties": { - "macAddresses": { - "type": "array", - "minItems": 1, - "items": { - "type": "string" - } - } - } - } - ], - "x-class": "MAC" - }, - "postureCheckMfaCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "$ref": "#/definitions/postureCheckMfaProperties" - } - ], - "x-class": "MFA" - }, - "postureCheckMfaDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "$ref": "#/definitions/postureCheckMfaProperties" - } - ], - "x-class": "MFA" - }, - "postureCheckMfaPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "$ref": "#/definitions/postureCheckMfaPropertiesPatch" - } - ], - "x-class": "MFA" - }, - "postureCheckMfaProperties": { - "type": "object", - "properties": { - "ignoreLegacyEndpoints": { - "type": "boolean" - }, - "promptOnUnlock": { - "type": "boolean" - }, - "promptOnWake": { - "type": "boolean" - }, - "timeoutSeconds": { - "type": "integer" - } - } - }, - "postureCheckMfaPropertiesPatch": { - "type": "object", - "properties": { - "ignoreLegacyEndpoints": { - "type": "boolean", - "x-nullable": true - }, - "promptOnUnlock": { - "type": "boolean", - "x-nullable": true - }, - "promptOnWake": { - "type": "boolean", - "x-nullable": true - }, - "timeoutSeconds": { - "type": "integer", - "x-nullable": true - } - } - }, - "postureCheckMfaUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "$ref": "#/definitions/postureCheckMfaProperties" - } - ], - "x-class": "MFA" - }, - "postureCheckOperatingSystemCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "operatingSystems" - ], - "properties": { - "operatingSystems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckOperatingSystemDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "operatingSystems" - ], - "properties": { - "operatingSystems": { - "type": "array", - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckOperatingSystemPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "operatingSystems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckOperatingSystemUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "operatingSystems" - ], - "properties": { - "operatingSystems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/operatingSystem" - } - } - } - } - ], - "x-class": "OS" - }, - "postureCheckPatch": { - "type": "object", - "required": [ - "typeId" - ], - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureCheckProcessCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckProcessDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckProcessMultiCreate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckCreate" - }, - { - "type": "object", - "required": [ - "semantic", - "processes" - ], - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessMultiDetail": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckDetail" - }, - { - "type": "object", - "required": [ - "semantic", - "processes" - ], - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessMultiPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessMultiUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "semantic", - "processes" - ], - "properties": { - "processes": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/processMulti" - } - }, - "semantic": { - "$ref": "#/definitions/semantic" - } - } - } - ], - "x-class": "PROCESS_MULTI" - }, - "postureCheckProcessPatch": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckPatch" - }, - { - "type": "object", - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckProcessUpdate": { - "allOf": [ - { - "$ref": "#/definitions/postureCheckUpdate" - }, - { - "type": "object", - "required": [ - "process" - ], - "properties": { - "process": { - "$ref": "#/definitions/process" - } - } - } - ], - "x-class": "PROCESS" - }, - "postureCheckType": { - "type": "string", - "enum": [ - "OS", - "PROCESS", - "DOMAIN", - "MAC", - "MFA", - "PROCESS_MULTI" - ] - }, - "postureCheckTypeDetail": { - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "operatingSystems", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "operatingSystems": { - "type": "array", - "items": { - "$ref": "#/definitions/operatingSystem" - } - }, - "version": { - "type": "string" - } - } - } - ] - }, - "postureCheckTypeList": { - "type": "array", - "items": { - "$ref": "#/definitions/postureCheckTypeDetail" - } - }, - "postureCheckUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "typeId": { - "$ref": "#/definitions/postureCheckType" - } - }, - "discriminator": "typeId" - }, - "postureChecksFailureMfaCriteria": { - "type": "object", - "required": [ - "passedMfaAt", - "wokenAt", - "unlockedAt", - "timeoutSeconds", - "timeoutRemainingSeconds" - ], - "properties": { - "passedMfaAt": { - "type": "string", - "format": "date-time" - }, - "timeoutRemainingSeconds": { - "type": "integer" - }, - "timeoutSeconds": { - "type": "integer" - }, - "unlockedAt": { - "type": "string", - "format": "date-time" - }, - "wokenAt": { - "type": "string", - "format": "date-time" - } - } - }, - "postureChecksFailureMfaValues": { - "type": "object", - "properties": { - "passedMfa": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnUnlock": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnWake": { - "type": "boolean", - "x-omitempty": false - }, - "timedOut": { - "type": "boolean", - "x-omitempty": false - } - } - }, - "postureData": { - "type": "object", - "required": [ - "mac", - "domain", - "os", - "processes", - "apiSessionPostureData" - ], - "properties": { - "apiSessionPostureData": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/apiSessionPostureData" - } - }, - "domain": { - "$ref": "#/definitions/postureDataDomain" - }, - "mac": { - "$ref": "#/definitions/postureDataMac" - }, - "os": { - "$ref": "#/definitions/postureDataOs" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureDataProcess" - } - } - } - }, - "postureDataBase": { - "type": "object", - "required": [ - "postureCheckId", - "timedOut", - "lastUpdatedAt" - ], - "properties": { - "lastUpdatedAt": { - "type": "string", - "format": "date-time" - }, - "postureCheckId": { - "type": "string" - }, - "timedOut": { - "type": "boolean" - } - } - }, - "postureDataDomain": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "domain" - ], - "properties": { - "domain": { - "type": "string" - } - } - } - ] - }, - "postureDataEndpointState": { - "type": "object", - "required": [ - "wokenAt", - "unlockedAt" - ], - "properties": { - "unlockedAt": { - "type": "string", - "format": "date-time" - }, - "wokenAt": { - "type": "string", - "format": "date-time" - } - } - }, - "postureDataEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/postureData" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "postureDataMac": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "addresses" - ], - "properties": { - "addresses": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "postureDataMfa": { - "type": "object", - "required": [ - "apiSessionId", - "passedMfa", - "passedOnWake", - "passedOnUnlock", - "passedAt" - ], - "properties": { - "apiSessionId": { - "type": "string" - }, - "passedAt": { - "type": "string", - "format": "date-time", - "x-omitempty": false - }, - "passedMfa": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnUnlock": { - "type": "boolean", - "x-omitempty": false - }, - "passedOnWake": { - "type": "boolean", - "x-omitempty": false - } - } - }, - "postureDataOs": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "required": [ - "type", - "version", - "build" - ], - "properties": { - "build": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - ] - }, - "postureDataProcess": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/postureDataBase" - }, - { - "type": "object", - "properties": { - "binaryHash": { - "type": "string" - }, - "isRunning": { - "type": "boolean" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - }, - "postureQueries": { - "type": "object", - "required": [ - "policyId", - "isPassing", - "postureQueries" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "policyId": { - "type": "string" - }, - "policyType": { - "$ref": "#/definitions/dialBind" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQuery" - } - } - } - }, - "postureQuery": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "queryType", - "isPassing", - "timeout", - "timeoutRemaining" - ], - "properties": { - "isPassing": { - "type": "boolean" - }, - "process": { - "$ref": "#/definitions/postureQueryProcess" - }, - "processes": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueryProcess" - } - }, - "queryType": { - "$ref": "#/definitions/postureCheckType" - }, - "timeout": { - "type": "integer" - }, - "timeoutRemaining": { - "type": "integer" - } - } - } - ] - }, - "postureQueryProcess": { - "type": "object", - "properties": { - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - } - } - }, - "process": { - "type": "object", - "required": [ - "osType", - "path" - ], - "properties": { - "hashes": { - "type": "array", - "items": { - "type": "string" - } - }, - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - }, - "signerFingerprint": { - "type": "string" - } - } - }, - "processMulti": { - "type": "object", - "required": [ - "osType", - "path" - ], - "properties": { - "hashes": { - "type": "array", - "items": { - "type": "string" - } - }, - "osType": { - "$ref": "#/definitions/osType" - }, - "path": { - "type": "string" - }, - "signerFingerprints": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "reEnroll": { - "type": "object", - "required": [ - "expiresAt" - ], - "properties": { - "expiresAt": { - "type": "string", - "format": "date-time" - } - } - }, - "roleAttributesList": { - "description": "An array of role attributes", - "type": "array", - "items": { - "type": "string" - } - }, - "roles": { - "type": "array", - "items": { - "type": "string" - }, - "x-omitempty": false - }, - "routerCreate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "routerDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "isVerified", - "isOnline", - "fingerprint", - "cost", - "noTraversal" - ], - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0 - }, - "enrollmentCreatedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "enrollmentJwt": { - "type": "string", - "x-nullable": true - }, - "enrollmentToken": { - "type": "string", - "x-nullable": true - }, - "fingerprint": { - "type": "string" - }, - "isOnline": { - "type": "boolean" - }, - "isVerified": { - "type": "boolean" - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean" - }, - "unverifiedCertPem": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "unverifiedFingerprint": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - } - } - } - ] - }, - "routerEntityRef": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/entityRef" - }, - { - "type": "object", - "required": [ - "isOnline" - ], - "properties": { - "isOnline": { - "type": "boolean" - } - } - } - ] - }, - "routerList": { - "type": "array", - "items": { - "$ref": "#/definitions/routerDetail" - } - }, - "routerPatch": { - "type": "object", - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "routerUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "cost": { - "type": "integer", - "maximum": 65535, - "minimum": 0, - "x-nullable": true - }, - "name": { - "type": "string" - }, - "noTraversal": { - "type": "boolean", - "x-nullable": true - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "sdkInfo": { - "description": "SDK information an authenticating client may provide", - "type": "object", - "properties": { - "appId": { - "type": "string" - }, - "appVersion": { - "type": "string" - }, - "branch": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "type": { - "type": "string" - }, - "version": { - "type": "string" - } - } - }, - "semantic": { - "type": "string", - "enum": [ - "AllOf", - "AnyOf" - ] - }, - "serviceConfigAssign": { - "type": "object", - "required": [ - "serviceId", - "configId" - ], - "properties": { - "configId": { - "type": "string" - }, - "serviceId": { - "type": "string" - } - } - }, - "serviceConfigDetail": { - "type": "object", - "required": [ - "serviceId", - "service", - "configId", - "config" - ], - "properties": { - "config": { - "$ref": "#/definitions/entityRef" - }, - "configId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - } - }, - "example": { - "config": { - "_links": { - "self": { - "href": "./identities/13347602-ba34-4ff7-8082-e533ba945744" - } - }, - "id": "13347602-ba34-4ff7-8082-e533ba945744", - "name": "test-config-02fade09-fcc3-426c-854e-18539726bdc6", - "urlName": "configs" - }, - "service": { - "_links": { - "self": { - "href": "./services/913a8c63-17a6-44d7-82b3-9f6eb997cf8e" - } - }, - "id": "913a8c63-17a6-44d7-82b3-9f6eb997cf8e", - "name": "netcat4545-egress-r2", - "urlName": "services" - } - } - }, - "serviceConfigList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceConfigDetail" - } - }, - "serviceConfigsAssignList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceConfigAssign" - } - }, - "serviceCreate": { - "type": "object", - "required": [ - "name", - "encryptionRequired" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "serviceDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "terminatorStrategy", - "roleAttributes", - "permissions", - "configs", - "config", - "encryptionRequired", - "postureQueries" - ], - "properties": { - "config": { - "description": "map of config data for this service keyed by the config type name. Only configs of the types requested will be returned.", - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "object" - } - } - }, - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "permissions": { - "$ref": "#/definitions/dialBindArray" - }, - "postureQueries": { - "type": "array", - "items": { - "$ref": "#/definitions/postureQueries" - } - }, - "roleAttributes": { - "$ref": "#/definitions/attributes" - }, - "terminatorStrategy": { - "type": "string" - } - } - } - ] - }, - "serviceEdgeRouterPolicyCreate": { - "type": "object", - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "serviceEdgeRouterPolicyDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "semantic", - "edgeRouterRoles", - "edgeRouterRolesDisplay", - "serviceRoles", - "serviceRolesDisplay" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "edgeRouterRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "serviceRolesDisplay": { - "$ref": "#/definitions/namedRoles" - } - } - } - ] - }, - "serviceEdgeRouterPolicyList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceEdgeRouterPolicyDetail" - } - }, - "serviceEdgeRouterPolicyPatch": { - "type": "object", - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "serviceEdgeRouterPolicyUpdate": { - "type": "object", - "required": [ - "name", - "semantic" - ], - "properties": { - "edgeRouterRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "serviceList": { - "type": "array", - "items": { - "$ref": "#/definitions/serviceDetail" - } - }, - "servicePatch": { - "type": "object", - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "servicePolicyCreate": { - "type": "object", - "required": [ - "name", - "type", - "semantic" - ], - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "servicePolicyDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name", - "type", - "semantic", - "serviceRoles", - "serviceRolesDisplay", - "identityRoles", - "identityRolesDisplay", - "postureCheckRoles", - "postureCheckRolesDisplay" - ], - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "identityRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "postureCheckRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "serviceRolesDisplay": { - "$ref": "#/definitions/namedRoles" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - } - ] - }, - "servicePolicyList": { - "type": "array", - "items": { - "$ref": "#/definitions/servicePolicyDetail" - } - }, - "servicePolicyPatch": { - "type": "object", - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "servicePolicyUpdate": { - "type": "object", - "required": [ - "name", - "type", - "semantic" - ], - "properties": { - "identityRoles": { - "$ref": "#/definitions/roles" - }, - "name": { - "type": "string" - }, - "postureCheckRoles": { - "$ref": "#/definitions/roles" - }, - "semantic": { - "$ref": "#/definitions/semantic" - }, - "serviceRoles": { - "$ref": "#/definitions/roles" - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - }, - "serviceUpdate": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "configs": { - "type": "array", - "items": { - "type": "string" - } - }, - "encryptionRequired": { - "description": "Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create.", - "type": "boolean" - }, - "name": { - "type": "string" - }, - "roleAttributes": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "$ref": "#/definitions/tags" - }, - "terminatorStrategy": { - "type": "string" - } - } - }, - "sessionDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "type", - "apiSessionId", - "apiSession", - "serviceId", - "service", - "token", - "edgeRouters", - "identityId" - ], - "properties": { - "apiSession": { - "$ref": "#/definitions/entityRef" - }, - "apiSessionId": { - "type": "string" - }, - "edgeRouters": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionEdgeRouter" - } - }, - "identityId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - }, - "token": { - "type": "string" - }, - "type": { - "$ref": "#/definitions/dialBind" - } - } - } - ] - }, - "sessionEdgeRouter": { - "allOf": [ - { - "$ref": "#/definitions/commonEdgeRouterProperties" - }, - { - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - ] - }, - "sessionManagementDetail": { - "allOf": [ - { - "$ref": "#/definitions/sessionDetail" - }, - { - "type": "object", - "properties": { - "servicePolicies": { - "type": "array", - "items": { - "$ref": "#/definitions/entityRef" - } - } - } - } - ] - }, - "sessionManagementList": { - "type": "array", - "items": { - "$ref": "#/definitions/sessionManagementDetail" - } - }, - "sessionRoutePathDetail": { - "type": "object", - "properties": { - "routePath": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "specBodyDetail": { - "type": "string" - }, - "specDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - } - ] - }, - "specList": { - "type": "array", - "items": { - "$ref": "#/definitions/specDetail" - } - }, - "subTags": { - "type": "object", - "additionalProperties": { - "type": "object" - } - }, - "tags": { - "description": "A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean", - "allOf": [ - { - "$ref": "#/definitions/subTags" - } - ], - "x-nullable": true - }, - "terminatorCost": { - "type": "integer", - "maximum": 65535, - "minimum": 0 - }, - "terminatorCostMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorCost" - } - }, - "terminatorCreate": { - "type": "object", - "required": [ - "service", - "router", - "address", - "binding" - ], - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "identity": { - "type": "string" - }, - "identitySecret": { - "type": "string", - "format": "byte" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "type": "string" - }, - "service": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "terminatorDetail": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/baseEntity" - }, - { - "type": "object", - "required": [ - "serviceId", - "service", - "routerId", - "router", - "binding", - "address", - "identity", - "cost", - "precedence", - "dynamicCost" - ], - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "dynamicCost": { - "$ref": "#/definitions/terminatorCost" - }, - "identity": { - "type": "string" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "$ref": "#/definitions/entityRef" - }, - "routerId": { - "type": "string" - }, - "service": { - "$ref": "#/definitions/entityRef" - }, - "serviceId": { - "type": "string" - } - } - } - ] - }, - "terminatorList": { - "type": "array", - "items": { - "$ref": "#/definitions/terminatorDetail" - } - }, - "terminatorPatch": { - "type": "object", - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "type": "string" - }, - "service": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "terminatorPrecedence": { - "type": "string", - "enum": [ - "default", - "required", - "failed" - ] - }, - "terminatorPrecedenceMap": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/terminatorPrecedence" - } - }, - "terminatorUpdate": { - "type": "object", - "required": [ - "service", - "router", - "address", - "binding" - ], - "properties": { - "address": { - "type": "string" - }, - "binding": { - "type": "string" - }, - "cost": { - "$ref": "#/definitions/terminatorCost" - }, - "precedence": { - "$ref": "#/definitions/terminatorPrecedence" - }, - "router": { - "type": "string" - }, - "service": { - "type": "string" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "traceDetail": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "traceId": { - "type": "string" - }, - "until": { - "type": "string", - "format": "date-time" - } - } - }, - "traceDetailEnvelope": { - "type": "object", - "required": [ - "meta", - "data" - ], - "properties": { - "data": { - "$ref": "#/definitions/traceDetail" - }, - "meta": { - "$ref": "#/definitions/meta" - } - } - }, - "traceSpec": { - "type": "object", - "properties": { - "channels": { - "type": "array", - "items": { - "type": "string" - } - }, - "duration": { - "type": "string" - }, - "enabled": { - "type": "boolean" - }, - "traceId": { - "type": "string" - } - } - }, - "username": { - "type": "string", - "maxLength": 100, - "minLength": 4 - }, - "usernameNullable": { - "type": "string", - "maxLength": 100, - "minLength": 4, - "x-nullable": true - }, - "version": { - "type": "object", - "properties": { - "apiVersions": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/apiVersion" - } - } - }, - "buildDate": { - "type": "string", - "example": "2020-02-11 16:09:08" - }, - "revision": { - "type": "string", - "example": "ea556fc18740" - }, - "runtimeVersion": { - "type": "string", - "example": "go1.13.5" - }, - "version": { - "type": "string", - "example": "v0.9.0" - } - } - }, - "versionInfo": { - "type": "object", - "required": [ - "os", - "version", - "arch", - "buildDate", - "revision" - ], - "properties": { - "arch": { - "type": "string" - }, - "buildDate": { - "type": "string" - }, - "os": { - "type": "string" - }, - "revision": { - "type": "string" - }, - "version": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "ztSession": { - "description": "An API Key that is provided post authentication", - "type": "apiKey", - "name": "zt-session", - "in": "header" - } - } -}`)) -} diff --git a/rest_management_api_server/operations/api_session/delete_api_sessions.go b/rest_management_api_server/operations/api_session/delete_api_sessions.go deleted file mode 100644 index 240fe3b7c..000000000 --- a/rest_management_api_server/operations/api_session/delete_api_sessions.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteAPISessionsHandlerFunc turns a function with the right signature into a delete API sessions handler -type DeleteAPISessionsHandlerFunc func(DeleteAPISessionsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteAPISessionsHandlerFunc) Handle(params DeleteAPISessionsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteAPISessionsHandler interface for that can handle valid delete API sessions params -type DeleteAPISessionsHandler interface { - Handle(DeleteAPISessionsParams, interface{}) middleware.Responder -} - -// NewDeleteAPISessions creates a new http.Handler for the delete API sessions operation -func NewDeleteAPISessions(ctx *middleware.Context, handler DeleteAPISessionsHandler) *DeleteAPISessions { - return &DeleteAPISessions{Context: ctx, Handler: handler} -} - -/* DeleteAPISessions swagger:route DELETE /api-sessions/{id} API Session deleteApiSessions - -Deletes an API Sessions - -Deletes and API sesion by id. Requires admin access. - -*/ -type DeleteAPISessions struct { - Context *middleware.Context - Handler DeleteAPISessionsHandler -} - -func (o *DeleteAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteAPISessionsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/api_session/delete_api_sessions_parameters.go b/rest_management_api_server/operations/api_session/delete_api_sessions_parameters.go deleted file mode 100644 index 4271cf48c..000000000 --- a/rest_management_api_server/operations/api_session/delete_api_sessions_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteAPISessionsParams creates a new DeleteAPISessionsParams object -// -// There are no default values defined in the spec. -func NewDeleteAPISessionsParams() DeleteAPISessionsParams { - - return DeleteAPISessionsParams{} -} - -// DeleteAPISessionsParams contains all the bound params for the delete API sessions operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteAPISessions -type DeleteAPISessionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteAPISessionsParams() beforehand. -func (o *DeleteAPISessionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteAPISessionsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/api_session/delete_api_sessions_responses.go b/rest_management_api_server/operations/api_session/delete_api_sessions_responses.go deleted file mode 100644 index ac2da8330..000000000 --- a/rest_management_api_server/operations/api_session/delete_api_sessions_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteAPISessionsOKCode is the HTTP code returned for type DeleteAPISessionsOK -const DeleteAPISessionsOKCode int = 200 - -/*DeleteAPISessionsOK The delete request was successful and the resource has been removed - -swagger:response deleteApiSessionsOK -*/ -type DeleteAPISessionsOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteAPISessionsOK creates DeleteAPISessionsOK with default headers values -func NewDeleteAPISessionsOK() *DeleteAPISessionsOK { - - return &DeleteAPISessionsOK{} -} - -// WithPayload adds the payload to the delete Api sessions o k response -func (o *DeleteAPISessionsOK) WithPayload(payload *rest_model.Empty) *DeleteAPISessionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete Api sessions o k response -func (o *DeleteAPISessionsOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAPISessionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAPISessionsForbiddenCode is the HTTP code returned for type DeleteAPISessionsForbidden -const DeleteAPISessionsForbiddenCode int = 403 - -/*DeleteAPISessionsForbidden The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteApiSessionsForbidden -*/ -type DeleteAPISessionsForbidden struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteAPISessionsForbidden creates DeleteAPISessionsForbidden with default headers values -func NewDeleteAPISessionsForbidden() *DeleteAPISessionsForbidden { - - return &DeleteAPISessionsForbidden{} -} - -// WithPayload adds the payload to the delete Api sessions forbidden response -func (o *DeleteAPISessionsForbidden) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteAPISessionsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete Api sessions forbidden response -func (o *DeleteAPISessionsForbidden) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAPISessionsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAPISessionsNotFoundCode is the HTTP code returned for type DeleteAPISessionsNotFound -const DeleteAPISessionsNotFoundCode int = 404 - -/*DeleteAPISessionsNotFound The requested resource does not exist - -swagger:response deleteApiSessionsNotFound -*/ -type DeleteAPISessionsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteAPISessionsNotFound creates DeleteAPISessionsNotFound with default headers values -func NewDeleteAPISessionsNotFound() *DeleteAPISessionsNotFound { - - return &DeleteAPISessionsNotFound{} -} - -// WithPayload adds the payload to the delete Api sessions not found response -func (o *DeleteAPISessionsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteAPISessionsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete Api sessions not found response -func (o *DeleteAPISessionsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAPISessionsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/api_session/delete_api_sessions_urlbuilder.go b/rest_management_api_server/operations/api_session/delete_api_sessions_urlbuilder.go deleted file mode 100644 index f23423a59..000000000 --- a/rest_management_api_server/operations/api_session/delete_api_sessions_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteAPISessionsURL generates an URL for the delete API sessions operation -type DeleteAPISessionsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAPISessionsURL) WithBasePath(bp string) *DeleteAPISessionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAPISessionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteAPISessionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/api-sessions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteAPISessionsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteAPISessionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteAPISessionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteAPISessionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteAPISessionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteAPISessionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteAPISessionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/api_session/detail_api_sessions.go b/rest_management_api_server/operations/api_session/detail_api_sessions.go deleted file mode 100644 index 3aa93d22b..000000000 --- a/rest_management_api_server/operations/api_session/detail_api_sessions.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailAPISessionsHandlerFunc turns a function with the right signature into a detail API sessions handler -type DetailAPISessionsHandlerFunc func(DetailAPISessionsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailAPISessionsHandlerFunc) Handle(params DetailAPISessionsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailAPISessionsHandler interface for that can handle valid detail API sessions params -type DetailAPISessionsHandler interface { - Handle(DetailAPISessionsParams, interface{}) middleware.Responder -} - -// NewDetailAPISessions creates a new http.Handler for the detail API sessions operation -func NewDetailAPISessions(ctx *middleware.Context, handler DetailAPISessionsHandler) *DetailAPISessions { - return &DetailAPISessions{Context: ctx, Handler: handler} -} - -/* DetailAPISessions swagger:route GET /api-sessions/{id} API Session detailApiSessions - -Retrieves a single API Session - -Retrieves a single API Session by id. Requires admin access. - -*/ -type DetailAPISessions struct { - Context *middleware.Context - Handler DetailAPISessionsHandler -} - -func (o *DetailAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailAPISessionsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/api_session/detail_api_sessions_parameters.go b/rest_management_api_server/operations/api_session/detail_api_sessions_parameters.go deleted file mode 100644 index 869ccc5bc..000000000 --- a/rest_management_api_server/operations/api_session/detail_api_sessions_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailAPISessionsParams creates a new DetailAPISessionsParams object -// -// There are no default values defined in the spec. -func NewDetailAPISessionsParams() DetailAPISessionsParams { - - return DetailAPISessionsParams{} -} - -// DetailAPISessionsParams contains all the bound params for the detail API sessions operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailAPISessions -type DetailAPISessionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailAPISessionsParams() beforehand. -func (o *DetailAPISessionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailAPISessionsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/api_session/detail_api_sessions_responses.go b/rest_management_api_server/operations/api_session/detail_api_sessions_responses.go deleted file mode 100644 index 20af4eb0f..000000000 --- a/rest_management_api_server/operations/api_session/detail_api_sessions_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailAPISessionsOKCode is the HTTP code returned for type DetailAPISessionsOK -const DetailAPISessionsOKCode int = 200 - -/*DetailAPISessionsOK Retrieves a singular API Session by id - -swagger:response detailApiSessionsOK -*/ -type DetailAPISessionsOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailAPISessionEnvelope `json:"body,omitempty"` -} - -// NewDetailAPISessionsOK creates DetailAPISessionsOK with default headers values -func NewDetailAPISessionsOK() *DetailAPISessionsOK { - - return &DetailAPISessionsOK{} -} - -// WithPayload adds the payload to the detail Api sessions o k response -func (o *DetailAPISessionsOK) WithPayload(payload *rest_model.DetailAPISessionEnvelope) *DetailAPISessionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail Api sessions o k response -func (o *DetailAPISessionsOK) SetPayload(payload *rest_model.DetailAPISessionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAPISessionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailAPISessionsUnauthorizedCode is the HTTP code returned for type DetailAPISessionsUnauthorized -const DetailAPISessionsUnauthorizedCode int = 401 - -/*DetailAPISessionsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailApiSessionsUnauthorized -*/ -type DetailAPISessionsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailAPISessionsUnauthorized creates DetailAPISessionsUnauthorized with default headers values -func NewDetailAPISessionsUnauthorized() *DetailAPISessionsUnauthorized { - - return &DetailAPISessionsUnauthorized{} -} - -// WithPayload adds the payload to the detail Api sessions unauthorized response -func (o *DetailAPISessionsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailAPISessionsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail Api sessions unauthorized response -func (o *DetailAPISessionsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAPISessionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailAPISessionsNotFoundCode is the HTTP code returned for type DetailAPISessionsNotFound -const DetailAPISessionsNotFoundCode int = 404 - -/*DetailAPISessionsNotFound The requested resource does not exist - -swagger:response detailApiSessionsNotFound -*/ -type DetailAPISessionsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailAPISessionsNotFound creates DetailAPISessionsNotFound with default headers values -func NewDetailAPISessionsNotFound() *DetailAPISessionsNotFound { - - return &DetailAPISessionsNotFound{} -} - -// WithPayload adds the payload to the detail Api sessions not found response -func (o *DetailAPISessionsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailAPISessionsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail Api sessions not found response -func (o *DetailAPISessionsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAPISessionsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/api_session/detail_api_sessions_urlbuilder.go b/rest_management_api_server/operations/api_session/detail_api_sessions_urlbuilder.go deleted file mode 100644 index 0ecb2d34b..000000000 --- a/rest_management_api_server/operations/api_session/detail_api_sessions_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailAPISessionsURL generates an URL for the detail API sessions operation -type DetailAPISessionsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailAPISessionsURL) WithBasePath(bp string) *DetailAPISessionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailAPISessionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailAPISessionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/api-sessions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailAPISessionsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailAPISessionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailAPISessionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailAPISessionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailAPISessionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailAPISessionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailAPISessionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/api_session/list_api_sessions.go b/rest_management_api_server/operations/api_session/list_api_sessions.go deleted file mode 100644 index 343ec4e39..000000000 --- a/rest_management_api_server/operations/api_session/list_api_sessions.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListAPISessionsHandlerFunc turns a function with the right signature into a list API sessions handler -type ListAPISessionsHandlerFunc func(ListAPISessionsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListAPISessionsHandlerFunc) Handle(params ListAPISessionsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListAPISessionsHandler interface for that can handle valid list API sessions params -type ListAPISessionsHandler interface { - Handle(ListAPISessionsParams, interface{}) middleware.Responder -} - -// NewListAPISessions creates a new http.Handler for the list API sessions operation -func NewListAPISessions(ctx *middleware.Context, handler ListAPISessionsHandler) *ListAPISessions { - return &ListAPISessions{Context: ctx, Handler: handler} -} - -/* ListAPISessions swagger:route GET /api-sessions API Session listApiSessions - -List active API sessions - -Returns a list of active API sessions. The resources can be sorted, filtered, and paginated. This endpoint -requries admin access. - - -*/ -type ListAPISessions struct { - Context *middleware.Context - Handler ListAPISessionsHandler -} - -func (o *ListAPISessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListAPISessionsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/api_session/list_api_sessions_parameters.go b/rest_management_api_server/operations/api_session/list_api_sessions_parameters.go deleted file mode 100644 index b97218574..000000000 --- a/rest_management_api_server/operations/api_session/list_api_sessions_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListAPISessionsParams creates a new ListAPISessionsParams object -// -// There are no default values defined in the spec. -func NewListAPISessionsParams() ListAPISessionsParams { - - return ListAPISessionsParams{} -} - -// ListAPISessionsParams contains all the bound params for the list API sessions operation -// typically these are obtained from a http.Request -// -// swagger:parameters listAPISessions -type ListAPISessionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListAPISessionsParams() beforehand. -func (o *ListAPISessionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListAPISessionsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListAPISessionsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListAPISessionsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/api_session/list_api_sessions_responses.go b/rest_management_api_server/operations/api_session/list_api_sessions_responses.go deleted file mode 100644 index 4f56563cb..000000000 --- a/rest_management_api_server/operations/api_session/list_api_sessions_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListAPISessionsOKCode is the HTTP code returned for type ListAPISessionsOK -const ListAPISessionsOKCode int = 200 - -/*ListAPISessionsOK A list of active API Sessions - -swagger:response listApiSessionsOK -*/ -type ListAPISessionsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListAPISessionsEnvelope `json:"body,omitempty"` -} - -// NewListAPISessionsOK creates ListAPISessionsOK with default headers values -func NewListAPISessionsOK() *ListAPISessionsOK { - - return &ListAPISessionsOK{} -} - -// WithPayload adds the payload to the list Api sessions o k response -func (o *ListAPISessionsOK) WithPayload(payload *rest_model.ListAPISessionsEnvelope) *ListAPISessionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list Api sessions o k response -func (o *ListAPISessionsOK) SetPayload(payload *rest_model.ListAPISessionsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAPISessionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListAPISessionsBadRequestCode is the HTTP code returned for type ListAPISessionsBadRequest -const ListAPISessionsBadRequestCode int = 400 - -/*ListAPISessionsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listApiSessionsBadRequest -*/ -type ListAPISessionsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListAPISessionsBadRequest creates ListAPISessionsBadRequest with default headers values -func NewListAPISessionsBadRequest() *ListAPISessionsBadRequest { - - return &ListAPISessionsBadRequest{} -} - -// WithPayload adds the payload to the list Api sessions bad request response -func (o *ListAPISessionsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAPISessionsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list Api sessions bad request response -func (o *ListAPISessionsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAPISessionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListAPISessionsUnauthorizedCode is the HTTP code returned for type ListAPISessionsUnauthorized -const ListAPISessionsUnauthorizedCode int = 401 - -/*ListAPISessionsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listApiSessionsUnauthorized -*/ -type ListAPISessionsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListAPISessionsUnauthorized creates ListAPISessionsUnauthorized with default headers values -func NewListAPISessionsUnauthorized() *ListAPISessionsUnauthorized { - - return &ListAPISessionsUnauthorized{} -} - -// WithPayload adds the payload to the list Api sessions unauthorized response -func (o *ListAPISessionsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAPISessionsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list Api sessions unauthorized response -func (o *ListAPISessionsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAPISessionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/api_session/list_api_sessions_urlbuilder.go b/rest_management_api_server/operations/api_session/list_api_sessions_urlbuilder.go deleted file mode 100644 index 0f7f268d9..000000000 --- a/rest_management_api_server/operations/api_session/list_api_sessions_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListAPISessionsURL generates an URL for the list API sessions operation -type ListAPISessionsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListAPISessionsURL) WithBasePath(bp string) *ListAPISessionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListAPISessionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListAPISessionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/api-sessions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListAPISessionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListAPISessionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListAPISessionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListAPISessionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListAPISessionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListAPISessionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/auth_policy/create_auth_policy.go b/rest_management_api_server/operations/auth_policy/create_auth_policy.go deleted file mode 100644 index 5c8f549ee..000000000 --- a/rest_management_api_server/operations/auth_policy/create_auth_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateAuthPolicyHandlerFunc turns a function with the right signature into a create auth policy handler -type CreateAuthPolicyHandlerFunc func(CreateAuthPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateAuthPolicyHandlerFunc) Handle(params CreateAuthPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateAuthPolicyHandler interface for that can handle valid create auth policy params -type CreateAuthPolicyHandler interface { - Handle(CreateAuthPolicyParams, interface{}) middleware.Responder -} - -// NewCreateAuthPolicy creates a new http.Handler for the create auth policy operation -func NewCreateAuthPolicy(ctx *middleware.Context, handler CreateAuthPolicyHandler) *CreateAuthPolicy { - return &CreateAuthPolicy{Context: ctx, Handler: handler} -} - -/* CreateAuthPolicy swagger:route POST /auth-policies Auth Policy createAuthPolicy - -Creates an Auth Policy - -Creates an Auth Policy. Requires admin access. - -*/ -type CreateAuthPolicy struct { - Context *middleware.Context - Handler CreateAuthPolicyHandler -} - -func (o *CreateAuthPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateAuthPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/auth_policy/create_auth_policy_parameters.go b/rest_management_api_server/operations/auth_policy/create_auth_policy_parameters.go deleted file mode 100644 index 10322dc70..000000000 --- a/rest_management_api_server/operations/auth_policy/create_auth_policy_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateAuthPolicyParams creates a new CreateAuthPolicyParams object -// -// There are no default values defined in the spec. -func NewCreateAuthPolicyParams() CreateAuthPolicyParams { - - return CreateAuthPolicyParams{} -} - -// CreateAuthPolicyParams contains all the bound params for the create auth policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters createAuthPolicy -type CreateAuthPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An Auth Policy to create - Required: true - In: body - */ - AuthPolicy *rest_model.AuthPolicyCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateAuthPolicyParams() beforehand. -func (o *CreateAuthPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthPolicyCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authPolicy", "body", "")) - } else { - res = append(res, errors.NewParseError("authPolicy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.AuthPolicy = &body - } - } - } else { - res = append(res, errors.Required("authPolicy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/auth_policy/create_auth_policy_responses.go b/rest_management_api_server/operations/auth_policy/create_auth_policy_responses.go deleted file mode 100644 index dd7af3b4c..000000000 --- a/rest_management_api_server/operations/auth_policy/create_auth_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateAuthPolicyCreatedCode is the HTTP code returned for type CreateAuthPolicyCreated -const CreateAuthPolicyCreatedCode int = 201 - -/*CreateAuthPolicyCreated The create request was successful and the resource has been added at the following location - -swagger:response createAuthPolicyCreated -*/ -type CreateAuthPolicyCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateAuthPolicyCreated creates CreateAuthPolicyCreated with default headers values -func NewCreateAuthPolicyCreated() *CreateAuthPolicyCreated { - - return &CreateAuthPolicyCreated{} -} - -// WithPayload adds the payload to the create auth policy created response -func (o *CreateAuthPolicyCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateAuthPolicyCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create auth policy created response -func (o *CreateAuthPolicyCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAuthPolicyCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateAuthPolicyBadRequestCode is the HTTP code returned for type CreateAuthPolicyBadRequest -const CreateAuthPolicyBadRequestCode int = 400 - -/*CreateAuthPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createAuthPolicyBadRequest -*/ -type CreateAuthPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateAuthPolicyBadRequest creates CreateAuthPolicyBadRequest with default headers values -func NewCreateAuthPolicyBadRequest() *CreateAuthPolicyBadRequest { - - return &CreateAuthPolicyBadRequest{} -} - -// WithPayload adds the payload to the create auth policy bad request response -func (o *CreateAuthPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateAuthPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create auth policy bad request response -func (o *CreateAuthPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAuthPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateAuthPolicyUnauthorizedCode is the HTTP code returned for type CreateAuthPolicyUnauthorized -const CreateAuthPolicyUnauthorizedCode int = 401 - -/*CreateAuthPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createAuthPolicyUnauthorized -*/ -type CreateAuthPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateAuthPolicyUnauthorized creates CreateAuthPolicyUnauthorized with default headers values -func NewCreateAuthPolicyUnauthorized() *CreateAuthPolicyUnauthorized { - - return &CreateAuthPolicyUnauthorized{} -} - -// WithPayload adds the payload to the create auth policy unauthorized response -func (o *CreateAuthPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateAuthPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create auth policy unauthorized response -func (o *CreateAuthPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAuthPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/auth_policy/create_auth_policy_urlbuilder.go b/rest_management_api_server/operations/auth_policy/create_auth_policy_urlbuilder.go deleted file mode 100644 index b4fb5fbcc..000000000 --- a/rest_management_api_server/operations/auth_policy/create_auth_policy_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateAuthPolicyURL generates an URL for the create auth policy operation -type CreateAuthPolicyURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateAuthPolicyURL) WithBasePath(bp string) *CreateAuthPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateAuthPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateAuthPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/auth-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateAuthPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateAuthPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateAuthPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateAuthPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateAuthPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateAuthPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/auth_policy/delete_auth_policy.go b/rest_management_api_server/operations/auth_policy/delete_auth_policy.go deleted file mode 100644 index f301d7423..000000000 --- a/rest_management_api_server/operations/auth_policy/delete_auth_policy.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteAuthPolicyHandlerFunc turns a function with the right signature into a delete auth policy handler -type DeleteAuthPolicyHandlerFunc func(DeleteAuthPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteAuthPolicyHandlerFunc) Handle(params DeleteAuthPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteAuthPolicyHandler interface for that can handle valid delete auth policy params -type DeleteAuthPolicyHandler interface { - Handle(DeleteAuthPolicyParams, interface{}) middleware.Responder -} - -// NewDeleteAuthPolicy creates a new http.Handler for the delete auth policy operation -func NewDeleteAuthPolicy(ctx *middleware.Context, handler DeleteAuthPolicyHandler) *DeleteAuthPolicy { - return &DeleteAuthPolicy{Context: ctx, Handler: handler} -} - -/* DeleteAuthPolicy swagger:route DELETE /auth-policies/{id} Auth Policy deleteAuthPolicy - -Delete an Auth Policy - -Delete an Auth Policy by id. Requires admin access. - - -*/ -type DeleteAuthPolicy struct { - Context *middleware.Context - Handler DeleteAuthPolicyHandler -} - -func (o *DeleteAuthPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteAuthPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/auth_policy/delete_auth_policy_parameters.go b/rest_management_api_server/operations/auth_policy/delete_auth_policy_parameters.go deleted file mode 100644 index b031a3b74..000000000 --- a/rest_management_api_server/operations/auth_policy/delete_auth_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteAuthPolicyParams creates a new DeleteAuthPolicyParams object -// -// There are no default values defined in the spec. -func NewDeleteAuthPolicyParams() DeleteAuthPolicyParams { - - return DeleteAuthPolicyParams{} -} - -// DeleteAuthPolicyParams contains all the bound params for the delete auth policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteAuthPolicy -type DeleteAuthPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteAuthPolicyParams() beforehand. -func (o *DeleteAuthPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteAuthPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/auth_policy/delete_auth_policy_responses.go b/rest_management_api_server/operations/auth_policy/delete_auth_policy_responses.go deleted file mode 100644 index d290630e3..000000000 --- a/rest_management_api_server/operations/auth_policy/delete_auth_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteAuthPolicyOKCode is the HTTP code returned for type DeleteAuthPolicyOK -const DeleteAuthPolicyOKCode int = 200 - -/*DeleteAuthPolicyOK The delete request was successful and the resource has been removed - -swagger:response deleteAuthPolicyOK -*/ -type DeleteAuthPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteAuthPolicyOK creates DeleteAuthPolicyOK with default headers values -func NewDeleteAuthPolicyOK() *DeleteAuthPolicyOK { - - return &DeleteAuthPolicyOK{} -} - -// WithPayload adds the payload to the delete auth policy o k response -func (o *DeleteAuthPolicyOK) WithPayload(payload *rest_model.Empty) *DeleteAuthPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete auth policy o k response -func (o *DeleteAuthPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAuthPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAuthPolicyBadRequestCode is the HTTP code returned for type DeleteAuthPolicyBadRequest -const DeleteAuthPolicyBadRequestCode int = 400 - -/*DeleteAuthPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteAuthPolicyBadRequest -*/ -type DeleteAuthPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteAuthPolicyBadRequest creates DeleteAuthPolicyBadRequest with default headers values -func NewDeleteAuthPolicyBadRequest() *DeleteAuthPolicyBadRequest { - - return &DeleteAuthPolicyBadRequest{} -} - -// WithPayload adds the payload to the delete auth policy bad request response -func (o *DeleteAuthPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteAuthPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete auth policy bad request response -func (o *DeleteAuthPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAuthPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAuthPolicyUnauthorizedCode is the HTTP code returned for type DeleteAuthPolicyUnauthorized -const DeleteAuthPolicyUnauthorizedCode int = 401 - -/*DeleteAuthPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteAuthPolicyUnauthorized -*/ -type DeleteAuthPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteAuthPolicyUnauthorized creates DeleteAuthPolicyUnauthorized with default headers values -func NewDeleteAuthPolicyUnauthorized() *DeleteAuthPolicyUnauthorized { - - return &DeleteAuthPolicyUnauthorized{} -} - -// WithPayload adds the payload to the delete auth policy unauthorized response -func (o *DeleteAuthPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteAuthPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete auth policy unauthorized response -func (o *DeleteAuthPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAuthPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/auth_policy/delete_auth_policy_urlbuilder.go b/rest_management_api_server/operations/auth_policy/delete_auth_policy_urlbuilder.go deleted file mode 100644 index 915f9b422..000000000 --- a/rest_management_api_server/operations/auth_policy/delete_auth_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteAuthPolicyURL generates an URL for the delete auth policy operation -type DeleteAuthPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAuthPolicyURL) WithBasePath(bp string) *DeleteAuthPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAuthPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteAuthPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/auth-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteAuthPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteAuthPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteAuthPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteAuthPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteAuthPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteAuthPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteAuthPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/auth_policy/detail_auth_policy.go b/rest_management_api_server/operations/auth_policy/detail_auth_policy.go deleted file mode 100644 index fa8016b02..000000000 --- a/rest_management_api_server/operations/auth_policy/detail_auth_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailAuthPolicyHandlerFunc turns a function with the right signature into a detail auth policy handler -type DetailAuthPolicyHandlerFunc func(DetailAuthPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailAuthPolicyHandlerFunc) Handle(params DetailAuthPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailAuthPolicyHandler interface for that can handle valid detail auth policy params -type DetailAuthPolicyHandler interface { - Handle(DetailAuthPolicyParams, interface{}) middleware.Responder -} - -// NewDetailAuthPolicy creates a new http.Handler for the detail auth policy operation -func NewDetailAuthPolicy(ctx *middleware.Context, handler DetailAuthPolicyHandler) *DetailAuthPolicy { - return &DetailAuthPolicy{Context: ctx, Handler: handler} -} - -/* DetailAuthPolicy swagger:route GET /auth-policies/{id} Auth Policy detailAuthPolicy - -Retrieves a single Auth Policy - -Retrieves a single Auth Policy by id. Requires admin access. - -*/ -type DetailAuthPolicy struct { - Context *middleware.Context - Handler DetailAuthPolicyHandler -} - -func (o *DetailAuthPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailAuthPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/auth_policy/detail_auth_policy_parameters.go b/rest_management_api_server/operations/auth_policy/detail_auth_policy_parameters.go deleted file mode 100644 index 67ebc96b4..000000000 --- a/rest_management_api_server/operations/auth_policy/detail_auth_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailAuthPolicyParams creates a new DetailAuthPolicyParams object -// -// There are no default values defined in the spec. -func NewDetailAuthPolicyParams() DetailAuthPolicyParams { - - return DetailAuthPolicyParams{} -} - -// DetailAuthPolicyParams contains all the bound params for the detail auth policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailAuthPolicy -type DetailAuthPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailAuthPolicyParams() beforehand. -func (o *DetailAuthPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailAuthPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/auth_policy/detail_auth_policy_responses.go b/rest_management_api_server/operations/auth_policy/detail_auth_policy_responses.go deleted file mode 100644 index 7642d7d72..000000000 --- a/rest_management_api_server/operations/auth_policy/detail_auth_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailAuthPolicyOKCode is the HTTP code returned for type DetailAuthPolicyOK -const DetailAuthPolicyOKCode int = 200 - -/*DetailAuthPolicyOK A singular Auth Policy resource - -swagger:response detailAuthPolicyOK -*/ -type DetailAuthPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailAuthPolicyEnvelope `json:"body,omitempty"` -} - -// NewDetailAuthPolicyOK creates DetailAuthPolicyOK with default headers values -func NewDetailAuthPolicyOK() *DetailAuthPolicyOK { - - return &DetailAuthPolicyOK{} -} - -// WithPayload adds the payload to the detail auth policy o k response -func (o *DetailAuthPolicyOK) WithPayload(payload *rest_model.DetailAuthPolicyEnvelope) *DetailAuthPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail auth policy o k response -func (o *DetailAuthPolicyOK) SetPayload(payload *rest_model.DetailAuthPolicyEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAuthPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailAuthPolicyUnauthorizedCode is the HTTP code returned for type DetailAuthPolicyUnauthorized -const DetailAuthPolicyUnauthorizedCode int = 401 - -/*DetailAuthPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailAuthPolicyUnauthorized -*/ -type DetailAuthPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailAuthPolicyUnauthorized creates DetailAuthPolicyUnauthorized with default headers values -func NewDetailAuthPolicyUnauthorized() *DetailAuthPolicyUnauthorized { - - return &DetailAuthPolicyUnauthorized{} -} - -// WithPayload adds the payload to the detail auth policy unauthorized response -func (o *DetailAuthPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailAuthPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail auth policy unauthorized response -func (o *DetailAuthPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAuthPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailAuthPolicyNotFoundCode is the HTTP code returned for type DetailAuthPolicyNotFound -const DetailAuthPolicyNotFoundCode int = 404 - -/*DetailAuthPolicyNotFound The requested resource does not exist - -swagger:response detailAuthPolicyNotFound -*/ -type DetailAuthPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailAuthPolicyNotFound creates DetailAuthPolicyNotFound with default headers values -func NewDetailAuthPolicyNotFound() *DetailAuthPolicyNotFound { - - return &DetailAuthPolicyNotFound{} -} - -// WithPayload adds the payload to the detail auth policy not found response -func (o *DetailAuthPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailAuthPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail auth policy not found response -func (o *DetailAuthPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAuthPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/auth_policy/detail_auth_policy_urlbuilder.go b/rest_management_api_server/operations/auth_policy/detail_auth_policy_urlbuilder.go deleted file mode 100644 index 90c530fea..000000000 --- a/rest_management_api_server/operations/auth_policy/detail_auth_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailAuthPolicyURL generates an URL for the detail auth policy operation -type DetailAuthPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailAuthPolicyURL) WithBasePath(bp string) *DetailAuthPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailAuthPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailAuthPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/auth-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailAuthPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailAuthPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailAuthPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailAuthPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailAuthPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailAuthPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailAuthPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/auth_policy/list_auth_policies.go b/rest_management_api_server/operations/auth_policy/list_auth_policies.go deleted file mode 100644 index 941647c41..000000000 --- a/rest_management_api_server/operations/auth_policy/list_auth_policies.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListAuthPoliciesHandlerFunc turns a function with the right signature into a list auth policies handler -type ListAuthPoliciesHandlerFunc func(ListAuthPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListAuthPoliciesHandlerFunc) Handle(params ListAuthPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListAuthPoliciesHandler interface for that can handle valid list auth policies params -type ListAuthPoliciesHandler interface { - Handle(ListAuthPoliciesParams, interface{}) middleware.Responder -} - -// NewListAuthPolicies creates a new http.Handler for the list auth policies operation -func NewListAuthPolicies(ctx *middleware.Context, handler ListAuthPoliciesHandler) *ListAuthPolicies { - return &ListAuthPolicies{Context: ctx, Handler: handler} -} - -/* ListAuthPolicies swagger:route GET /auth-policies Auth Policy listAuthPolicies - -List Auth Policies - -Retrieves a list of Auth Policies - -*/ -type ListAuthPolicies struct { - Context *middleware.Context - Handler ListAuthPoliciesHandler -} - -func (o *ListAuthPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListAuthPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/auth_policy/list_auth_policies_parameters.go b/rest_management_api_server/operations/auth_policy/list_auth_policies_parameters.go deleted file mode 100644 index 748929a7f..000000000 --- a/rest_management_api_server/operations/auth_policy/list_auth_policies_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListAuthPoliciesParams creates a new ListAuthPoliciesParams object -// -// There are no default values defined in the spec. -func NewListAuthPoliciesParams() ListAuthPoliciesParams { - - return ListAuthPoliciesParams{} -} - -// ListAuthPoliciesParams contains all the bound params for the list auth policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listAuthPolicies -type ListAuthPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListAuthPoliciesParams() beforehand. -func (o *ListAuthPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListAuthPoliciesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListAuthPoliciesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListAuthPoliciesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/auth_policy/list_auth_policies_responses.go b/rest_management_api_server/operations/auth_policy/list_auth_policies_responses.go deleted file mode 100644 index 190420a92..000000000 --- a/rest_management_api_server/operations/auth_policy/list_auth_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListAuthPoliciesOKCode is the HTTP code returned for type ListAuthPoliciesOK -const ListAuthPoliciesOKCode int = 200 - -/*ListAuthPoliciesOK A list of Auth Policies - -swagger:response listAuthPoliciesOK -*/ -type ListAuthPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListAuthPoliciesEnvelope `json:"body,omitempty"` -} - -// NewListAuthPoliciesOK creates ListAuthPoliciesOK with default headers values -func NewListAuthPoliciesOK() *ListAuthPoliciesOK { - - return &ListAuthPoliciesOK{} -} - -// WithPayload adds the payload to the list auth policies o k response -func (o *ListAuthPoliciesOK) WithPayload(payload *rest_model.ListAuthPoliciesEnvelope) *ListAuthPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list auth policies o k response -func (o *ListAuthPoliciesOK) SetPayload(payload *rest_model.ListAuthPoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAuthPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListAuthPoliciesBadRequestCode is the HTTP code returned for type ListAuthPoliciesBadRequest -const ListAuthPoliciesBadRequestCode int = 400 - -/*ListAuthPoliciesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listAuthPoliciesBadRequest -*/ -type ListAuthPoliciesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListAuthPoliciesBadRequest creates ListAuthPoliciesBadRequest with default headers values -func NewListAuthPoliciesBadRequest() *ListAuthPoliciesBadRequest { - - return &ListAuthPoliciesBadRequest{} -} - -// WithPayload adds the payload to the list auth policies bad request response -func (o *ListAuthPoliciesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAuthPoliciesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list auth policies bad request response -func (o *ListAuthPoliciesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAuthPoliciesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListAuthPoliciesUnauthorizedCode is the HTTP code returned for type ListAuthPoliciesUnauthorized -const ListAuthPoliciesUnauthorizedCode int = 401 - -/*ListAuthPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listAuthPoliciesUnauthorized -*/ -type ListAuthPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListAuthPoliciesUnauthorized creates ListAuthPoliciesUnauthorized with default headers values -func NewListAuthPoliciesUnauthorized() *ListAuthPoliciesUnauthorized { - - return &ListAuthPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list auth policies unauthorized response -func (o *ListAuthPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAuthPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list auth policies unauthorized response -func (o *ListAuthPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAuthPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/auth_policy/list_auth_policies_urlbuilder.go b/rest_management_api_server/operations/auth_policy/list_auth_policies_urlbuilder.go deleted file mode 100644 index ae6d6d97c..000000000 --- a/rest_management_api_server/operations/auth_policy/list_auth_policies_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListAuthPoliciesURL generates an URL for the list auth policies operation -type ListAuthPoliciesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListAuthPoliciesURL) WithBasePath(bp string) *ListAuthPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListAuthPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListAuthPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/auth-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListAuthPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListAuthPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListAuthPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListAuthPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListAuthPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListAuthPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/auth_policy/patch_auth_policy.go b/rest_management_api_server/operations/auth_policy/patch_auth_policy.go deleted file mode 100644 index 98f77ac4c..000000000 --- a/rest_management_api_server/operations/auth_policy/patch_auth_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchAuthPolicyHandlerFunc turns a function with the right signature into a patch auth policy handler -type PatchAuthPolicyHandlerFunc func(PatchAuthPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchAuthPolicyHandlerFunc) Handle(params PatchAuthPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchAuthPolicyHandler interface for that can handle valid patch auth policy params -type PatchAuthPolicyHandler interface { - Handle(PatchAuthPolicyParams, interface{}) middleware.Responder -} - -// NewPatchAuthPolicy creates a new http.Handler for the patch auth policy operation -func NewPatchAuthPolicy(ctx *middleware.Context, handler PatchAuthPolicyHandler) *PatchAuthPolicy { - return &PatchAuthPolicy{Context: ctx, Handler: handler} -} - -/* PatchAuthPolicy swagger:route PATCH /auth-policies/{id} Auth Policy patchAuthPolicy - -Update the supplied fields on an Auth Policy - -Update only the supplied fields on an Auth Policy by id. Requires admin access. - -*/ -type PatchAuthPolicy struct { - Context *middleware.Context - Handler PatchAuthPolicyHandler -} - -func (o *PatchAuthPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchAuthPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/auth_policy/patch_auth_policy_parameters.go b/rest_management_api_server/operations/auth_policy/patch_auth_policy_parameters.go deleted file mode 100644 index c10fe2cec..000000000 --- a/rest_management_api_server/operations/auth_policy/patch_auth_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchAuthPolicyParams creates a new PatchAuthPolicyParams object -// -// There are no default values defined in the spec. -func NewPatchAuthPolicyParams() PatchAuthPolicyParams { - - return PatchAuthPolicyParams{} -} - -// PatchAuthPolicyParams contains all the bound params for the patch auth policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchAuthPolicy -type PatchAuthPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An Auth Policy patch object - Required: true - In: body - */ - AuthPolicy *rest_model.AuthPolicyPatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchAuthPolicyParams() beforehand. -func (o *PatchAuthPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthPolicyPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authPolicy", "body", "")) - } else { - res = append(res, errors.NewParseError("authPolicy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.AuthPolicy = &body - } - } - } else { - res = append(res, errors.Required("authPolicy", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchAuthPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/auth_policy/patch_auth_policy_responses.go b/rest_management_api_server/operations/auth_policy/patch_auth_policy_responses.go deleted file mode 100644 index 85136707e..000000000 --- a/rest_management_api_server/operations/auth_policy/patch_auth_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchAuthPolicyOKCode is the HTTP code returned for type PatchAuthPolicyOK -const PatchAuthPolicyOKCode int = 200 - -/*PatchAuthPolicyOK The patch request was successful and the resource has been altered - -swagger:response patchAuthPolicyOK -*/ -type PatchAuthPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchAuthPolicyOK creates PatchAuthPolicyOK with default headers values -func NewPatchAuthPolicyOK() *PatchAuthPolicyOK { - - return &PatchAuthPolicyOK{} -} - -// WithPayload adds the payload to the patch auth policy o k response -func (o *PatchAuthPolicyOK) WithPayload(payload *rest_model.Empty) *PatchAuthPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch auth policy o k response -func (o *PatchAuthPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchAuthPolicyBadRequestCode is the HTTP code returned for type PatchAuthPolicyBadRequest -const PatchAuthPolicyBadRequestCode int = 400 - -/*PatchAuthPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchAuthPolicyBadRequest -*/ -type PatchAuthPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchAuthPolicyBadRequest creates PatchAuthPolicyBadRequest with default headers values -func NewPatchAuthPolicyBadRequest() *PatchAuthPolicyBadRequest { - - return &PatchAuthPolicyBadRequest{} -} - -// WithPayload adds the payload to the patch auth policy bad request response -func (o *PatchAuthPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchAuthPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch auth policy bad request response -func (o *PatchAuthPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchAuthPolicyUnauthorizedCode is the HTTP code returned for type PatchAuthPolicyUnauthorized -const PatchAuthPolicyUnauthorizedCode int = 401 - -/*PatchAuthPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchAuthPolicyUnauthorized -*/ -type PatchAuthPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchAuthPolicyUnauthorized creates PatchAuthPolicyUnauthorized with default headers values -func NewPatchAuthPolicyUnauthorized() *PatchAuthPolicyUnauthorized { - - return &PatchAuthPolicyUnauthorized{} -} - -// WithPayload adds the payload to the patch auth policy unauthorized response -func (o *PatchAuthPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchAuthPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch auth policy unauthorized response -func (o *PatchAuthPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchAuthPolicyNotFoundCode is the HTTP code returned for type PatchAuthPolicyNotFound -const PatchAuthPolicyNotFoundCode int = 404 - -/*PatchAuthPolicyNotFound The requested resource does not exist - -swagger:response patchAuthPolicyNotFound -*/ -type PatchAuthPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchAuthPolicyNotFound creates PatchAuthPolicyNotFound with default headers values -func NewPatchAuthPolicyNotFound() *PatchAuthPolicyNotFound { - - return &PatchAuthPolicyNotFound{} -} - -// WithPayload adds the payload to the patch auth policy not found response -func (o *PatchAuthPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchAuthPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch auth policy not found response -func (o *PatchAuthPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/auth_policy/patch_auth_policy_urlbuilder.go b/rest_management_api_server/operations/auth_policy/patch_auth_policy_urlbuilder.go deleted file mode 100644 index 68d0083d5..000000000 --- a/rest_management_api_server/operations/auth_policy/patch_auth_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchAuthPolicyURL generates an URL for the patch auth policy operation -type PatchAuthPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchAuthPolicyURL) WithBasePath(bp string) *PatchAuthPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchAuthPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchAuthPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/auth-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchAuthPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchAuthPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchAuthPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchAuthPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchAuthPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchAuthPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchAuthPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/auth_policy/update_auth_policy.go b/rest_management_api_server/operations/auth_policy/update_auth_policy.go deleted file mode 100644 index 1fcd2f97e..000000000 --- a/rest_management_api_server/operations/auth_policy/update_auth_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateAuthPolicyHandlerFunc turns a function with the right signature into a update auth policy handler -type UpdateAuthPolicyHandlerFunc func(UpdateAuthPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateAuthPolicyHandlerFunc) Handle(params UpdateAuthPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateAuthPolicyHandler interface for that can handle valid update auth policy params -type UpdateAuthPolicyHandler interface { - Handle(UpdateAuthPolicyParams, interface{}) middleware.Responder -} - -// NewUpdateAuthPolicy creates a new http.Handler for the update auth policy operation -func NewUpdateAuthPolicy(ctx *middleware.Context, handler UpdateAuthPolicyHandler) *UpdateAuthPolicy { - return &UpdateAuthPolicy{Context: ctx, Handler: handler} -} - -/* UpdateAuthPolicy swagger:route PUT /auth-policies/{id} Auth Policy updateAuthPolicy - -Update all fields on an Auth Policy - -Update all fields on an Auth Policy by id. Requires admin access. - -*/ -type UpdateAuthPolicy struct { - Context *middleware.Context - Handler UpdateAuthPolicyHandler -} - -func (o *UpdateAuthPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateAuthPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/auth_policy/update_auth_policy_parameters.go b/rest_management_api_server/operations/auth_policy/update_auth_policy_parameters.go deleted file mode 100644 index aa18c8c0c..000000000 --- a/rest_management_api_server/operations/auth_policy/update_auth_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateAuthPolicyParams creates a new UpdateAuthPolicyParams object -// -// There are no default values defined in the spec. -func NewUpdateAuthPolicyParams() UpdateAuthPolicyParams { - - return UpdateAuthPolicyParams{} -} - -// UpdateAuthPolicyParams contains all the bound params for the update auth policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateAuthPolicy -type UpdateAuthPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An Auth Policy update object - Required: true - In: body - */ - AuthPolicy *rest_model.AuthPolicyUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateAuthPolicyParams() beforehand. -func (o *UpdateAuthPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthPolicyUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authPolicy", "body", "")) - } else { - res = append(res, errors.NewParseError("authPolicy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.AuthPolicy = &body - } - } - } else { - res = append(res, errors.Required("authPolicy", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateAuthPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/auth_policy/update_auth_policy_responses.go b/rest_management_api_server/operations/auth_policy/update_auth_policy_responses.go deleted file mode 100644 index 2ef1975ba..000000000 --- a/rest_management_api_server/operations/auth_policy/update_auth_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateAuthPolicyOKCode is the HTTP code returned for type UpdateAuthPolicyOK -const UpdateAuthPolicyOKCode int = 200 - -/*UpdateAuthPolicyOK The update request was successful and the resource has been altered - -swagger:response updateAuthPolicyOK -*/ -type UpdateAuthPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateAuthPolicyOK creates UpdateAuthPolicyOK with default headers values -func NewUpdateAuthPolicyOK() *UpdateAuthPolicyOK { - - return &UpdateAuthPolicyOK{} -} - -// WithPayload adds the payload to the update auth policy o k response -func (o *UpdateAuthPolicyOK) WithPayload(payload *rest_model.Empty) *UpdateAuthPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update auth policy o k response -func (o *UpdateAuthPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAuthPolicyBadRequestCode is the HTTP code returned for type UpdateAuthPolicyBadRequest -const UpdateAuthPolicyBadRequestCode int = 400 - -/*UpdateAuthPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateAuthPolicyBadRequest -*/ -type UpdateAuthPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateAuthPolicyBadRequest creates UpdateAuthPolicyBadRequest with default headers values -func NewUpdateAuthPolicyBadRequest() *UpdateAuthPolicyBadRequest { - - return &UpdateAuthPolicyBadRequest{} -} - -// WithPayload adds the payload to the update auth policy bad request response -func (o *UpdateAuthPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateAuthPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update auth policy bad request response -func (o *UpdateAuthPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAuthPolicyUnauthorizedCode is the HTTP code returned for type UpdateAuthPolicyUnauthorized -const UpdateAuthPolicyUnauthorizedCode int = 401 - -/*UpdateAuthPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateAuthPolicyUnauthorized -*/ -type UpdateAuthPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateAuthPolicyUnauthorized creates UpdateAuthPolicyUnauthorized with default headers values -func NewUpdateAuthPolicyUnauthorized() *UpdateAuthPolicyUnauthorized { - - return &UpdateAuthPolicyUnauthorized{} -} - -// WithPayload adds the payload to the update auth policy unauthorized response -func (o *UpdateAuthPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateAuthPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update auth policy unauthorized response -func (o *UpdateAuthPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAuthPolicyNotFoundCode is the HTTP code returned for type UpdateAuthPolicyNotFound -const UpdateAuthPolicyNotFoundCode int = 404 - -/*UpdateAuthPolicyNotFound The requested resource does not exist - -swagger:response updateAuthPolicyNotFound -*/ -type UpdateAuthPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateAuthPolicyNotFound creates UpdateAuthPolicyNotFound with default headers values -func NewUpdateAuthPolicyNotFound() *UpdateAuthPolicyNotFound { - - return &UpdateAuthPolicyNotFound{} -} - -// WithPayload adds the payload to the update auth policy not found response -func (o *UpdateAuthPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateAuthPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update auth policy not found response -func (o *UpdateAuthPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/auth_policy/update_auth_policy_urlbuilder.go b/rest_management_api_server/operations/auth_policy/update_auth_policy_urlbuilder.go deleted file mode 100644 index e26bd9c2e..000000000 --- a/rest_management_api_server/operations/auth_policy/update_auth_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package auth_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateAuthPolicyURL generates an URL for the update auth policy operation -type UpdateAuthPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAuthPolicyURL) WithBasePath(bp string) *UpdateAuthPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAuthPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateAuthPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/auth-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateAuthPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateAuthPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateAuthPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateAuthPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateAuthPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateAuthPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateAuthPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authentication/authenticate.go b/rest_management_api_server/operations/authentication/authenticate.go deleted file mode 100644 index b70656d3a..000000000 --- a/rest_management_api_server/operations/authentication/authenticate.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AuthenticateHandlerFunc turns a function with the right signature into a authenticate handler -type AuthenticateHandlerFunc func(AuthenticateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn AuthenticateHandlerFunc) Handle(params AuthenticateParams) middleware.Responder { - return fn(params) -} - -// AuthenticateHandler interface for that can handle valid authenticate params -type AuthenticateHandler interface { - Handle(AuthenticateParams) middleware.Responder -} - -// NewAuthenticate creates a new http.Handler for the authenticate operation -func NewAuthenticate(ctx *middleware.Context, handler AuthenticateHandler) *Authenticate { - return &Authenticate{Context: ctx, Handler: handler} -} - -/* Authenticate swagger:route POST /authenticate Authentication authenticate - -Authenticate via a method supplied via a query string parameter - -Allows authentication Methods include "password" and "cert" - - -*/ -type Authenticate struct { - Context *middleware.Context - Handler AuthenticateHandler -} - -func (o *Authenticate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAuthenticateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authentication/authenticate_mfa.go b/rest_management_api_server/operations/authentication/authenticate_mfa.go deleted file mode 100644 index eb0b9df71..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_mfa.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AuthenticateMfaHandlerFunc turns a function with the right signature into a authenticate mfa handler -type AuthenticateMfaHandlerFunc func(AuthenticateMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn AuthenticateMfaHandlerFunc) Handle(params AuthenticateMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// AuthenticateMfaHandler interface for that can handle valid authenticate mfa params -type AuthenticateMfaHandler interface { - Handle(AuthenticateMfaParams, interface{}) middleware.Responder -} - -// NewAuthenticateMfa creates a new http.Handler for the authenticate mfa operation -func NewAuthenticateMfa(ctx *middleware.Context, handler AuthenticateMfaHandler) *AuthenticateMfa { - return &AuthenticateMfa{Context: ctx, Handler: handler} -} - -/* AuthenticateMfa swagger:route POST /authenticate/mfa Authentication MFA authenticateMfa - -Complete MFA authentication - -Completes MFA authentication by submitting a MFA time based one time token or backup code. - -*/ -type AuthenticateMfa struct { - Context *middleware.Context - Handler AuthenticateMfaHandler -} - -func (o *AuthenticateMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAuthenticateMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authentication/authenticate_mfa_parameters.go b/rest_management_api_server/operations/authentication/authenticate_mfa_parameters.go deleted file mode 100644 index 42573b8a5..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_mfa_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateMfaParams creates a new AuthenticateMfaParams object -// -// There are no default values defined in the spec. -func NewAuthenticateMfaParams() AuthenticateMfaParams { - - return AuthenticateMfaParams{} -} - -// AuthenticateMfaParams contains all the bound params for the authenticate mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters authenticateMfa -type AuthenticateMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An MFA validation request - Required: true - In: body - */ - MfaAuth *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAuthenticateMfaParams() beforehand. -func (o *AuthenticateMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("mfaAuth", "body", "")) - } else { - res = append(res, errors.NewParseError("mfaAuth", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaAuth = &body - } - } - } else { - res = append(res, errors.Required("mfaAuth", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/authentication/authenticate_mfa_responses.go b/rest_management_api_server/operations/authentication/authenticate_mfa_responses.go deleted file mode 100644 index 4c793e357..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_mfa_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateMfaOKCode is the HTTP code returned for type AuthenticateMfaOK -const AuthenticateMfaOKCode int = 200 - -/*AuthenticateMfaOK Base empty response - -swagger:response authenticateMfaOK -*/ -type AuthenticateMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewAuthenticateMfaOK creates AuthenticateMfaOK with default headers values -func NewAuthenticateMfaOK() *AuthenticateMfaOK { - - return &AuthenticateMfaOK{} -} - -// WithPayload adds the payload to the authenticate mfa o k response -func (o *AuthenticateMfaOK) WithPayload(payload *rest_model.Empty) *AuthenticateMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate mfa o k response -func (o *AuthenticateMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AuthenticateMfaUnauthorizedCode is the HTTP code returned for type AuthenticateMfaUnauthorized -const AuthenticateMfaUnauthorizedCode int = 401 - -/*AuthenticateMfaUnauthorized Base empty response - -swagger:response authenticateMfaUnauthorized -*/ -type AuthenticateMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewAuthenticateMfaUnauthorized creates AuthenticateMfaUnauthorized with default headers values -func NewAuthenticateMfaUnauthorized() *AuthenticateMfaUnauthorized { - - return &AuthenticateMfaUnauthorized{} -} - -// WithPayload adds the payload to the authenticate mfa unauthorized response -func (o *AuthenticateMfaUnauthorized) WithPayload(payload *rest_model.Empty) *AuthenticateMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate mfa unauthorized response -func (o *AuthenticateMfaUnauthorized) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authentication/authenticate_mfa_urlbuilder.go b/rest_management_api_server/operations/authentication/authenticate_mfa_urlbuilder.go deleted file mode 100644 index ef8011047..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// AuthenticateMfaURL generates an URL for the authenticate mfa operation -type AuthenticateMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateMfaURL) WithBasePath(bp string) *AuthenticateMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AuthenticateMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticate/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AuthenticateMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AuthenticateMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AuthenticateMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AuthenticateMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AuthenticateMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AuthenticateMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authentication/authenticate_parameters.go b/rest_management_api_server/operations/authentication/authenticate_parameters.go deleted file mode 100644 index 65d3ccecd..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewAuthenticateParams creates a new AuthenticateParams object -// -// There are no default values defined in the spec. -func NewAuthenticateParams() AuthenticateParams { - - return AuthenticateParams{} -} - -// AuthenticateParams contains all the bound params for the authenticate operation -// typically these are obtained from a http.Request -// -// swagger:parameters authenticate -type AuthenticateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Auth *rest_model.Authenticate - /* - Required: true - In: query - */ - Method string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAuthenticateParams() beforehand. -func (o *AuthenticateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.Authenticate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("auth", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Auth = &body - } - } - } - - qMethod, qhkMethod, _ := qs.GetOK("method") - if err := o.bindMethod(qMethod, qhkMethod, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMethod binds and validates parameter Method from query. -func (o *AuthenticateParams) bindMethod(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("method", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("method", "query", raw); err != nil { - return err - } - o.Method = raw - - if err := o.validateMethod(formats); err != nil { - return err - } - - return nil -} - -// validateMethod carries on validations for parameter Method -func (o *AuthenticateParams) validateMethod(formats strfmt.Registry) error { - - if err := validate.EnumCase("method", "query", o.Method, []interface{}{"password", "cert", "ext-jwt"}, true); err != nil { - return err - } - - return nil -} diff --git a/rest_management_api_server/operations/authentication/authenticate_responses.go b/rest_management_api_server/operations/authentication/authenticate_responses.go deleted file mode 100644 index b9b0c2478..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// AuthenticateOKCode is the HTTP code returned for type AuthenticateOK -const AuthenticateOKCode int = 200 - -/*AuthenticateOK The API session associated with the session used to issue the request - -swagger:response authenticateOK -*/ -type AuthenticateOK struct { - - /* - In: Body - */ - Payload *rest_model.CurrentAPISessionDetailEnvelope `json:"body,omitempty"` -} - -// NewAuthenticateOK creates AuthenticateOK with default headers values -func NewAuthenticateOK() *AuthenticateOK { - - return &AuthenticateOK{} -} - -// WithPayload adds the payload to the authenticate o k response -func (o *AuthenticateOK) WithPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) *AuthenticateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate o k response -func (o *AuthenticateOK) SetPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AuthenticateBadRequestCode is the HTTP code returned for type AuthenticateBadRequest -const AuthenticateBadRequestCode int = 400 - -/*AuthenticateBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response authenticateBadRequest -*/ -type AuthenticateBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAuthenticateBadRequest creates AuthenticateBadRequest with default headers values -func NewAuthenticateBadRequest() *AuthenticateBadRequest { - - return &AuthenticateBadRequest{} -} - -// WithPayload adds the payload to the authenticate bad request response -func (o *AuthenticateBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate bad request response -func (o *AuthenticateBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AuthenticateForbiddenCode is the HTTP code returned for type AuthenticateForbidden -const AuthenticateForbiddenCode int = 403 - -/*AuthenticateForbidden The authentication request could not be processed as the credentials are invalid - -swagger:response authenticateForbidden -*/ -type AuthenticateForbidden struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAuthenticateForbidden creates AuthenticateForbidden with default headers values -func NewAuthenticateForbidden() *AuthenticateForbidden { - - return &AuthenticateForbidden{} -} - -// WithPayload adds the payload to the authenticate forbidden response -func (o *AuthenticateForbidden) WithPayload(payload *rest_model.APIErrorEnvelope) *AuthenticateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the authenticate forbidden response -func (o *AuthenticateForbidden) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AuthenticateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authentication/authenticate_urlbuilder.go b/rest_management_api_server/operations/authentication/authenticate_urlbuilder.go deleted file mode 100644 index 0f55654d5..000000000 --- a/rest_management_api_server/operations/authentication/authenticate_urlbuilder.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authentication - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// AuthenticateURL generates an URL for the authenticate operation -type AuthenticateURL struct { - Method string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateURL) WithBasePath(bp string) *AuthenticateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AuthenticateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AuthenticateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticate" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - methodQ := o.Method - if methodQ != "" { - qs.Set("method", methodQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AuthenticateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AuthenticateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AuthenticateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AuthenticateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AuthenticateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AuthenticateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/create_authenticator.go b/rest_management_api_server/operations/authenticator/create_authenticator.go deleted file mode 100644 index f3ac549cd..000000000 --- a/rest_management_api_server/operations/authenticator/create_authenticator.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateAuthenticatorHandlerFunc turns a function with the right signature into a create authenticator handler -type CreateAuthenticatorHandlerFunc func(CreateAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateAuthenticatorHandlerFunc) Handle(params CreateAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateAuthenticatorHandler interface for that can handle valid create authenticator params -type CreateAuthenticatorHandler interface { - Handle(CreateAuthenticatorParams, interface{}) middleware.Responder -} - -// NewCreateAuthenticator creates a new http.Handler for the create authenticator operation -func NewCreateAuthenticator(ctx *middleware.Context, handler CreateAuthenticatorHandler) *CreateAuthenticator { - return &CreateAuthenticator{Context: ctx, Handler: handler} -} - -/* CreateAuthenticator swagger:route POST /authenticators Authenticator createAuthenticator - -Creates an authenticator - -Creates an authenticator for a specific identity. Requires admin access. - - -*/ -type CreateAuthenticator struct { - Context *middleware.Context - Handler CreateAuthenticatorHandler -} - -func (o *CreateAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/create_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/create_authenticator_parameters.go deleted file mode 100644 index e4a37da10..000000000 --- a/rest_management_api_server/operations/authenticator/create_authenticator_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateAuthenticatorParams creates a new CreateAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewCreateAuthenticatorParams() CreateAuthenticatorParams { - - return CreateAuthenticatorParams{} -} - -// CreateAuthenticatorParams contains all the bound params for the create authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters createAuthenticator -type CreateAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A Authenticator create object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateAuthenticatorParams() beforehand. -func (o *CreateAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/authenticator/create_authenticator_responses.go b/rest_management_api_server/operations/authenticator/create_authenticator_responses.go deleted file mode 100644 index 175217683..000000000 --- a/rest_management_api_server/operations/authenticator/create_authenticator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateAuthenticatorCreatedCode is the HTTP code returned for type CreateAuthenticatorCreated -const CreateAuthenticatorCreatedCode int = 201 - -/*CreateAuthenticatorCreated The create was successful - -swagger:response createAuthenticatorCreated -*/ -type CreateAuthenticatorCreated struct { - - /* - In: Body - */ - Payload *rest_model.AuthenticatorCreate `json:"body,omitempty"` -} - -// NewCreateAuthenticatorCreated creates CreateAuthenticatorCreated with default headers values -func NewCreateAuthenticatorCreated() *CreateAuthenticatorCreated { - - return &CreateAuthenticatorCreated{} -} - -// WithPayload adds the payload to the create authenticator created response -func (o *CreateAuthenticatorCreated) WithPayload(payload *rest_model.AuthenticatorCreate) *CreateAuthenticatorCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create authenticator created response -func (o *CreateAuthenticatorCreated) SetPayload(payload *rest_model.AuthenticatorCreate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAuthenticatorCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateAuthenticatorBadRequestCode is the HTTP code returned for type CreateAuthenticatorBadRequest -const CreateAuthenticatorBadRequestCode int = 400 - -/*CreateAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createAuthenticatorBadRequest -*/ -type CreateAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateAuthenticatorBadRequest creates CreateAuthenticatorBadRequest with default headers values -func NewCreateAuthenticatorBadRequest() *CreateAuthenticatorBadRequest { - - return &CreateAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the create authenticator bad request response -func (o *CreateAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create authenticator bad request response -func (o *CreateAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateAuthenticatorUnauthorizedCode is the HTTP code returned for type CreateAuthenticatorUnauthorized -const CreateAuthenticatorUnauthorizedCode int = 401 - -/*CreateAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createAuthenticatorUnauthorized -*/ -type CreateAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateAuthenticatorUnauthorized creates CreateAuthenticatorUnauthorized with default headers values -func NewCreateAuthenticatorUnauthorized() *CreateAuthenticatorUnauthorized { - - return &CreateAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the create authenticator unauthorized response -func (o *CreateAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create authenticator unauthorized response -func (o *CreateAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/create_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/create_authenticator_urlbuilder.go deleted file mode 100644 index 16d16ac7a..000000000 --- a/rest_management_api_server/operations/authenticator/create_authenticator_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateAuthenticatorURL generates an URL for the create authenticator operation -type CreateAuthenticatorURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateAuthenticatorURL) WithBasePath(bp string) *CreateAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/delete_authenticator.go b/rest_management_api_server/operations/authenticator/delete_authenticator.go deleted file mode 100644 index a37bc8101..000000000 --- a/rest_management_api_server/operations/authenticator/delete_authenticator.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteAuthenticatorHandlerFunc turns a function with the right signature into a delete authenticator handler -type DeleteAuthenticatorHandlerFunc func(DeleteAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteAuthenticatorHandlerFunc) Handle(params DeleteAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteAuthenticatorHandler interface for that can handle valid delete authenticator params -type DeleteAuthenticatorHandler interface { - Handle(DeleteAuthenticatorParams, interface{}) middleware.Responder -} - -// NewDeleteAuthenticator creates a new http.Handler for the delete authenticator operation -func NewDeleteAuthenticator(ctx *middleware.Context, handler DeleteAuthenticatorHandler) *DeleteAuthenticator { - return &DeleteAuthenticator{Context: ctx, Handler: handler} -} - -/* DeleteAuthenticator swagger:route DELETE /authenticators/{id} Authenticator deleteAuthenticator - -Delete an Authenticator - -Delete an authenticator by id. Deleting all authenticators for an identity will make it impossible to log in. -Requires admin access. - - -*/ -type DeleteAuthenticator struct { - Context *middleware.Context - Handler DeleteAuthenticatorHandler -} - -func (o *DeleteAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/delete_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/delete_authenticator_parameters.go deleted file mode 100644 index 14a8feaa0..000000000 --- a/rest_management_api_server/operations/authenticator/delete_authenticator_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteAuthenticatorParams creates a new DeleteAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewDeleteAuthenticatorParams() DeleteAuthenticatorParams { - - return DeleteAuthenticatorParams{} -} - -// DeleteAuthenticatorParams contains all the bound params for the delete authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteAuthenticator -type DeleteAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteAuthenticatorParams() beforehand. -func (o *DeleteAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/authenticator/delete_authenticator_responses.go b/rest_management_api_server/operations/authenticator/delete_authenticator_responses.go deleted file mode 100644 index b0d15e0b8..000000000 --- a/rest_management_api_server/operations/authenticator/delete_authenticator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteAuthenticatorOKCode is the HTTP code returned for type DeleteAuthenticatorOK -const DeleteAuthenticatorOKCode int = 200 - -/*DeleteAuthenticatorOK The delete request was successful and the resource has been removed - -swagger:response deleteAuthenticatorOK -*/ -type DeleteAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteAuthenticatorOK creates DeleteAuthenticatorOK with default headers values -func NewDeleteAuthenticatorOK() *DeleteAuthenticatorOK { - - return &DeleteAuthenticatorOK{} -} - -// WithPayload adds the payload to the delete authenticator o k response -func (o *DeleteAuthenticatorOK) WithPayload(payload *rest_model.Empty) *DeleteAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete authenticator o k response -func (o *DeleteAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAuthenticatorBadRequestCode is the HTTP code returned for type DeleteAuthenticatorBadRequest -const DeleteAuthenticatorBadRequestCode int = 400 - -/*DeleteAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteAuthenticatorBadRequest -*/ -type DeleteAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteAuthenticatorBadRequest creates DeleteAuthenticatorBadRequest with default headers values -func NewDeleteAuthenticatorBadRequest() *DeleteAuthenticatorBadRequest { - - return &DeleteAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the delete authenticator bad request response -func (o *DeleteAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete authenticator bad request response -func (o *DeleteAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAuthenticatorUnauthorizedCode is the HTTP code returned for type DeleteAuthenticatorUnauthorized -const DeleteAuthenticatorUnauthorizedCode int = 401 - -/*DeleteAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteAuthenticatorUnauthorized -*/ -type DeleteAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteAuthenticatorUnauthorized creates DeleteAuthenticatorUnauthorized with default headers values -func NewDeleteAuthenticatorUnauthorized() *DeleteAuthenticatorUnauthorized { - - return &DeleteAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the delete authenticator unauthorized response -func (o *DeleteAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete authenticator unauthorized response -func (o *DeleteAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/delete_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/delete_authenticator_urlbuilder.go deleted file mode 100644 index ffc3e98f2..000000000 --- a/rest_management_api_server/operations/authenticator/delete_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteAuthenticatorURL generates an URL for the delete authenticator operation -type DeleteAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAuthenticatorURL) WithBasePath(bp string) *DeleteAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/detail_authenticator.go b/rest_management_api_server/operations/authenticator/detail_authenticator.go deleted file mode 100644 index 4eaefc929..000000000 --- a/rest_management_api_server/operations/authenticator/detail_authenticator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailAuthenticatorHandlerFunc turns a function with the right signature into a detail authenticator handler -type DetailAuthenticatorHandlerFunc func(DetailAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailAuthenticatorHandlerFunc) Handle(params DetailAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailAuthenticatorHandler interface for that can handle valid detail authenticator params -type DetailAuthenticatorHandler interface { - Handle(DetailAuthenticatorParams, interface{}) middleware.Responder -} - -// NewDetailAuthenticator creates a new http.Handler for the detail authenticator operation -func NewDetailAuthenticator(ctx *middleware.Context, handler DetailAuthenticatorHandler) *DetailAuthenticator { - return &DetailAuthenticator{Context: ctx, Handler: handler} -} - -/* DetailAuthenticator swagger:route GET /authenticators/{id} Authenticator detailAuthenticator - -Retrieves a single authenticator - -Retrieves a single authenticator by id. Requires admin access. - -*/ -type DetailAuthenticator struct { - Context *middleware.Context - Handler DetailAuthenticatorHandler -} - -func (o *DetailAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/detail_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/detail_authenticator_parameters.go deleted file mode 100644 index 58881b4b9..000000000 --- a/rest_management_api_server/operations/authenticator/detail_authenticator_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailAuthenticatorParams creates a new DetailAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewDetailAuthenticatorParams() DetailAuthenticatorParams { - - return DetailAuthenticatorParams{} -} - -// DetailAuthenticatorParams contains all the bound params for the detail authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailAuthenticator -type DetailAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailAuthenticatorParams() beforehand. -func (o *DetailAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/authenticator/detail_authenticator_responses.go b/rest_management_api_server/operations/authenticator/detail_authenticator_responses.go deleted file mode 100644 index d7a6a74ec..000000000 --- a/rest_management_api_server/operations/authenticator/detail_authenticator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailAuthenticatorOKCode is the HTTP code returned for type DetailAuthenticatorOK -const DetailAuthenticatorOKCode int = 200 - -/*DetailAuthenticatorOK A singular authenticator resource - -swagger:response detailAuthenticatorOK -*/ -type DetailAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailAuthenticatorEnvelope `json:"body,omitempty"` -} - -// NewDetailAuthenticatorOK creates DetailAuthenticatorOK with default headers values -func NewDetailAuthenticatorOK() *DetailAuthenticatorOK { - - return &DetailAuthenticatorOK{} -} - -// WithPayload adds the payload to the detail authenticator o k response -func (o *DetailAuthenticatorOK) WithPayload(payload *rest_model.DetailAuthenticatorEnvelope) *DetailAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail authenticator o k response -func (o *DetailAuthenticatorOK) SetPayload(payload *rest_model.DetailAuthenticatorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailAuthenticatorUnauthorizedCode is the HTTP code returned for type DetailAuthenticatorUnauthorized -const DetailAuthenticatorUnauthorizedCode int = 401 - -/*DetailAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailAuthenticatorUnauthorized -*/ -type DetailAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailAuthenticatorUnauthorized creates DetailAuthenticatorUnauthorized with default headers values -func NewDetailAuthenticatorUnauthorized() *DetailAuthenticatorUnauthorized { - - return &DetailAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the detail authenticator unauthorized response -func (o *DetailAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail authenticator unauthorized response -func (o *DetailAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailAuthenticatorNotFoundCode is the HTTP code returned for type DetailAuthenticatorNotFound -const DetailAuthenticatorNotFoundCode int = 404 - -/*DetailAuthenticatorNotFound The requested resource does not exist - -swagger:response detailAuthenticatorNotFound -*/ -type DetailAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailAuthenticatorNotFound creates DetailAuthenticatorNotFound with default headers values -func NewDetailAuthenticatorNotFound() *DetailAuthenticatorNotFound { - - return &DetailAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the detail authenticator not found response -func (o *DetailAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail authenticator not found response -func (o *DetailAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/detail_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/detail_authenticator_urlbuilder.go deleted file mode 100644 index 91cc5afe3..000000000 --- a/rest_management_api_server/operations/authenticator/detail_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailAuthenticatorURL generates an URL for the detail authenticator operation -type DetailAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailAuthenticatorURL) WithBasePath(bp string) *DetailAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/list_authenticators.go b/rest_management_api_server/operations/authenticator/list_authenticators.go deleted file mode 100644 index 1804237d9..000000000 --- a/rest_management_api_server/operations/authenticator/list_authenticators.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListAuthenticatorsHandlerFunc turns a function with the right signature into a list authenticators handler -type ListAuthenticatorsHandlerFunc func(ListAuthenticatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListAuthenticatorsHandlerFunc) Handle(params ListAuthenticatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListAuthenticatorsHandler interface for that can handle valid list authenticators params -type ListAuthenticatorsHandler interface { - Handle(ListAuthenticatorsParams, interface{}) middleware.Responder -} - -// NewListAuthenticators creates a new http.Handler for the list authenticators operation -func NewListAuthenticators(ctx *middleware.Context, handler ListAuthenticatorsHandler) *ListAuthenticators { - return &ListAuthenticators{Context: ctx, Handler: handler} -} - -/* ListAuthenticators swagger:route GET /authenticators Authenticator listAuthenticators - -List authenticators - -Returns a list of authenticators associated to identities. The resources can be sorted, filtered, and paginated. -This endpoint requires admin access. - - -*/ -type ListAuthenticators struct { - Context *middleware.Context - Handler ListAuthenticatorsHandler -} - -func (o *ListAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListAuthenticatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/list_authenticators_parameters.go b/rest_management_api_server/operations/authenticator/list_authenticators_parameters.go deleted file mode 100644 index 7c6859d54..000000000 --- a/rest_management_api_server/operations/authenticator/list_authenticators_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListAuthenticatorsParams creates a new ListAuthenticatorsParams object -// -// There are no default values defined in the spec. -func NewListAuthenticatorsParams() ListAuthenticatorsParams { - - return ListAuthenticatorsParams{} -} - -// ListAuthenticatorsParams contains all the bound params for the list authenticators operation -// typically these are obtained from a http.Request -// -// swagger:parameters listAuthenticators -type ListAuthenticatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListAuthenticatorsParams() beforehand. -func (o *ListAuthenticatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListAuthenticatorsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListAuthenticatorsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListAuthenticatorsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/authenticator/list_authenticators_responses.go b/rest_management_api_server/operations/authenticator/list_authenticators_responses.go deleted file mode 100644 index c8ffdeb94..000000000 --- a/rest_management_api_server/operations/authenticator/list_authenticators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListAuthenticatorsOKCode is the HTTP code returned for type ListAuthenticatorsOK -const ListAuthenticatorsOKCode int = 200 - -/*ListAuthenticatorsOK A list of authenticators - -swagger:response listAuthenticatorsOK -*/ -type ListAuthenticatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListAuthenticatorsEnvelope `json:"body,omitempty"` -} - -// NewListAuthenticatorsOK creates ListAuthenticatorsOK with default headers values -func NewListAuthenticatorsOK() *ListAuthenticatorsOK { - - return &ListAuthenticatorsOK{} -} - -// WithPayload adds the payload to the list authenticators o k response -func (o *ListAuthenticatorsOK) WithPayload(payload *rest_model.ListAuthenticatorsEnvelope) *ListAuthenticatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list authenticators o k response -func (o *ListAuthenticatorsOK) SetPayload(payload *rest_model.ListAuthenticatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAuthenticatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListAuthenticatorsBadRequestCode is the HTTP code returned for type ListAuthenticatorsBadRequest -const ListAuthenticatorsBadRequestCode int = 400 - -/*ListAuthenticatorsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listAuthenticatorsBadRequest -*/ -type ListAuthenticatorsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListAuthenticatorsBadRequest creates ListAuthenticatorsBadRequest with default headers values -func NewListAuthenticatorsBadRequest() *ListAuthenticatorsBadRequest { - - return &ListAuthenticatorsBadRequest{} -} - -// WithPayload adds the payload to the list authenticators bad request response -func (o *ListAuthenticatorsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAuthenticatorsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list authenticators bad request response -func (o *ListAuthenticatorsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAuthenticatorsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListAuthenticatorsUnauthorizedCode is the HTTP code returned for type ListAuthenticatorsUnauthorized -const ListAuthenticatorsUnauthorizedCode int = 401 - -/*ListAuthenticatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listAuthenticatorsUnauthorized -*/ -type ListAuthenticatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListAuthenticatorsUnauthorized creates ListAuthenticatorsUnauthorized with default headers values -func NewListAuthenticatorsUnauthorized() *ListAuthenticatorsUnauthorized { - - return &ListAuthenticatorsUnauthorized{} -} - -// WithPayload adds the payload to the list authenticators unauthorized response -func (o *ListAuthenticatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListAuthenticatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list authenticators unauthorized response -func (o *ListAuthenticatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListAuthenticatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/list_authenticators_urlbuilder.go b/rest_management_api_server/operations/authenticator/list_authenticators_urlbuilder.go deleted file mode 100644 index f3555e535..000000000 --- a/rest_management_api_server/operations/authenticator/list_authenticators_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListAuthenticatorsURL generates an URL for the list authenticators operation -type ListAuthenticatorsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListAuthenticatorsURL) WithBasePath(bp string) *ListAuthenticatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListAuthenticatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListAuthenticatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListAuthenticatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListAuthenticatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListAuthenticatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListAuthenticatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListAuthenticatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListAuthenticatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/patch_authenticator.go b/rest_management_api_server/operations/authenticator/patch_authenticator.go deleted file mode 100644 index 795c87a2d..000000000 --- a/rest_management_api_server/operations/authenticator/patch_authenticator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchAuthenticatorHandlerFunc turns a function with the right signature into a patch authenticator handler -type PatchAuthenticatorHandlerFunc func(PatchAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchAuthenticatorHandlerFunc) Handle(params PatchAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchAuthenticatorHandler interface for that can handle valid patch authenticator params -type PatchAuthenticatorHandler interface { - Handle(PatchAuthenticatorParams, interface{}) middleware.Responder -} - -// NewPatchAuthenticator creates a new http.Handler for the patch authenticator operation -func NewPatchAuthenticator(ctx *middleware.Context, handler PatchAuthenticatorHandler) *PatchAuthenticator { - return &PatchAuthenticator{Context: ctx, Handler: handler} -} - -/* PatchAuthenticator swagger:route PATCH /authenticators/{id} Authenticator patchAuthenticator - -Update the supplied fields on an authenticator - -Update the supplied fields on an authenticator by id. Requires admin access. - -*/ -type PatchAuthenticator struct { - Context *middleware.Context - Handler PatchAuthenticatorHandler -} - -func (o *PatchAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/patch_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/patch_authenticator_parameters.go deleted file mode 100644 index 1527e929f..000000000 --- a/rest_management_api_server/operations/authenticator/patch_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchAuthenticatorParams creates a new PatchAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewPatchAuthenticatorParams() PatchAuthenticatorParams { - - return PatchAuthenticatorParams{} -} - -// PatchAuthenticatorParams contains all the bound params for the patch authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchAuthenticator -type PatchAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An authenticator patch object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorPatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchAuthenticatorParams() beforehand. -func (o *PatchAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/authenticator/patch_authenticator_responses.go b/rest_management_api_server/operations/authenticator/patch_authenticator_responses.go deleted file mode 100644 index a6c00e61c..000000000 --- a/rest_management_api_server/operations/authenticator/patch_authenticator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchAuthenticatorOKCode is the HTTP code returned for type PatchAuthenticatorOK -const PatchAuthenticatorOKCode int = 200 - -/*PatchAuthenticatorOK The patch request was successful and the resource has been altered - -swagger:response patchAuthenticatorOK -*/ -type PatchAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchAuthenticatorOK creates PatchAuthenticatorOK with default headers values -func NewPatchAuthenticatorOK() *PatchAuthenticatorOK { - - return &PatchAuthenticatorOK{} -} - -// WithPayload adds the payload to the patch authenticator o k response -func (o *PatchAuthenticatorOK) WithPayload(payload *rest_model.Empty) *PatchAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch authenticator o k response -func (o *PatchAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchAuthenticatorBadRequestCode is the HTTP code returned for type PatchAuthenticatorBadRequest -const PatchAuthenticatorBadRequestCode int = 400 - -/*PatchAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchAuthenticatorBadRequest -*/ -type PatchAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchAuthenticatorBadRequest creates PatchAuthenticatorBadRequest with default headers values -func NewPatchAuthenticatorBadRequest() *PatchAuthenticatorBadRequest { - - return &PatchAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the patch authenticator bad request response -func (o *PatchAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch authenticator bad request response -func (o *PatchAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchAuthenticatorUnauthorizedCode is the HTTP code returned for type PatchAuthenticatorUnauthorized -const PatchAuthenticatorUnauthorizedCode int = 401 - -/*PatchAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchAuthenticatorUnauthorized -*/ -type PatchAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchAuthenticatorUnauthorized creates PatchAuthenticatorUnauthorized with default headers values -func NewPatchAuthenticatorUnauthorized() *PatchAuthenticatorUnauthorized { - - return &PatchAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the patch authenticator unauthorized response -func (o *PatchAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch authenticator unauthorized response -func (o *PatchAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchAuthenticatorNotFoundCode is the HTTP code returned for type PatchAuthenticatorNotFound -const PatchAuthenticatorNotFoundCode int = 404 - -/*PatchAuthenticatorNotFound The requested resource does not exist - -swagger:response patchAuthenticatorNotFound -*/ -type PatchAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchAuthenticatorNotFound creates PatchAuthenticatorNotFound with default headers values -func NewPatchAuthenticatorNotFound() *PatchAuthenticatorNotFound { - - return &PatchAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the patch authenticator not found response -func (o *PatchAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch authenticator not found response -func (o *PatchAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/patch_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/patch_authenticator_urlbuilder.go deleted file mode 100644 index 98d4525ef..000000000 --- a/rest_management_api_server/operations/authenticator/patch_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchAuthenticatorURL generates an URL for the patch authenticator operation -type PatchAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchAuthenticatorURL) WithBasePath(bp string) *PatchAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/re_enroll_authenticator.go b/rest_management_api_server/operations/authenticator/re_enroll_authenticator.go deleted file mode 100644 index b3fbc8882..000000000 --- a/rest_management_api_server/operations/authenticator/re_enroll_authenticator.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ReEnrollAuthenticatorHandlerFunc turns a function with the right signature into a re enroll authenticator handler -type ReEnrollAuthenticatorHandlerFunc func(ReEnrollAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ReEnrollAuthenticatorHandlerFunc) Handle(params ReEnrollAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ReEnrollAuthenticatorHandler interface for that can handle valid re enroll authenticator params -type ReEnrollAuthenticatorHandler interface { - Handle(ReEnrollAuthenticatorParams, interface{}) middleware.Responder -} - -// NewReEnrollAuthenticator creates a new http.Handler for the re enroll authenticator operation -func NewReEnrollAuthenticator(ctx *middleware.Context, handler ReEnrollAuthenticatorHandler) *ReEnrollAuthenticator { - return &ReEnrollAuthenticator{Context: ctx, Handler: handler} -} - -/* ReEnrollAuthenticator swagger:route POST /authenticators/{id}/re-enroll Authenticator reEnrollAuthenticator - -Reverts an authenticator to an enrollment - -Allows an authenticator to be reverted to an enrollment and allows re-enrollment to occur. On success the -created enrollment record response is provided and the source authenticator record will be deleted. The -enrollment created depends on the authenticator. UPDB authenticators result in UPDB enrollments, CERT -authenticators result in OTT enrollments, CERT + CA authenticators result in OTTCA enrollments. - - -*/ -type ReEnrollAuthenticator struct { - Context *middleware.Context - Handler ReEnrollAuthenticatorHandler -} - -func (o *ReEnrollAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewReEnrollAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/re_enroll_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/re_enroll_authenticator_parameters.go deleted file mode 100644 index 78d0f951e..000000000 --- a/rest_management_api_server/operations/authenticator/re_enroll_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewReEnrollAuthenticatorParams creates a new ReEnrollAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewReEnrollAuthenticatorParams() ReEnrollAuthenticatorParams { - - return ReEnrollAuthenticatorParams{} -} - -// ReEnrollAuthenticatorParams contains all the bound params for the re enroll authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters reEnrollAuthenticator -type ReEnrollAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A reEnrollment request - Required: true - In: body - */ - ReEnroll *rest_model.ReEnroll -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewReEnrollAuthenticatorParams() beforehand. -func (o *ReEnrollAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ReEnroll - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("reEnroll", "body", "")) - } else { - res = append(res, errors.NewParseError("reEnroll", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ReEnroll = &body - } - } - } else { - res = append(res, errors.Required("reEnroll", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ReEnrollAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/authenticator/re_enroll_authenticator_responses.go b/rest_management_api_server/operations/authenticator/re_enroll_authenticator_responses.go deleted file mode 100644 index 20ee63d15..000000000 --- a/rest_management_api_server/operations/authenticator/re_enroll_authenticator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ReEnrollAuthenticatorCreatedCode is the HTTP code returned for type ReEnrollAuthenticatorCreated -const ReEnrollAuthenticatorCreatedCode int = 201 - -/*ReEnrollAuthenticatorCreated The create request was successful and the resource has been added at the following location - -swagger:response reEnrollAuthenticatorCreated -*/ -type ReEnrollAuthenticatorCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewReEnrollAuthenticatorCreated creates ReEnrollAuthenticatorCreated with default headers values -func NewReEnrollAuthenticatorCreated() *ReEnrollAuthenticatorCreated { - - return &ReEnrollAuthenticatorCreated{} -} - -// WithPayload adds the payload to the re enroll authenticator created response -func (o *ReEnrollAuthenticatorCreated) WithPayload(payload *rest_model.CreateEnvelope) *ReEnrollAuthenticatorCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the re enroll authenticator created response -func (o *ReEnrollAuthenticatorCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReEnrollAuthenticatorCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReEnrollAuthenticatorUnauthorizedCode is the HTTP code returned for type ReEnrollAuthenticatorUnauthorized -const ReEnrollAuthenticatorUnauthorizedCode int = 401 - -/*ReEnrollAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response reEnrollAuthenticatorUnauthorized -*/ -type ReEnrollAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewReEnrollAuthenticatorUnauthorized creates ReEnrollAuthenticatorUnauthorized with default headers values -func NewReEnrollAuthenticatorUnauthorized() *ReEnrollAuthenticatorUnauthorized { - - return &ReEnrollAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the re enroll authenticator unauthorized response -func (o *ReEnrollAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ReEnrollAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the re enroll authenticator unauthorized response -func (o *ReEnrollAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReEnrollAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReEnrollAuthenticatorNotFoundCode is the HTTP code returned for type ReEnrollAuthenticatorNotFound -const ReEnrollAuthenticatorNotFoundCode int = 404 - -/*ReEnrollAuthenticatorNotFound The requested resource does not exist - -swagger:response reEnrollAuthenticatorNotFound -*/ -type ReEnrollAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewReEnrollAuthenticatorNotFound creates ReEnrollAuthenticatorNotFound with default headers values -func NewReEnrollAuthenticatorNotFound() *ReEnrollAuthenticatorNotFound { - - return &ReEnrollAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the re enroll authenticator not found response -func (o *ReEnrollAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ReEnrollAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the re enroll authenticator not found response -func (o *ReEnrollAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReEnrollAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/re_enroll_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/re_enroll_authenticator_urlbuilder.go deleted file mode 100644 index 11dd82ca6..000000000 --- a/rest_management_api_server/operations/authenticator/re_enroll_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ReEnrollAuthenticatorURL generates an URL for the re enroll authenticator operation -type ReEnrollAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReEnrollAuthenticatorURL) WithBasePath(bp string) *ReEnrollAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReEnrollAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ReEnrollAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators/{id}/re-enroll" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ReEnrollAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ReEnrollAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ReEnrollAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ReEnrollAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ReEnrollAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ReEnrollAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ReEnrollAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/authenticator/update_authenticator.go b/rest_management_api_server/operations/authenticator/update_authenticator.go deleted file mode 100644 index 134c8f84f..000000000 --- a/rest_management_api_server/operations/authenticator/update_authenticator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateAuthenticatorHandlerFunc turns a function with the right signature into a update authenticator handler -type UpdateAuthenticatorHandlerFunc func(UpdateAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateAuthenticatorHandlerFunc) Handle(params UpdateAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateAuthenticatorHandler interface for that can handle valid update authenticator params -type UpdateAuthenticatorHandler interface { - Handle(UpdateAuthenticatorParams, interface{}) middleware.Responder -} - -// NewUpdateAuthenticator creates a new http.Handler for the update authenticator operation -func NewUpdateAuthenticator(ctx *middleware.Context, handler UpdateAuthenticatorHandler) *UpdateAuthenticator { - return &UpdateAuthenticator{Context: ctx, Handler: handler} -} - -/* UpdateAuthenticator swagger:route PUT /authenticators/{id} Authenticator updateAuthenticator - -Update all fields on an authenticator - -Update all fields on an authenticator by id. Requires admin access. - -*/ -type UpdateAuthenticator struct { - Context *middleware.Context - Handler UpdateAuthenticatorHandler -} - -func (o *UpdateAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/authenticator/update_authenticator_parameters.go b/rest_management_api_server/operations/authenticator/update_authenticator_parameters.go deleted file mode 100644 index bdead0e07..000000000 --- a/rest_management_api_server/operations/authenticator/update_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateAuthenticatorParams creates a new UpdateAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewUpdateAuthenticatorParams() UpdateAuthenticatorParams { - - return UpdateAuthenticatorParams{} -} - -// UpdateAuthenticatorParams contains all the bound params for the update authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateAuthenticator -type UpdateAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An authenticator put object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateAuthenticatorParams() beforehand. -func (o *UpdateAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/authenticator/update_authenticator_responses.go b/rest_management_api_server/operations/authenticator/update_authenticator_responses.go deleted file mode 100644 index 6fdf602e6..000000000 --- a/rest_management_api_server/operations/authenticator/update_authenticator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateAuthenticatorOKCode is the HTTP code returned for type UpdateAuthenticatorOK -const UpdateAuthenticatorOKCode int = 200 - -/*UpdateAuthenticatorOK The update request was successful and the resource has been altered - -swagger:response updateAuthenticatorOK -*/ -type UpdateAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateAuthenticatorOK creates UpdateAuthenticatorOK with default headers values -func NewUpdateAuthenticatorOK() *UpdateAuthenticatorOK { - - return &UpdateAuthenticatorOK{} -} - -// WithPayload adds the payload to the update authenticator o k response -func (o *UpdateAuthenticatorOK) WithPayload(payload *rest_model.Empty) *UpdateAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update authenticator o k response -func (o *UpdateAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAuthenticatorBadRequestCode is the HTTP code returned for type UpdateAuthenticatorBadRequest -const UpdateAuthenticatorBadRequestCode int = 400 - -/*UpdateAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateAuthenticatorBadRequest -*/ -type UpdateAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateAuthenticatorBadRequest creates UpdateAuthenticatorBadRequest with default headers values -func NewUpdateAuthenticatorBadRequest() *UpdateAuthenticatorBadRequest { - - return &UpdateAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the update authenticator bad request response -func (o *UpdateAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update authenticator bad request response -func (o *UpdateAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAuthenticatorUnauthorizedCode is the HTTP code returned for type UpdateAuthenticatorUnauthorized -const UpdateAuthenticatorUnauthorizedCode int = 401 - -/*UpdateAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateAuthenticatorUnauthorized -*/ -type UpdateAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateAuthenticatorUnauthorized creates UpdateAuthenticatorUnauthorized with default headers values -func NewUpdateAuthenticatorUnauthorized() *UpdateAuthenticatorUnauthorized { - - return &UpdateAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the update authenticator unauthorized response -func (o *UpdateAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update authenticator unauthorized response -func (o *UpdateAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAuthenticatorNotFoundCode is the HTTP code returned for type UpdateAuthenticatorNotFound -const UpdateAuthenticatorNotFoundCode int = 404 - -/*UpdateAuthenticatorNotFound The requested resource does not exist - -swagger:response updateAuthenticatorNotFound -*/ -type UpdateAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateAuthenticatorNotFound creates UpdateAuthenticatorNotFound with default headers values -func NewUpdateAuthenticatorNotFound() *UpdateAuthenticatorNotFound { - - return &UpdateAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the update authenticator not found response -func (o *UpdateAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update authenticator not found response -func (o *UpdateAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/authenticator/update_authenticator_urlbuilder.go b/rest_management_api_server/operations/authenticator/update_authenticator_urlbuilder.go deleted file mode 100644 index f09fbd58a..000000000 --- a/rest_management_api_server/operations/authenticator/update_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package authenticator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateAuthenticatorURL generates an URL for the update authenticator operation -type UpdateAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAuthenticatorURL) WithBasePath(bp string) *UpdateAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/create_ca.go b/rest_management_api_server/operations/certificate_authority/create_ca.go deleted file mode 100644 index 20748ba80..000000000 --- a/rest_management_api_server/operations/certificate_authority/create_ca.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateCaHandlerFunc turns a function with the right signature into a create ca handler -type CreateCaHandlerFunc func(CreateCaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateCaHandlerFunc) Handle(params CreateCaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateCaHandler interface for that can handle valid create ca params -type CreateCaHandler interface { - Handle(CreateCaParams, interface{}) middleware.Responder -} - -// NewCreateCa creates a new http.Handler for the create ca operation -func NewCreateCa(ctx *middleware.Context, handler CreateCaHandler) *CreateCa { - return &CreateCa{Context: ctx, Handler: handler} -} - -/* CreateCa swagger:route POST /cas Certificate Authority createCa - -Creates a CA - -Creates a CA in an unverified state. Requires admin access. - -*/ -type CreateCa struct { - Context *middleware.Context - Handler CreateCaHandler -} - -func (o *CreateCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateCaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/create_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/create_ca_parameters.go deleted file mode 100644 index e3e74baa1..000000000 --- a/rest_management_api_server/operations/certificate_authority/create_ca_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateCaParams creates a new CreateCaParams object -// -// There are no default values defined in the spec. -func NewCreateCaParams() CreateCaParams { - - return CreateCaParams{} -} - -// CreateCaParams contains all the bound params for the create ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters createCa -type CreateCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A CA to create - Required: true - In: body - */ - Ca *rest_model.CaCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateCaParams() beforehand. -func (o *CreateCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.CaCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("ca", "body", "")) - } else { - res = append(res, errors.NewParseError("ca", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Ca = &body - } - } - } else { - res = append(res, errors.Required("ca", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/create_ca_responses.go b/rest_management_api_server/operations/certificate_authority/create_ca_responses.go deleted file mode 100644 index 0bd1ceae4..000000000 --- a/rest_management_api_server/operations/certificate_authority/create_ca_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateCaCreatedCode is the HTTP code returned for type CreateCaCreated -const CreateCaCreatedCode int = 201 - -/*CreateCaCreated The create request was successful and the resource has been added at the following location - -swagger:response createCaCreated -*/ -type CreateCaCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateCaCreated creates CreateCaCreated with default headers values -func NewCreateCaCreated() *CreateCaCreated { - - return &CreateCaCreated{} -} - -// WithPayload adds the payload to the create ca created response -func (o *CreateCaCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateCaCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create ca created response -func (o *CreateCaCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCaCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCaBadRequestCode is the HTTP code returned for type CreateCaBadRequest -const CreateCaBadRequestCode int = 400 - -/*CreateCaBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createCaBadRequest -*/ -type CreateCaBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateCaBadRequest creates CreateCaBadRequest with default headers values -func NewCreateCaBadRequest() *CreateCaBadRequest { - - return &CreateCaBadRequest{} -} - -// WithPayload adds the payload to the create ca bad request response -func (o *CreateCaBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateCaBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create ca bad request response -func (o *CreateCaBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCaBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCaUnauthorizedCode is the HTTP code returned for type CreateCaUnauthorized -const CreateCaUnauthorizedCode int = 401 - -/*CreateCaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createCaUnauthorized -*/ -type CreateCaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateCaUnauthorized creates CreateCaUnauthorized with default headers values -func NewCreateCaUnauthorized() *CreateCaUnauthorized { - - return &CreateCaUnauthorized{} -} - -// WithPayload adds the payload to the create ca unauthorized response -func (o *CreateCaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateCaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create ca unauthorized response -func (o *CreateCaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/create_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/create_ca_urlbuilder.go deleted file mode 100644 index 226d23382..000000000 --- a/rest_management_api_server/operations/certificate_authority/create_ca_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateCaURL generates an URL for the create ca operation -type CreateCaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCaURL) WithBasePath(bp string) *CreateCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/delete_ca.go b/rest_management_api_server/operations/certificate_authority/delete_ca.go deleted file mode 100644 index 24991e22a..000000000 --- a/rest_management_api_server/operations/certificate_authority/delete_ca.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteCaHandlerFunc turns a function with the right signature into a delete ca handler -type DeleteCaHandlerFunc func(DeleteCaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteCaHandlerFunc) Handle(params DeleteCaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteCaHandler interface for that can handle valid delete ca params -type DeleteCaHandler interface { - Handle(DeleteCaParams, interface{}) middleware.Responder -} - -// NewDeleteCa creates a new http.Handler for the delete ca operation -func NewDeleteCa(ctx *middleware.Context, handler DeleteCaHandler) *DeleteCa { - return &DeleteCa{Context: ctx, Handler: handler} -} - -/* DeleteCa swagger:route DELETE /cas/{id} Certificate Authority deleteCa - -Delete a CA - -Delete a CA by id. Deleting a CA will delete its associated certificate authenticators. This can make it -impossible for identities to authenticate if they no longer have any valid authenticators. Requires admin access. - - -*/ -type DeleteCa struct { - Context *middleware.Context - Handler DeleteCaHandler -} - -func (o *DeleteCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteCaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/delete_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/delete_ca_parameters.go deleted file mode 100644 index 16a5ee438..000000000 --- a/rest_management_api_server/operations/certificate_authority/delete_ca_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteCaParams creates a new DeleteCaParams object -// -// There are no default values defined in the spec. -func NewDeleteCaParams() DeleteCaParams { - - return DeleteCaParams{} -} - -// DeleteCaParams contains all the bound params for the delete ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteCa -type DeleteCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteCaParams() beforehand. -func (o *DeleteCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/delete_ca_responses.go b/rest_management_api_server/operations/certificate_authority/delete_ca_responses.go deleted file mode 100644 index a09e97e63..000000000 --- a/rest_management_api_server/operations/certificate_authority/delete_ca_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCaOKCode is the HTTP code returned for type DeleteCaOK -const DeleteCaOKCode int = 200 - -/*DeleteCaOK The delete request was successful and the resource has been removed - -swagger:response deleteCaOK -*/ -type DeleteCaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteCaOK creates DeleteCaOK with default headers values -func NewDeleteCaOK() *DeleteCaOK { - - return &DeleteCaOK{} -} - -// WithPayload adds the payload to the delete ca o k response -func (o *DeleteCaOK) WithPayload(payload *rest_model.Empty) *DeleteCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete ca o k response -func (o *DeleteCaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCaBadRequestCode is the HTTP code returned for type DeleteCaBadRequest -const DeleteCaBadRequestCode int = 400 - -/*DeleteCaBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteCaBadRequest -*/ -type DeleteCaBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteCaBadRequest creates DeleteCaBadRequest with default headers values -func NewDeleteCaBadRequest() *DeleteCaBadRequest { - - return &DeleteCaBadRequest{} -} - -// WithPayload adds the payload to the delete ca bad request response -func (o *DeleteCaBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteCaBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete ca bad request response -func (o *DeleteCaBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCaBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCaUnauthorizedCode is the HTTP code returned for type DeleteCaUnauthorized -const DeleteCaUnauthorizedCode int = 401 - -/*DeleteCaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteCaUnauthorized -*/ -type DeleteCaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteCaUnauthorized creates DeleteCaUnauthorized with default headers values -func NewDeleteCaUnauthorized() *DeleteCaUnauthorized { - - return &DeleteCaUnauthorized{} -} - -// WithPayload adds the payload to the delete ca unauthorized response -func (o *DeleteCaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteCaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete ca unauthorized response -func (o *DeleteCaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/delete_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/delete_ca_urlbuilder.go deleted file mode 100644 index d84db5716..000000000 --- a/rest_management_api_server/operations/certificate_authority/delete_ca_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteCaURL generates an URL for the delete ca operation -type DeleteCaURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCaURL) WithBasePath(bp string) *DeleteCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteCaURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/detail_ca.go b/rest_management_api_server/operations/certificate_authority/detail_ca.go deleted file mode 100644 index bc8f60680..000000000 --- a/rest_management_api_server/operations/certificate_authority/detail_ca.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailCaHandlerFunc turns a function with the right signature into a detail ca handler -type DetailCaHandlerFunc func(DetailCaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailCaHandlerFunc) Handle(params DetailCaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailCaHandler interface for that can handle valid detail ca params -type DetailCaHandler interface { - Handle(DetailCaParams, interface{}) middleware.Responder -} - -// NewDetailCa creates a new http.Handler for the detail ca operation -func NewDetailCa(ctx *middleware.Context, handler DetailCaHandler) *DetailCa { - return &DetailCa{Context: ctx, Handler: handler} -} - -/* DetailCa swagger:route GET /cas/{id} Certificate Authority detailCa - -Retrieves a single CA - -Retrieves a single CA by id. Requires admin access. - -*/ -type DetailCa struct { - Context *middleware.Context - Handler DetailCaHandler -} - -func (o *DetailCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailCaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/detail_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/detail_ca_parameters.go deleted file mode 100644 index 18d8a7530..000000000 --- a/rest_management_api_server/operations/certificate_authority/detail_ca_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailCaParams creates a new DetailCaParams object -// -// There are no default values defined in the spec. -func NewDetailCaParams() DetailCaParams { - - return DetailCaParams{} -} - -// DetailCaParams contains all the bound params for the detail ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailCa -type DetailCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailCaParams() beforehand. -func (o *DetailCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/detail_ca_responses.go b/rest_management_api_server/operations/certificate_authority/detail_ca_responses.go deleted file mode 100644 index 83cf4a129..000000000 --- a/rest_management_api_server/operations/certificate_authority/detail_ca_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailCaOKCode is the HTTP code returned for type DetailCaOK -const DetailCaOKCode int = 200 - -/*DetailCaOK A singular Certificate Authority (CA) resource - -swagger:response detailCaOK -*/ -type DetailCaOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailCaEnvelope `json:"body,omitempty"` -} - -// NewDetailCaOK creates DetailCaOK with default headers values -func NewDetailCaOK() *DetailCaOK { - - return &DetailCaOK{} -} - -// WithPayload adds the payload to the detail ca o k response -func (o *DetailCaOK) WithPayload(payload *rest_model.DetailCaEnvelope) *DetailCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail ca o k response -func (o *DetailCaOK) SetPayload(payload *rest_model.DetailCaEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCaUnauthorizedCode is the HTTP code returned for type DetailCaUnauthorized -const DetailCaUnauthorizedCode int = 401 - -/*DetailCaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailCaUnauthorized -*/ -type DetailCaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCaUnauthorized creates DetailCaUnauthorized with default headers values -func NewDetailCaUnauthorized() *DetailCaUnauthorized { - - return &DetailCaUnauthorized{} -} - -// WithPayload adds the payload to the detail ca unauthorized response -func (o *DetailCaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail ca unauthorized response -func (o *DetailCaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCaNotFoundCode is the HTTP code returned for type DetailCaNotFound -const DetailCaNotFoundCode int = 404 - -/*DetailCaNotFound The requested resource does not exist - -swagger:response detailCaNotFound -*/ -type DetailCaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCaNotFound creates DetailCaNotFound with default headers values -func NewDetailCaNotFound() *DetailCaNotFound { - - return &DetailCaNotFound{} -} - -// WithPayload adds the payload to the detail ca not found response -func (o *DetailCaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail ca not found response -func (o *DetailCaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/detail_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/detail_ca_urlbuilder.go deleted file mode 100644 index 79120d2c9..000000000 --- a/rest_management_api_server/operations/certificate_authority/detail_ca_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailCaURL generates an URL for the detail ca operation -type DetailCaURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCaURL) WithBasePath(bp string) *DetailCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailCaURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/get_ca_jwt.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt.go deleted file mode 100644 index e9ab3e848..000000000 --- a/rest_management_api_server/operations/certificate_authority/get_ca_jwt.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCaJWTHandlerFunc turns a function with the right signature into a get ca Jwt handler -type GetCaJWTHandlerFunc func(GetCaJWTParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCaJWTHandlerFunc) Handle(params GetCaJWTParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetCaJWTHandler interface for that can handle valid get ca Jwt params -type GetCaJWTHandler interface { - Handle(GetCaJWTParams, interface{}) middleware.Responder -} - -// NewGetCaJWT creates a new http.Handler for the get ca Jwt operation -func NewGetCaJWT(ctx *middleware.Context, handler GetCaJWTHandler) *GetCaJWT { - return &GetCaJWT{Context: ctx, Handler: handler} -} - -/* GetCaJWT swagger:route GET /cas/{id}/jwt Certificate Authority getCaJwt - -Retrieve the enrollment JWT for a CA - -For CA auto enrollment, the enrollment JWT is static and provided on each CA resource. This endpoint provides -the jwt as a text response. - - -*/ -type GetCaJWT struct { - Context *middleware.Context - Handler GetCaJWTHandler -} - -func (o *GetCaJWT) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCaJWTParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/get_ca_jwt_parameters.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_parameters.go deleted file mode 100644 index 111f5e701..000000000 --- a/rest_management_api_server/operations/certificate_authority/get_ca_jwt_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetCaJWTParams creates a new GetCaJWTParams object -// -// There are no default values defined in the spec. -func NewGetCaJWTParams() GetCaJWTParams { - - return GetCaJWTParams{} -} - -// GetCaJWTParams contains all the bound params for the get ca Jwt operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCaJwt -type GetCaJWTParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCaJWTParams() beforehand. -func (o *GetCaJWTParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetCaJWTParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/get_ca_jwt_responses.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_responses.go deleted file mode 100644 index cf0a392f3..000000000 --- a/rest_management_api_server/operations/certificate_authority/get_ca_jwt_responses.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetCaJWTOKCode is the HTTP code returned for type GetCaJWTOK -const GetCaJWTOKCode int = 200 - -/*GetCaJWTOK The result is the JWT text to validate the CA - -swagger:response getCaJwtOK -*/ -type GetCaJWTOK struct { - - /* - In: Body - */ - Payload string `json:"body,omitempty"` -} - -// NewGetCaJWTOK creates GetCaJWTOK with default headers values -func NewGetCaJWTOK() *GetCaJWTOK { - - return &GetCaJWTOK{} -} - -// WithPayload adds the payload to the get ca Jwt o k response -func (o *GetCaJWTOK) WithPayload(payload string) *GetCaJWTOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get ca Jwt o k response -func (o *GetCaJWTOK) SetPayload(payload string) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCaJWTOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetCaJWTUnauthorizedCode is the HTTP code returned for type GetCaJWTUnauthorized -const GetCaJWTUnauthorizedCode int = 401 - -/*GetCaJWTUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getCaJwtUnauthorized -*/ -type GetCaJWTUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCaJWTUnauthorized creates GetCaJWTUnauthorized with default headers values -func NewGetCaJWTUnauthorized() *GetCaJWTUnauthorized { - - return &GetCaJWTUnauthorized{} -} - -// WithPayload adds the payload to the get ca Jwt unauthorized response -func (o *GetCaJWTUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCaJWTUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get ca Jwt unauthorized response -func (o *GetCaJWTUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCaJWTUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCaJWTNotFoundCode is the HTTP code returned for type GetCaJWTNotFound -const GetCaJWTNotFoundCode int = 404 - -/*GetCaJWTNotFound The requested resource does not exist - -swagger:response getCaJwtNotFound -*/ -type GetCaJWTNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCaJWTNotFound creates GetCaJWTNotFound with default headers values -func NewGetCaJWTNotFound() *GetCaJWTNotFound { - - return &GetCaJWTNotFound{} -} - -// WithPayload adds the payload to the get ca Jwt not found response -func (o *GetCaJWTNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCaJWTNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get ca Jwt not found response -func (o *GetCaJWTNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCaJWTNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go deleted file mode 100644 index a03690fcf..000000000 --- a/rest_management_api_server/operations/certificate_authority/get_ca_jwt_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetCaJWTURL generates an URL for the get ca Jwt operation -type GetCaJWTURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCaJWTURL) WithBasePath(bp string) *GetCaJWTURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCaJWTURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCaJWTURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas/{id}/jwt" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetCaJWTURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCaJWTURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCaJWTURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCaJWTURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCaJWTURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCaJWTURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCaJWTURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/list_cas.go b/rest_management_api_server/operations/certificate_authority/list_cas.go deleted file mode 100644 index add32777e..000000000 --- a/rest_management_api_server/operations/certificate_authority/list_cas.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListCasHandlerFunc turns a function with the right signature into a list cas handler -type ListCasHandlerFunc func(ListCasParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListCasHandlerFunc) Handle(params ListCasParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListCasHandler interface for that can handle valid list cas params -type ListCasHandler interface { - Handle(ListCasParams, interface{}) middleware.Responder -} - -// NewListCas creates a new http.Handler for the list cas operation -func NewListCas(ctx *middleware.Context, handler ListCasHandler) *ListCas { - return &ListCas{Context: ctx, Handler: handler} -} - -/* ListCas swagger:route GET /cas Certificate Authority listCas - -List CAs - -Retrieves a list of CA resources; supports filtering, sorting, and pagination. Requires admin access. - -*/ -type ListCas struct { - Context *middleware.Context - Handler ListCasHandler -} - -func (o *ListCas) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListCasParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/list_cas_parameters.go b/rest_management_api_server/operations/certificate_authority/list_cas_parameters.go deleted file mode 100644 index e7a525488..000000000 --- a/rest_management_api_server/operations/certificate_authority/list_cas_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCasParams creates a new ListCasParams object -// -// There are no default values defined in the spec. -func NewListCasParams() ListCasParams { - - return ListCasParams{} -} - -// ListCasParams contains all the bound params for the list cas operation -// typically these are obtained from a http.Request -// -// swagger:parameters listCas -type ListCasParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListCasParams() beforehand. -func (o *ListCasParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListCasParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListCasParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListCasParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/list_cas_responses.go b/rest_management_api_server/operations/certificate_authority/list_cas_responses.go deleted file mode 100644 index f4617ab91..000000000 --- a/rest_management_api_server/operations/certificate_authority/list_cas_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListCasOKCode is the HTTP code returned for type ListCasOK -const ListCasOKCode int = 200 - -/*ListCasOK A list of Certificate Authorities (CAs) - -swagger:response listCasOK -*/ -type ListCasOK struct { - - /* - In: Body - */ - Payload *rest_model.ListCasEnvelope `json:"body,omitempty"` -} - -// NewListCasOK creates ListCasOK with default headers values -func NewListCasOK() *ListCasOK { - - return &ListCasOK{} -} - -// WithPayload adds the payload to the list cas o k response -func (o *ListCasOK) WithPayload(payload *rest_model.ListCasEnvelope) *ListCasOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list cas o k response -func (o *ListCasOK) SetPayload(payload *rest_model.ListCasEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCasOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCasBadRequestCode is the HTTP code returned for type ListCasBadRequest -const ListCasBadRequestCode int = 400 - -/*ListCasBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listCasBadRequest -*/ -type ListCasBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCasBadRequest creates ListCasBadRequest with default headers values -func NewListCasBadRequest() *ListCasBadRequest { - - return &ListCasBadRequest{} -} - -// WithPayload adds the payload to the list cas bad request response -func (o *ListCasBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCasBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list cas bad request response -func (o *ListCasBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCasBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCasUnauthorizedCode is the HTTP code returned for type ListCasUnauthorized -const ListCasUnauthorizedCode int = 401 - -/*ListCasUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listCasUnauthorized -*/ -type ListCasUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCasUnauthorized creates ListCasUnauthorized with default headers values -func NewListCasUnauthorized() *ListCasUnauthorized { - - return &ListCasUnauthorized{} -} - -// WithPayload adds the payload to the list cas unauthorized response -func (o *ListCasUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCasUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list cas unauthorized response -func (o *ListCasUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCasUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/list_cas_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/list_cas_urlbuilder.go deleted file mode 100644 index 3e7b6dbc8..000000000 --- a/rest_management_api_server/operations/certificate_authority/list_cas_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListCasURL generates an URL for the list cas operation -type ListCasURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCasURL) WithBasePath(bp string) *ListCasURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCasURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListCasURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListCasURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListCasURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListCasURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListCasURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListCasURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListCasURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/patch_ca.go b/rest_management_api_server/operations/certificate_authority/patch_ca.go deleted file mode 100644 index 1567cf719..000000000 --- a/rest_management_api_server/operations/certificate_authority/patch_ca.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchCaHandlerFunc turns a function with the right signature into a patch ca handler -type PatchCaHandlerFunc func(PatchCaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchCaHandlerFunc) Handle(params PatchCaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchCaHandler interface for that can handle valid patch ca params -type PatchCaHandler interface { - Handle(PatchCaParams, interface{}) middleware.Responder -} - -// NewPatchCa creates a new http.Handler for the patch ca operation -func NewPatchCa(ctx *middleware.Context, handler PatchCaHandler) *PatchCa { - return &PatchCa{Context: ctx, Handler: handler} -} - -/* PatchCa swagger:route PATCH /cas/{id} Certificate Authority patchCa - -Update the supplied fields on a CA - -Update only the supplied fields on a CA by id. Requires admin access. - -*/ -type PatchCa struct { - Context *middleware.Context - Handler PatchCaHandler -} - -func (o *PatchCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchCaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/patch_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/patch_ca_parameters.go deleted file mode 100644 index ba7052208..000000000 --- a/rest_management_api_server/operations/certificate_authority/patch_ca_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchCaParams creates a new PatchCaParams object -// -// There are no default values defined in the spec. -func NewPatchCaParams() PatchCaParams { - - return PatchCaParams{} -} - -// PatchCaParams contains all the bound params for the patch ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchCa -type PatchCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A CA patch object - Required: true - In: body - */ - Ca *rest_model.CaPatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchCaParams() beforehand. -func (o *PatchCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.CaPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("ca", "body", "")) - } else { - res = append(res, errors.NewParseError("ca", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Ca = &body - } - } - } else { - res = append(res, errors.Required("ca", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/patch_ca_responses.go b/rest_management_api_server/operations/certificate_authority/patch_ca_responses.go deleted file mode 100644 index ba2383a5b..000000000 --- a/rest_management_api_server/operations/certificate_authority/patch_ca_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchCaOKCode is the HTTP code returned for type PatchCaOK -const PatchCaOKCode int = 200 - -/*PatchCaOK The patch request was successful and the resource has been altered - -swagger:response patchCaOK -*/ -type PatchCaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchCaOK creates PatchCaOK with default headers values -func NewPatchCaOK() *PatchCaOK { - - return &PatchCaOK{} -} - -// WithPayload adds the payload to the patch ca o k response -func (o *PatchCaOK) WithPayload(payload *rest_model.Empty) *PatchCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch ca o k response -func (o *PatchCaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCaBadRequestCode is the HTTP code returned for type PatchCaBadRequest -const PatchCaBadRequestCode int = 400 - -/*PatchCaBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchCaBadRequest -*/ -type PatchCaBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCaBadRequest creates PatchCaBadRequest with default headers values -func NewPatchCaBadRequest() *PatchCaBadRequest { - - return &PatchCaBadRequest{} -} - -// WithPayload adds the payload to the patch ca bad request response -func (o *PatchCaBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCaBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch ca bad request response -func (o *PatchCaBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCaBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCaUnauthorizedCode is the HTTP code returned for type PatchCaUnauthorized -const PatchCaUnauthorizedCode int = 401 - -/*PatchCaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchCaUnauthorized -*/ -type PatchCaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCaUnauthorized creates PatchCaUnauthorized with default headers values -func NewPatchCaUnauthorized() *PatchCaUnauthorized { - - return &PatchCaUnauthorized{} -} - -// WithPayload adds the payload to the patch ca unauthorized response -func (o *PatchCaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch ca unauthorized response -func (o *PatchCaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCaNotFoundCode is the HTTP code returned for type PatchCaNotFound -const PatchCaNotFoundCode int = 404 - -/*PatchCaNotFound The requested resource does not exist - -swagger:response patchCaNotFound -*/ -type PatchCaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCaNotFound creates PatchCaNotFound with default headers values -func NewPatchCaNotFound() *PatchCaNotFound { - - return &PatchCaNotFound{} -} - -// WithPayload adds the payload to the patch ca not found response -func (o *PatchCaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch ca not found response -func (o *PatchCaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/patch_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/patch_ca_urlbuilder.go deleted file mode 100644 index c0585f0e4..000000000 --- a/rest_management_api_server/operations/certificate_authority/patch_ca_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchCaURL generates an URL for the patch ca operation -type PatchCaURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchCaURL) WithBasePath(bp string) *PatchCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchCaURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/update_ca.go b/rest_management_api_server/operations/certificate_authority/update_ca.go deleted file mode 100644 index 188f2f934..000000000 --- a/rest_management_api_server/operations/certificate_authority/update_ca.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateCaHandlerFunc turns a function with the right signature into a update ca handler -type UpdateCaHandlerFunc func(UpdateCaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateCaHandlerFunc) Handle(params UpdateCaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateCaHandler interface for that can handle valid update ca params -type UpdateCaHandler interface { - Handle(UpdateCaParams, interface{}) middleware.Responder -} - -// NewUpdateCa creates a new http.Handler for the update ca operation -func NewUpdateCa(ctx *middleware.Context, handler UpdateCaHandler) *UpdateCa { - return &UpdateCa{Context: ctx, Handler: handler} -} - -/* UpdateCa swagger:route PUT /cas/{id} Certificate Authority updateCa - -Update all fields on a CA - -Update all fields on a CA by id. Requires admin access. - -*/ -type UpdateCa struct { - Context *middleware.Context - Handler UpdateCaHandler -} - -func (o *UpdateCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateCaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/update_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/update_ca_parameters.go deleted file mode 100644 index 3523f756f..000000000 --- a/rest_management_api_server/operations/certificate_authority/update_ca_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateCaParams creates a new UpdateCaParams object -// -// There are no default values defined in the spec. -func NewUpdateCaParams() UpdateCaParams { - - return UpdateCaParams{} -} - -// UpdateCaParams contains all the bound params for the update ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateCa -type UpdateCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A CA update object - Required: true - In: body - */ - Ca *rest_model.CaUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateCaParams() beforehand. -func (o *UpdateCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.CaUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("ca", "body", "")) - } else { - res = append(res, errors.NewParseError("ca", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Ca = &body - } - } - } else { - res = append(res, errors.Required("ca", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/update_ca_responses.go b/rest_management_api_server/operations/certificate_authority/update_ca_responses.go deleted file mode 100644 index 92f9b9da2..000000000 --- a/rest_management_api_server/operations/certificate_authority/update_ca_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateCaOKCode is the HTTP code returned for type UpdateCaOK -const UpdateCaOKCode int = 200 - -/*UpdateCaOK The update request was successful and the resource has been altered - -swagger:response updateCaOK -*/ -type UpdateCaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateCaOK creates UpdateCaOK with default headers values -func NewUpdateCaOK() *UpdateCaOK { - - return &UpdateCaOK{} -} - -// WithPayload adds the payload to the update ca o k response -func (o *UpdateCaOK) WithPayload(payload *rest_model.Empty) *UpdateCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update ca o k response -func (o *UpdateCaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCaBadRequestCode is the HTTP code returned for type UpdateCaBadRequest -const UpdateCaBadRequestCode int = 400 - -/*UpdateCaBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateCaBadRequest -*/ -type UpdateCaBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCaBadRequest creates UpdateCaBadRequest with default headers values -func NewUpdateCaBadRequest() *UpdateCaBadRequest { - - return &UpdateCaBadRequest{} -} - -// WithPayload adds the payload to the update ca bad request response -func (o *UpdateCaBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCaBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update ca bad request response -func (o *UpdateCaBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCaBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCaUnauthorizedCode is the HTTP code returned for type UpdateCaUnauthorized -const UpdateCaUnauthorizedCode int = 401 - -/*UpdateCaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateCaUnauthorized -*/ -type UpdateCaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCaUnauthorized creates UpdateCaUnauthorized with default headers values -func NewUpdateCaUnauthorized() *UpdateCaUnauthorized { - - return &UpdateCaUnauthorized{} -} - -// WithPayload adds the payload to the update ca unauthorized response -func (o *UpdateCaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update ca unauthorized response -func (o *UpdateCaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCaNotFoundCode is the HTTP code returned for type UpdateCaNotFound -const UpdateCaNotFoundCode int = 404 - -/*UpdateCaNotFound The requested resource does not exist - -swagger:response updateCaNotFound -*/ -type UpdateCaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCaNotFound creates UpdateCaNotFound with default headers values -func NewUpdateCaNotFound() *UpdateCaNotFound { - - return &UpdateCaNotFound{} -} - -// WithPayload adds the payload to the update ca not found response -func (o *UpdateCaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update ca not found response -func (o *UpdateCaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/update_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/update_ca_urlbuilder.go deleted file mode 100644 index 2a354d8a0..000000000 --- a/rest_management_api_server/operations/certificate_authority/update_ca_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateCaURL generates an URL for the update ca operation -type UpdateCaURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCaURL) WithBasePath(bp string) *UpdateCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateCaURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/certificate_authority/verify_ca.go b/rest_management_api_server/operations/certificate_authority/verify_ca.go deleted file mode 100644 index b54fb2d3c..000000000 --- a/rest_management_api_server/operations/certificate_authority/verify_ca.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// VerifyCaHandlerFunc turns a function with the right signature into a verify ca handler -type VerifyCaHandlerFunc func(VerifyCaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn VerifyCaHandlerFunc) Handle(params VerifyCaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// VerifyCaHandler interface for that can handle valid verify ca params -type VerifyCaHandler interface { - Handle(VerifyCaParams, interface{}) middleware.Responder -} - -// NewVerifyCa creates a new http.Handler for the verify ca operation -func NewVerifyCa(ctx *middleware.Context, handler VerifyCaHandler) *VerifyCa { - return &VerifyCa{Context: ctx, Handler: handler} -} - -/* VerifyCa swagger:route POST /cas/{id}/verify Certificate Authority verifyCa - -Verify a CA - -Allows a CA to become verified by submitting a certificate in PEM format that has been signed by the target CA. -The common name on the certificate must match the verificationToken property of the CA. Unverfieid CAs can not -be used for enrollment/authentication. Requires admin access. - - -*/ -type VerifyCa struct { - Context *middleware.Context - Handler VerifyCaHandler -} - -func (o *VerifyCa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewVerifyCaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/certificate_authority/verify_ca_parameters.go b/rest_management_api_server/operations/certificate_authority/verify_ca_parameters.go deleted file mode 100644 index b84577062..000000000 --- a/rest_management_api_server/operations/certificate_authority/verify_ca_parameters.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewVerifyCaParams creates a new VerifyCaParams object -// -// There are no default values defined in the spec. -func NewVerifyCaParams() VerifyCaParams { - - return VerifyCaParams{} -} - -// VerifyCaParams contains all the bound params for the verify ca operation -// typically these are obtained from a http.Request -// -// swagger:parameters verifyCa -type VerifyCaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A PEM formatted certificate signed by the target CA with the common name matching the CA's validationToken - Required: true - In: body - */ - Certificate string - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewVerifyCaParams() beforehand. -func (o *VerifyCaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body string - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("certificate", "body", "")) - } else { - res = append(res, errors.NewParseError("certificate", "body", "", err)) - } - } else { - // no validation required on inline body - o.Certificate = body - } - } else { - res = append(res, errors.Required("certificate", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *VerifyCaParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/certificate_authority/verify_ca_responses.go b/rest_management_api_server/operations/certificate_authority/verify_ca_responses.go deleted file mode 100644 index f75790416..000000000 --- a/rest_management_api_server/operations/certificate_authority/verify_ca_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// VerifyCaOKCode is the HTTP code returned for type VerifyCaOK -const VerifyCaOKCode int = 200 - -/*VerifyCaOK Base empty response - -swagger:response verifyCaOK -*/ -type VerifyCaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewVerifyCaOK creates VerifyCaOK with default headers values -func NewVerifyCaOK() *VerifyCaOK { - - return &VerifyCaOK{} -} - -// WithPayload adds the payload to the verify ca o k response -func (o *VerifyCaOK) WithPayload(payload *rest_model.Empty) *VerifyCaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify ca o k response -func (o *VerifyCaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyCaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyCaBadRequestCode is the HTTP code returned for type VerifyCaBadRequest -const VerifyCaBadRequestCode int = 400 - -/*VerifyCaBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response verifyCaBadRequest -*/ -type VerifyCaBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyCaBadRequest creates VerifyCaBadRequest with default headers values -func NewVerifyCaBadRequest() *VerifyCaBadRequest { - - return &VerifyCaBadRequest{} -} - -// WithPayload adds the payload to the verify ca bad request response -func (o *VerifyCaBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyCaBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify ca bad request response -func (o *VerifyCaBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyCaBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyCaUnauthorizedCode is the HTTP code returned for type VerifyCaUnauthorized -const VerifyCaUnauthorizedCode int = 401 - -/*VerifyCaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response verifyCaUnauthorized -*/ -type VerifyCaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyCaUnauthorized creates VerifyCaUnauthorized with default headers values -func NewVerifyCaUnauthorized() *VerifyCaUnauthorized { - - return &VerifyCaUnauthorized{} -} - -// WithPayload adds the payload to the verify ca unauthorized response -func (o *VerifyCaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyCaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify ca unauthorized response -func (o *VerifyCaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyCaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyCaNotFoundCode is the HTTP code returned for type VerifyCaNotFound -const VerifyCaNotFoundCode int = 404 - -/*VerifyCaNotFound The requested resource does not exist - -swagger:response verifyCaNotFound -*/ -type VerifyCaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyCaNotFound creates VerifyCaNotFound with default headers values -func NewVerifyCaNotFound() *VerifyCaNotFound { - - return &VerifyCaNotFound{} -} - -// WithPayload adds the payload to the verify ca not found response -func (o *VerifyCaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyCaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify ca not found response -func (o *VerifyCaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyCaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/certificate_authority/verify_ca_urlbuilder.go b/rest_management_api_server/operations/certificate_authority/verify_ca_urlbuilder.go deleted file mode 100644 index a68b80285..000000000 --- a/rest_management_api_server/operations/certificate_authority/verify_ca_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package certificate_authority - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// VerifyCaURL generates an URL for the verify ca operation -type VerifyCaURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VerifyCaURL) WithBasePath(bp string) *VerifyCaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VerifyCaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *VerifyCaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/cas/{id}/verify" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on VerifyCaURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *VerifyCaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *VerifyCaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *VerifyCaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on VerifyCaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on VerifyCaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *VerifyCaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/create_config.go b/rest_management_api_server/operations/config/create_config.go deleted file mode 100644 index efde6201e..000000000 --- a/rest_management_api_server/operations/config/create_config.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateConfigHandlerFunc turns a function with the right signature into a create config handler -type CreateConfigHandlerFunc func(CreateConfigParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateConfigHandlerFunc) Handle(params CreateConfigParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateConfigHandler interface for that can handle valid create config params -type CreateConfigHandler interface { - Handle(CreateConfigParams, interface{}) middleware.Responder -} - -// NewCreateConfig creates a new http.Handler for the create config operation -func NewCreateConfig(ctx *middleware.Context, handler CreateConfigHandler) *CreateConfig { - return &CreateConfig{Context: ctx, Handler: handler} -} - -/* CreateConfig swagger:route POST /configs Config createConfig - -Create a config resource - -Create a config resource. Requires admin access. - -*/ -type CreateConfig struct { - Context *middleware.Context - Handler CreateConfigHandler -} - -func (o *CreateConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateConfigParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/create_config_parameters.go b/rest_management_api_server/operations/config/create_config_parameters.go deleted file mode 100644 index f804edfbf..000000000 --- a/rest_management_api_server/operations/config/create_config_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateConfigParams creates a new CreateConfigParams object -// -// There are no default values defined in the spec. -func NewCreateConfigParams() CreateConfigParams { - - return CreateConfigParams{} -} - -// CreateConfigParams contains all the bound params for the create config operation -// typically these are obtained from a http.Request -// -// swagger:parameters createConfig -type CreateConfigParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A config to create - Required: true - In: body - */ - Config *rest_model.ConfigCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateConfigParams() beforehand. -func (o *CreateConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ConfigCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("config", "body", "")) - } else { - res = append(res, errors.NewParseError("config", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Config = &body - } - } - } else { - res = append(res, errors.Required("config", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/config/create_config_responses.go b/rest_management_api_server/operations/config/create_config_responses.go deleted file mode 100644 index 9b8f331a6..000000000 --- a/rest_management_api_server/operations/config/create_config_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateConfigCreatedCode is the HTTP code returned for type CreateConfigCreated -const CreateConfigCreatedCode int = 201 - -/*CreateConfigCreated The create request was successful and the resource has been added at the following location - -swagger:response createConfigCreated -*/ -type CreateConfigCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateConfigCreated creates CreateConfigCreated with default headers values -func NewCreateConfigCreated() *CreateConfigCreated { - - return &CreateConfigCreated{} -} - -// WithPayload adds the payload to the create config created response -func (o *CreateConfigCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateConfigCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create config created response -func (o *CreateConfigCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateConfigCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateConfigBadRequestCode is the HTTP code returned for type CreateConfigBadRequest -const CreateConfigBadRequestCode int = 400 - -/*CreateConfigBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createConfigBadRequest -*/ -type CreateConfigBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateConfigBadRequest creates CreateConfigBadRequest with default headers values -func NewCreateConfigBadRequest() *CreateConfigBadRequest { - - return &CreateConfigBadRequest{} -} - -// WithPayload adds the payload to the create config bad request response -func (o *CreateConfigBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateConfigBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create config bad request response -func (o *CreateConfigBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateConfigUnauthorizedCode is the HTTP code returned for type CreateConfigUnauthorized -const CreateConfigUnauthorizedCode int = 401 - -/*CreateConfigUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createConfigUnauthorized -*/ -type CreateConfigUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateConfigUnauthorized creates CreateConfigUnauthorized with default headers values -func NewCreateConfigUnauthorized() *CreateConfigUnauthorized { - - return &CreateConfigUnauthorized{} -} - -// WithPayload adds the payload to the create config unauthorized response -func (o *CreateConfigUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateConfigUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create config unauthorized response -func (o *CreateConfigUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateConfigUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/create_config_type.go b/rest_management_api_server/operations/config/create_config_type.go deleted file mode 100644 index cbeb1009f..000000000 --- a/rest_management_api_server/operations/config/create_config_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateConfigTypeHandlerFunc turns a function with the right signature into a create config type handler -type CreateConfigTypeHandlerFunc func(CreateConfigTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateConfigTypeHandlerFunc) Handle(params CreateConfigTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateConfigTypeHandler interface for that can handle valid create config type params -type CreateConfigTypeHandler interface { - Handle(CreateConfigTypeParams, interface{}) middleware.Responder -} - -// NewCreateConfigType creates a new http.Handler for the create config type operation -func NewCreateConfigType(ctx *middleware.Context, handler CreateConfigTypeHandler) *CreateConfigType { - return &CreateConfigType{Context: ctx, Handler: handler} -} - -/* CreateConfigType swagger:route POST /config-types Config createConfigType - -Create a config-type. Requires admin access. - -*/ -type CreateConfigType struct { - Context *middleware.Context - Handler CreateConfigTypeHandler -} - -func (o *CreateConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateConfigTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/create_config_type_parameters.go b/rest_management_api_server/operations/config/create_config_type_parameters.go deleted file mode 100644 index 96d9ed11e..000000000 --- a/rest_management_api_server/operations/config/create_config_type_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateConfigTypeParams creates a new CreateConfigTypeParams object -// -// There are no default values defined in the spec. -func NewCreateConfigTypeParams() CreateConfigTypeParams { - - return CreateConfigTypeParams{} -} - -// CreateConfigTypeParams contains all the bound params for the create config type operation -// typically these are obtained from a http.Request -// -// swagger:parameters createConfigType -type CreateConfigTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A config-type to create - Required: true - In: body - */ - ConfigType *rest_model.ConfigTypeCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateConfigTypeParams() beforehand. -func (o *CreateConfigTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ConfigTypeCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("configType", "body", "")) - } else { - res = append(res, errors.NewParseError("configType", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ConfigType = &body - } - } - } else { - res = append(res, errors.Required("configType", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/config/create_config_type_responses.go b/rest_management_api_server/operations/config/create_config_type_responses.go deleted file mode 100644 index fba13c6c9..000000000 --- a/rest_management_api_server/operations/config/create_config_type_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateConfigTypeCreatedCode is the HTTP code returned for type CreateConfigTypeCreated -const CreateConfigTypeCreatedCode int = 201 - -/*CreateConfigTypeCreated The create request was successful and the resource has been added at the following location - -swagger:response createConfigTypeCreated -*/ -type CreateConfigTypeCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateConfigTypeCreated creates CreateConfigTypeCreated with default headers values -func NewCreateConfigTypeCreated() *CreateConfigTypeCreated { - - return &CreateConfigTypeCreated{} -} - -// WithPayload adds the payload to the create config type created response -func (o *CreateConfigTypeCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateConfigTypeCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create config type created response -func (o *CreateConfigTypeCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateConfigTypeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateConfigTypeBadRequestCode is the HTTP code returned for type CreateConfigTypeBadRequest -const CreateConfigTypeBadRequestCode int = 400 - -/*CreateConfigTypeBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createConfigTypeBadRequest -*/ -type CreateConfigTypeBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateConfigTypeBadRequest creates CreateConfigTypeBadRequest with default headers values -func NewCreateConfigTypeBadRequest() *CreateConfigTypeBadRequest { - - return &CreateConfigTypeBadRequest{} -} - -// WithPayload adds the payload to the create config type bad request response -func (o *CreateConfigTypeBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateConfigTypeBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create config type bad request response -func (o *CreateConfigTypeBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateConfigTypeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateConfigTypeUnauthorizedCode is the HTTP code returned for type CreateConfigTypeUnauthorized -const CreateConfigTypeUnauthorizedCode int = 401 - -/*CreateConfigTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createConfigTypeUnauthorized -*/ -type CreateConfigTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateConfigTypeUnauthorized creates CreateConfigTypeUnauthorized with default headers values -func NewCreateConfigTypeUnauthorized() *CreateConfigTypeUnauthorized { - - return &CreateConfigTypeUnauthorized{} -} - -// WithPayload adds the payload to the create config type unauthorized response -func (o *CreateConfigTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateConfigTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create config type unauthorized response -func (o *CreateConfigTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateConfigTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/create_config_type_urlbuilder.go b/rest_management_api_server/operations/config/create_config_type_urlbuilder.go deleted file mode 100644 index 641659e90..000000000 --- a/rest_management_api_server/operations/config/create_config_type_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateConfigTypeURL generates an URL for the create config type operation -type CreateConfigTypeURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateConfigTypeURL) WithBasePath(bp string) *CreateConfigTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateConfigTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateConfigTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateConfigTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateConfigTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateConfigTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateConfigTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateConfigTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateConfigTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/create_config_urlbuilder.go b/rest_management_api_server/operations/config/create_config_urlbuilder.go deleted file mode 100644 index b89dab78d..000000000 --- a/rest_management_api_server/operations/config/create_config_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateConfigURL generates an URL for the create config operation -type CreateConfigURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateConfigURL) WithBasePath(bp string) *CreateConfigURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateConfigURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateConfigURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/configs" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateConfigURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateConfigURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateConfigURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateConfigURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateConfigURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateConfigURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/delete_config.go b/rest_management_api_server/operations/config/delete_config.go deleted file mode 100644 index 64025a6ac..000000000 --- a/rest_management_api_server/operations/config/delete_config.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteConfigHandlerFunc turns a function with the right signature into a delete config handler -type DeleteConfigHandlerFunc func(DeleteConfigParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteConfigHandlerFunc) Handle(params DeleteConfigParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteConfigHandler interface for that can handle valid delete config params -type DeleteConfigHandler interface { - Handle(DeleteConfigParams, interface{}) middleware.Responder -} - -// NewDeleteConfig creates a new http.Handler for the delete config operation -func NewDeleteConfig(ctx *middleware.Context, handler DeleteConfigHandler) *DeleteConfig { - return &DeleteConfig{Context: ctx, Handler: handler} -} - -/* DeleteConfig swagger:route DELETE /configs/{id} Config deleteConfig - -Delete a config - -Delete a config by id. Requires admin access. - -*/ -type DeleteConfig struct { - Context *middleware.Context - Handler DeleteConfigHandler -} - -func (o *DeleteConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteConfigParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/delete_config_parameters.go b/rest_management_api_server/operations/config/delete_config_parameters.go deleted file mode 100644 index d5b9ecc87..000000000 --- a/rest_management_api_server/operations/config/delete_config_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteConfigParams creates a new DeleteConfigParams object -// -// There are no default values defined in the spec. -func NewDeleteConfigParams() DeleteConfigParams { - - return DeleteConfigParams{} -} - -// DeleteConfigParams contains all the bound params for the delete config operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteConfig -type DeleteConfigParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteConfigParams() beforehand. -func (o *DeleteConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteConfigParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/delete_config_responses.go b/rest_management_api_server/operations/config/delete_config_responses.go deleted file mode 100644 index 95ee17481..000000000 --- a/rest_management_api_server/operations/config/delete_config_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteConfigOKCode is the HTTP code returned for type DeleteConfigOK -const DeleteConfigOKCode int = 200 - -/*DeleteConfigOK The delete request was successful and the resource has been removed - -swagger:response deleteConfigOK -*/ -type DeleteConfigOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteConfigOK creates DeleteConfigOK with default headers values -func NewDeleteConfigOK() *DeleteConfigOK { - - return &DeleteConfigOK{} -} - -// WithPayload adds the payload to the delete config o k response -func (o *DeleteConfigOK) WithPayload(payload *rest_model.Empty) *DeleteConfigOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config o k response -func (o *DeleteConfigOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteConfigBadRequestCode is the HTTP code returned for type DeleteConfigBadRequest -const DeleteConfigBadRequestCode int = 400 - -/*DeleteConfigBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteConfigBadRequest -*/ -type DeleteConfigBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteConfigBadRequest creates DeleteConfigBadRequest with default headers values -func NewDeleteConfigBadRequest() *DeleteConfigBadRequest { - - return &DeleteConfigBadRequest{} -} - -// WithPayload adds the payload to the delete config bad request response -func (o *DeleteConfigBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteConfigBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config bad request response -func (o *DeleteConfigBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteConfigUnauthorizedCode is the HTTP code returned for type DeleteConfigUnauthorized -const DeleteConfigUnauthorizedCode int = 401 - -/*DeleteConfigUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteConfigUnauthorized -*/ -type DeleteConfigUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteConfigUnauthorized creates DeleteConfigUnauthorized with default headers values -func NewDeleteConfigUnauthorized() *DeleteConfigUnauthorized { - - return &DeleteConfigUnauthorized{} -} - -// WithPayload adds the payload to the delete config unauthorized response -func (o *DeleteConfigUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteConfigUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config unauthorized response -func (o *DeleteConfigUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteConfigConflictCode is the HTTP code returned for type DeleteConfigConflict -const DeleteConfigConflictCode int = 409 - -/*DeleteConfigConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteConfigConflict -*/ -type DeleteConfigConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteConfigConflict creates DeleteConfigConflict with default headers values -func NewDeleteConfigConflict() *DeleteConfigConflict { - - return &DeleteConfigConflict{} -} - -// WithPayload adds the payload to the delete config conflict response -func (o *DeleteConfigConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteConfigConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config conflict response -func (o *DeleteConfigConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/delete_config_type.go b/rest_management_api_server/operations/config/delete_config_type.go deleted file mode 100644 index d5e5892f5..000000000 --- a/rest_management_api_server/operations/config/delete_config_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteConfigTypeHandlerFunc turns a function with the right signature into a delete config type handler -type DeleteConfigTypeHandlerFunc func(DeleteConfigTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteConfigTypeHandlerFunc) Handle(params DeleteConfigTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteConfigTypeHandler interface for that can handle valid delete config type params -type DeleteConfigTypeHandler interface { - Handle(DeleteConfigTypeParams, interface{}) middleware.Responder -} - -// NewDeleteConfigType creates a new http.Handler for the delete config type operation -func NewDeleteConfigType(ctx *middleware.Context, handler DeleteConfigTypeHandler) *DeleteConfigType { - return &DeleteConfigType{Context: ctx, Handler: handler} -} - -/* DeleteConfigType swagger:route DELETE /config-types/{id} Config deleteConfigType - -Delete a config-type - -Delete a config-type by id. Removing a configuration type that are in use will result in a 409 conflict HTTP status code and error. All configurations of a type must be removed first. - -*/ -type DeleteConfigType struct { - Context *middleware.Context - Handler DeleteConfigTypeHandler -} - -func (o *DeleteConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteConfigTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/delete_config_type_parameters.go b/rest_management_api_server/operations/config/delete_config_type_parameters.go deleted file mode 100644 index bcad5f2bd..000000000 --- a/rest_management_api_server/operations/config/delete_config_type_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteConfigTypeParams creates a new DeleteConfigTypeParams object -// -// There are no default values defined in the spec. -func NewDeleteConfigTypeParams() DeleteConfigTypeParams { - - return DeleteConfigTypeParams{} -} - -// DeleteConfigTypeParams contains all the bound params for the delete config type operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteConfigType -type DeleteConfigTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteConfigTypeParams() beforehand. -func (o *DeleteConfigTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteConfigTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/delete_config_type_responses.go b/rest_management_api_server/operations/config/delete_config_type_responses.go deleted file mode 100644 index 297e17244..000000000 --- a/rest_management_api_server/operations/config/delete_config_type_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteConfigTypeOKCode is the HTTP code returned for type DeleteConfigTypeOK -const DeleteConfigTypeOKCode int = 200 - -/*DeleteConfigTypeOK The delete request was successful and the resource has been removed - -swagger:response deleteConfigTypeOK -*/ -type DeleteConfigTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteConfigTypeOK creates DeleteConfigTypeOK with default headers values -func NewDeleteConfigTypeOK() *DeleteConfigTypeOK { - - return &DeleteConfigTypeOK{} -} - -// WithPayload adds the payload to the delete config type o k response -func (o *DeleteConfigTypeOK) WithPayload(payload *rest_model.Empty) *DeleteConfigTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config type o k response -func (o *DeleteConfigTypeOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteConfigTypeBadRequestCode is the HTTP code returned for type DeleteConfigTypeBadRequest -const DeleteConfigTypeBadRequestCode int = 400 - -/*DeleteConfigTypeBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteConfigTypeBadRequest -*/ -type DeleteConfigTypeBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteConfigTypeBadRequest creates DeleteConfigTypeBadRequest with default headers values -func NewDeleteConfigTypeBadRequest() *DeleteConfigTypeBadRequest { - - return &DeleteConfigTypeBadRequest{} -} - -// WithPayload adds the payload to the delete config type bad request response -func (o *DeleteConfigTypeBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteConfigTypeBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config type bad request response -func (o *DeleteConfigTypeBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigTypeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteConfigTypeUnauthorizedCode is the HTTP code returned for type DeleteConfigTypeUnauthorized -const DeleteConfigTypeUnauthorizedCode int = 401 - -/*DeleteConfigTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteConfigTypeUnauthorized -*/ -type DeleteConfigTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteConfigTypeUnauthorized creates DeleteConfigTypeUnauthorized with default headers values -func NewDeleteConfigTypeUnauthorized() *DeleteConfigTypeUnauthorized { - - return &DeleteConfigTypeUnauthorized{} -} - -// WithPayload adds the payload to the delete config type unauthorized response -func (o *DeleteConfigTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteConfigTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config type unauthorized response -func (o *DeleteConfigTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteConfigTypeConflictCode is the HTTP code returned for type DeleteConfigTypeConflict -const DeleteConfigTypeConflictCode int = 409 - -/*DeleteConfigTypeConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteConfigTypeConflict -*/ -type DeleteConfigTypeConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteConfigTypeConflict creates DeleteConfigTypeConflict with default headers values -func NewDeleteConfigTypeConflict() *DeleteConfigTypeConflict { - - return &DeleteConfigTypeConflict{} -} - -// WithPayload adds the payload to the delete config type conflict response -func (o *DeleteConfigTypeConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteConfigTypeConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete config type conflict response -func (o *DeleteConfigTypeConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteConfigTypeConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/delete_config_type_urlbuilder.go b/rest_management_api_server/operations/config/delete_config_type_urlbuilder.go deleted file mode 100644 index 7c35a4b93..000000000 --- a/rest_management_api_server/operations/config/delete_config_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteConfigTypeURL generates an URL for the delete config type operation -type DeleteConfigTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteConfigTypeURL) WithBasePath(bp string) *DeleteConfigTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteConfigTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteConfigTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteConfigTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteConfigTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteConfigTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteConfigTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteConfigTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteConfigTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteConfigTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/delete_config_urlbuilder.go b/rest_management_api_server/operations/config/delete_config_urlbuilder.go deleted file mode 100644 index 62c1fb4c9..000000000 --- a/rest_management_api_server/operations/config/delete_config_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteConfigURL generates an URL for the delete config operation -type DeleteConfigURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteConfigURL) WithBasePath(bp string) *DeleteConfigURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteConfigURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteConfigURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/configs/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteConfigURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteConfigURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteConfigURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteConfigURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteConfigURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteConfigURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteConfigURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/detail_config.go b/rest_management_api_server/operations/config/detail_config.go deleted file mode 100644 index 2bf2cfb10..000000000 --- a/rest_management_api_server/operations/config/detail_config.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailConfigHandlerFunc turns a function with the right signature into a detail config handler -type DetailConfigHandlerFunc func(DetailConfigParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailConfigHandlerFunc) Handle(params DetailConfigParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailConfigHandler interface for that can handle valid detail config params -type DetailConfigHandler interface { - Handle(DetailConfigParams, interface{}) middleware.Responder -} - -// NewDetailConfig creates a new http.Handler for the detail config operation -func NewDetailConfig(ctx *middleware.Context, handler DetailConfigHandler) *DetailConfig { - return &DetailConfig{Context: ctx, Handler: handler} -} - -/* DetailConfig swagger:route GET /configs/{id} Config detailConfig - -Retrieves a single config - -Retrieves a single config by id. Requires admin access. - -*/ -type DetailConfig struct { - Context *middleware.Context - Handler DetailConfigHandler -} - -func (o *DetailConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailConfigParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/detail_config_parameters.go b/rest_management_api_server/operations/config/detail_config_parameters.go deleted file mode 100644 index cf0cbc4b3..000000000 --- a/rest_management_api_server/operations/config/detail_config_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailConfigParams creates a new DetailConfigParams object -// -// There are no default values defined in the spec. -func NewDetailConfigParams() DetailConfigParams { - - return DetailConfigParams{} -} - -// DetailConfigParams contains all the bound params for the detail config operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailConfig -type DetailConfigParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailConfigParams() beforehand. -func (o *DetailConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailConfigParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/detail_config_responses.go b/rest_management_api_server/operations/config/detail_config_responses.go deleted file mode 100644 index f41b79780..000000000 --- a/rest_management_api_server/operations/config/detail_config_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailConfigOKCode is the HTTP code returned for type DetailConfigOK -const DetailConfigOKCode int = 200 - -/*DetailConfigOK A singular config resource - -swagger:response detailConfigOK -*/ -type DetailConfigOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailConfigEnvelope `json:"body,omitempty"` -} - -// NewDetailConfigOK creates DetailConfigOK with default headers values -func NewDetailConfigOK() *DetailConfigOK { - - return &DetailConfigOK{} -} - -// WithPayload adds the payload to the detail config o k response -func (o *DetailConfigOK) WithPayload(payload *rest_model.DetailConfigEnvelope) *DetailConfigOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail config o k response -func (o *DetailConfigOK) SetPayload(payload *rest_model.DetailConfigEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailConfigUnauthorizedCode is the HTTP code returned for type DetailConfigUnauthorized -const DetailConfigUnauthorizedCode int = 401 - -/*DetailConfigUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailConfigUnauthorized -*/ -type DetailConfigUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailConfigUnauthorized creates DetailConfigUnauthorized with default headers values -func NewDetailConfigUnauthorized() *DetailConfigUnauthorized { - - return &DetailConfigUnauthorized{} -} - -// WithPayload adds the payload to the detail config unauthorized response -func (o *DetailConfigUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailConfigUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail config unauthorized response -func (o *DetailConfigUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailConfigUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailConfigNotFoundCode is the HTTP code returned for type DetailConfigNotFound -const DetailConfigNotFoundCode int = 404 - -/*DetailConfigNotFound The requested resource does not exist - -swagger:response detailConfigNotFound -*/ -type DetailConfigNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailConfigNotFound creates DetailConfigNotFound with default headers values -func NewDetailConfigNotFound() *DetailConfigNotFound { - - return &DetailConfigNotFound{} -} - -// WithPayload adds the payload to the detail config not found response -func (o *DetailConfigNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailConfigNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail config not found response -func (o *DetailConfigNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailConfigNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/detail_config_type.go b/rest_management_api_server/operations/config/detail_config_type.go deleted file mode 100644 index 4066dcc57..000000000 --- a/rest_management_api_server/operations/config/detail_config_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailConfigTypeHandlerFunc turns a function with the right signature into a detail config type handler -type DetailConfigTypeHandlerFunc func(DetailConfigTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailConfigTypeHandlerFunc) Handle(params DetailConfigTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailConfigTypeHandler interface for that can handle valid detail config type params -type DetailConfigTypeHandler interface { - Handle(DetailConfigTypeParams, interface{}) middleware.Responder -} - -// NewDetailConfigType creates a new http.Handler for the detail config type operation -func NewDetailConfigType(ctx *middleware.Context, handler DetailConfigTypeHandler) *DetailConfigType { - return &DetailConfigType{Context: ctx, Handler: handler} -} - -/* DetailConfigType swagger:route GET /config-types/{id} Config detailConfigType - -Retrieves a single config-type - -Retrieves a single config-type by id. Requires admin access. - -*/ -type DetailConfigType struct { - Context *middleware.Context - Handler DetailConfigTypeHandler -} - -func (o *DetailConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailConfigTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/detail_config_type_parameters.go b/rest_management_api_server/operations/config/detail_config_type_parameters.go deleted file mode 100644 index 53f2e0bb8..000000000 --- a/rest_management_api_server/operations/config/detail_config_type_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailConfigTypeParams creates a new DetailConfigTypeParams object -// -// There are no default values defined in the spec. -func NewDetailConfigTypeParams() DetailConfigTypeParams { - - return DetailConfigTypeParams{} -} - -// DetailConfigTypeParams contains all the bound params for the detail config type operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailConfigType -type DetailConfigTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailConfigTypeParams() beforehand. -func (o *DetailConfigTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailConfigTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/detail_config_type_responses.go b/rest_management_api_server/operations/config/detail_config_type_responses.go deleted file mode 100644 index 848714dc7..000000000 --- a/rest_management_api_server/operations/config/detail_config_type_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailConfigTypeOKCode is the HTTP code returned for type DetailConfigTypeOK -const DetailConfigTypeOKCode int = 200 - -/*DetailConfigTypeOK A singular config-type resource - -swagger:response detailConfigTypeOK -*/ -type DetailConfigTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailConfigTypeEnvelope `json:"body,omitempty"` -} - -// NewDetailConfigTypeOK creates DetailConfigTypeOK with default headers values -func NewDetailConfigTypeOK() *DetailConfigTypeOK { - - return &DetailConfigTypeOK{} -} - -// WithPayload adds the payload to the detail config type o k response -func (o *DetailConfigTypeOK) WithPayload(payload *rest_model.DetailConfigTypeEnvelope) *DetailConfigTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail config type o k response -func (o *DetailConfigTypeOK) SetPayload(payload *rest_model.DetailConfigTypeEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailConfigTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailConfigTypeUnauthorizedCode is the HTTP code returned for type DetailConfigTypeUnauthorized -const DetailConfigTypeUnauthorizedCode int = 401 - -/*DetailConfigTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailConfigTypeUnauthorized -*/ -type DetailConfigTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailConfigTypeUnauthorized creates DetailConfigTypeUnauthorized with default headers values -func NewDetailConfigTypeUnauthorized() *DetailConfigTypeUnauthorized { - - return &DetailConfigTypeUnauthorized{} -} - -// WithPayload adds the payload to the detail config type unauthorized response -func (o *DetailConfigTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailConfigTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail config type unauthorized response -func (o *DetailConfigTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailConfigTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailConfigTypeNotFoundCode is the HTTP code returned for type DetailConfigTypeNotFound -const DetailConfigTypeNotFoundCode int = 404 - -/*DetailConfigTypeNotFound The requested resource does not exist - -swagger:response detailConfigTypeNotFound -*/ -type DetailConfigTypeNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailConfigTypeNotFound creates DetailConfigTypeNotFound with default headers values -func NewDetailConfigTypeNotFound() *DetailConfigTypeNotFound { - - return &DetailConfigTypeNotFound{} -} - -// WithPayload adds the payload to the detail config type not found response -func (o *DetailConfigTypeNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailConfigTypeNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail config type not found response -func (o *DetailConfigTypeNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailConfigTypeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/detail_config_type_urlbuilder.go b/rest_management_api_server/operations/config/detail_config_type_urlbuilder.go deleted file mode 100644 index 5fa9b4483..000000000 --- a/rest_management_api_server/operations/config/detail_config_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailConfigTypeURL generates an URL for the detail config type operation -type DetailConfigTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailConfigTypeURL) WithBasePath(bp string) *DetailConfigTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailConfigTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailConfigTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailConfigTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailConfigTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailConfigTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailConfigTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailConfigTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailConfigTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailConfigTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/detail_config_urlbuilder.go b/rest_management_api_server/operations/config/detail_config_urlbuilder.go deleted file mode 100644 index 2b4b60d4d..000000000 --- a/rest_management_api_server/operations/config/detail_config_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailConfigURL generates an URL for the detail config operation -type DetailConfigURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailConfigURL) WithBasePath(bp string) *DetailConfigURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailConfigURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailConfigURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/configs/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailConfigURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailConfigURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailConfigURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailConfigURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailConfigURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailConfigURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailConfigURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/list_config_types.go b/rest_management_api_server/operations/config/list_config_types.go deleted file mode 100644 index fe53a38e2..000000000 --- a/rest_management_api_server/operations/config/list_config_types.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListConfigTypesHandlerFunc turns a function with the right signature into a list config types handler -type ListConfigTypesHandlerFunc func(ListConfigTypesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListConfigTypesHandlerFunc) Handle(params ListConfigTypesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListConfigTypesHandler interface for that can handle valid list config types params -type ListConfigTypesHandler interface { - Handle(ListConfigTypesParams, interface{}) middleware.Responder -} - -// NewListConfigTypes creates a new http.Handler for the list config types operation -func NewListConfigTypes(ctx *middleware.Context, handler ListConfigTypesHandler) *ListConfigTypes { - return &ListConfigTypes{Context: ctx, Handler: handler} -} - -/* ListConfigTypes swagger:route GET /config-types Config listConfigTypes - -List config-types - -Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListConfigTypes struct { - Context *middleware.Context - Handler ListConfigTypesHandler -} - -func (o *ListConfigTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListConfigTypesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/list_config_types_parameters.go b/rest_management_api_server/operations/config/list_config_types_parameters.go deleted file mode 100644 index ef4ade134..000000000 --- a/rest_management_api_server/operations/config/list_config_types_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListConfigTypesParams creates a new ListConfigTypesParams object -// -// There are no default values defined in the spec. -func NewListConfigTypesParams() ListConfigTypesParams { - - return ListConfigTypesParams{} -} - -// ListConfigTypesParams contains all the bound params for the list config types operation -// typically these are obtained from a http.Request -// -// swagger:parameters listConfigTypes -type ListConfigTypesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListConfigTypesParams() beforehand. -func (o *ListConfigTypesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListConfigTypesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListConfigTypesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListConfigTypesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/config/list_config_types_responses.go b/rest_management_api_server/operations/config/list_config_types_responses.go deleted file mode 100644 index 26408935d..000000000 --- a/rest_management_api_server/operations/config/list_config_types_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListConfigTypesOKCode is the HTTP code returned for type ListConfigTypesOK -const ListConfigTypesOKCode int = 200 - -/*ListConfigTypesOK A list of config-types - -swagger:response listConfigTypesOK -*/ -type ListConfigTypesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListConfigTypesEnvelope `json:"body,omitempty"` -} - -// NewListConfigTypesOK creates ListConfigTypesOK with default headers values -func NewListConfigTypesOK() *ListConfigTypesOK { - - return &ListConfigTypesOK{} -} - -// WithPayload adds the payload to the list config types o k response -func (o *ListConfigTypesOK) WithPayload(payload *rest_model.ListConfigTypesEnvelope) *ListConfigTypesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list config types o k response -func (o *ListConfigTypesOK) SetPayload(payload *rest_model.ListConfigTypesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigTypesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListConfigTypesBadRequestCode is the HTTP code returned for type ListConfigTypesBadRequest -const ListConfigTypesBadRequestCode int = 400 - -/*ListConfigTypesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listConfigTypesBadRequest -*/ -type ListConfigTypesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListConfigTypesBadRequest creates ListConfigTypesBadRequest with default headers values -func NewListConfigTypesBadRequest() *ListConfigTypesBadRequest { - - return &ListConfigTypesBadRequest{} -} - -// WithPayload adds the payload to the list config types bad request response -func (o *ListConfigTypesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigTypesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list config types bad request response -func (o *ListConfigTypesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigTypesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListConfigTypesUnauthorizedCode is the HTTP code returned for type ListConfigTypesUnauthorized -const ListConfigTypesUnauthorizedCode int = 401 - -/*ListConfigTypesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listConfigTypesUnauthorized -*/ -type ListConfigTypesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListConfigTypesUnauthorized creates ListConfigTypesUnauthorized with default headers values -func NewListConfigTypesUnauthorized() *ListConfigTypesUnauthorized { - - return &ListConfigTypesUnauthorized{} -} - -// WithPayload adds the payload to the list config types unauthorized response -func (o *ListConfigTypesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigTypesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list config types unauthorized response -func (o *ListConfigTypesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigTypesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/list_config_types_urlbuilder.go b/rest_management_api_server/operations/config/list_config_types_urlbuilder.go deleted file mode 100644 index b5d41efbd..000000000 --- a/rest_management_api_server/operations/config/list_config_types_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListConfigTypesURL generates an URL for the list config types operation -type ListConfigTypesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListConfigTypesURL) WithBasePath(bp string) *ListConfigTypesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListConfigTypesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListConfigTypesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListConfigTypesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListConfigTypesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListConfigTypesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListConfigTypesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListConfigTypesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListConfigTypesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/list_configs.go b/rest_management_api_server/operations/config/list_configs.go deleted file mode 100644 index 6121eef52..000000000 --- a/rest_management_api_server/operations/config/list_configs.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListConfigsHandlerFunc turns a function with the right signature into a list configs handler -type ListConfigsHandlerFunc func(ListConfigsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListConfigsHandlerFunc) Handle(params ListConfigsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListConfigsHandler interface for that can handle valid list configs params -type ListConfigsHandler interface { - Handle(ListConfigsParams, interface{}) middleware.Responder -} - -// NewListConfigs creates a new http.Handler for the list configs operation -func NewListConfigs(ctx *middleware.Context, handler ListConfigsHandler) *ListConfigs { - return &ListConfigs{Context: ctx, Handler: handler} -} - -/* ListConfigs swagger:route GET /configs Config listConfigs - -List configs - -Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListConfigs struct { - Context *middleware.Context - Handler ListConfigsHandler -} - -func (o *ListConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListConfigsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/list_configs_for_config_type.go b/rest_management_api_server/operations/config/list_configs_for_config_type.go deleted file mode 100644 index 78759077f..000000000 --- a/rest_management_api_server/operations/config/list_configs_for_config_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListConfigsForConfigTypeHandlerFunc turns a function with the right signature into a list configs for config type handler -type ListConfigsForConfigTypeHandlerFunc func(ListConfigsForConfigTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListConfigsForConfigTypeHandlerFunc) Handle(params ListConfigsForConfigTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListConfigsForConfigTypeHandler interface for that can handle valid list configs for config type params -type ListConfigsForConfigTypeHandler interface { - Handle(ListConfigsForConfigTypeParams, interface{}) middleware.Responder -} - -// NewListConfigsForConfigType creates a new http.Handler for the list configs for config type operation -func NewListConfigsForConfigType(ctx *middleware.Context, handler ListConfigsForConfigTypeHandler) *ListConfigsForConfigType { - return &ListConfigsForConfigType{Context: ctx, Handler: handler} -} - -/* ListConfigsForConfigType swagger:route GET /config-types/{id}/configs Config listConfigsForConfigType - -Lists the configs of a specific config-type - -Lists the configs associated to a config-type. Requires admin access. - -*/ -type ListConfigsForConfigType struct { - Context *middleware.Context - Handler ListConfigsForConfigTypeHandler -} - -func (o *ListConfigsForConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListConfigsForConfigTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/list_configs_for_config_type_parameters.go b/rest_management_api_server/operations/config/list_configs_for_config_type_parameters.go deleted file mode 100644 index c198c1a9d..000000000 --- a/rest_management_api_server/operations/config/list_configs_for_config_type_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListConfigsForConfigTypeParams creates a new ListConfigsForConfigTypeParams object -// -// There are no default values defined in the spec. -func NewListConfigsForConfigTypeParams() ListConfigsForConfigTypeParams { - - return ListConfigsForConfigTypeParams{} -} - -// ListConfigsForConfigTypeParams contains all the bound params for the list configs for config type operation -// typically these are obtained from a http.Request -// -// swagger:parameters listConfigsForConfigType -type ListConfigsForConfigTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListConfigsForConfigTypeParams() beforehand. -func (o *ListConfigsForConfigTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListConfigsForConfigTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/list_configs_for_config_type_responses.go b/rest_management_api_server/operations/config/list_configs_for_config_type_responses.go deleted file mode 100644 index f89f484a1..000000000 --- a/rest_management_api_server/operations/config/list_configs_for_config_type_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListConfigsForConfigTypeOKCode is the HTTP code returned for type ListConfigsForConfigTypeOK -const ListConfigsForConfigTypeOKCode int = 200 - -/*ListConfigsForConfigTypeOK A list of configs - -swagger:response listConfigsForConfigTypeOK -*/ -type ListConfigsForConfigTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.ListConfigsEnvelope `json:"body,omitempty"` -} - -// NewListConfigsForConfigTypeOK creates ListConfigsForConfigTypeOK with default headers values -func NewListConfigsForConfigTypeOK() *ListConfigsForConfigTypeOK { - - return &ListConfigsForConfigTypeOK{} -} - -// WithPayload adds the payload to the list configs for config type o k response -func (o *ListConfigsForConfigTypeOK) WithPayload(payload *rest_model.ListConfigsEnvelope) *ListConfigsForConfigTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list configs for config type o k response -func (o *ListConfigsForConfigTypeOK) SetPayload(payload *rest_model.ListConfigsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigsForConfigTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/list_configs_for_config_type_urlbuilder.go b/rest_management_api_server/operations/config/list_configs_for_config_type_urlbuilder.go deleted file mode 100644 index fe300a970..000000000 --- a/rest_management_api_server/operations/config/list_configs_for_config_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListConfigsForConfigTypeURL generates an URL for the list configs for config type operation -type ListConfigsForConfigTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListConfigsForConfigTypeURL) WithBasePath(bp string) *ListConfigsForConfigTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListConfigsForConfigTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListConfigsForConfigTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types/{id}/configs" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListConfigsForConfigTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListConfigsForConfigTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListConfigsForConfigTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListConfigsForConfigTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListConfigsForConfigTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListConfigsForConfigTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListConfigsForConfigTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/list_configs_parameters.go b/rest_management_api_server/operations/config/list_configs_parameters.go deleted file mode 100644 index 597f05abd..000000000 --- a/rest_management_api_server/operations/config/list_configs_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListConfigsParams creates a new ListConfigsParams object -// -// There are no default values defined in the spec. -func NewListConfigsParams() ListConfigsParams { - - return ListConfigsParams{} -} - -// ListConfigsParams contains all the bound params for the list configs operation -// typically these are obtained from a http.Request -// -// swagger:parameters listConfigs -type ListConfigsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListConfigsParams() beforehand. -func (o *ListConfigsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListConfigsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListConfigsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListConfigsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/config/list_configs_responses.go b/rest_management_api_server/operations/config/list_configs_responses.go deleted file mode 100644 index f98447371..000000000 --- a/rest_management_api_server/operations/config/list_configs_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListConfigsOKCode is the HTTP code returned for type ListConfigsOK -const ListConfigsOKCode int = 200 - -/*ListConfigsOK A list of configs - -swagger:response listConfigsOK -*/ -type ListConfigsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListConfigsEnvelope `json:"body,omitempty"` -} - -// NewListConfigsOK creates ListConfigsOK with default headers values -func NewListConfigsOK() *ListConfigsOK { - - return &ListConfigsOK{} -} - -// WithPayload adds the payload to the list configs o k response -func (o *ListConfigsOK) WithPayload(payload *rest_model.ListConfigsEnvelope) *ListConfigsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list configs o k response -func (o *ListConfigsOK) SetPayload(payload *rest_model.ListConfigsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListConfigsBadRequestCode is the HTTP code returned for type ListConfigsBadRequest -const ListConfigsBadRequestCode int = 400 - -/*ListConfigsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listConfigsBadRequest -*/ -type ListConfigsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListConfigsBadRequest creates ListConfigsBadRequest with default headers values -func NewListConfigsBadRequest() *ListConfigsBadRequest { - - return &ListConfigsBadRequest{} -} - -// WithPayload adds the payload to the list configs bad request response -func (o *ListConfigsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list configs bad request response -func (o *ListConfigsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListConfigsUnauthorizedCode is the HTTP code returned for type ListConfigsUnauthorized -const ListConfigsUnauthorizedCode int = 401 - -/*ListConfigsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listConfigsUnauthorized -*/ -type ListConfigsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListConfigsUnauthorized creates ListConfigsUnauthorized with default headers values -func NewListConfigsUnauthorized() *ListConfigsUnauthorized { - - return &ListConfigsUnauthorized{} -} - -// WithPayload adds the payload to the list configs unauthorized response -func (o *ListConfigsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListConfigsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list configs unauthorized response -func (o *ListConfigsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListConfigsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/list_configs_urlbuilder.go b/rest_management_api_server/operations/config/list_configs_urlbuilder.go deleted file mode 100644 index f81141485..000000000 --- a/rest_management_api_server/operations/config/list_configs_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListConfigsURL generates an URL for the list configs operation -type ListConfigsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListConfigsURL) WithBasePath(bp string) *ListConfigsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListConfigsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListConfigsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/configs" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListConfigsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListConfigsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListConfigsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListConfigsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListConfigsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListConfigsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/patch_config.go b/rest_management_api_server/operations/config/patch_config.go deleted file mode 100644 index 6320ecadb..000000000 --- a/rest_management_api_server/operations/config/patch_config.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchConfigHandlerFunc turns a function with the right signature into a patch config handler -type PatchConfigHandlerFunc func(PatchConfigParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchConfigHandlerFunc) Handle(params PatchConfigParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchConfigHandler interface for that can handle valid patch config params -type PatchConfigHandler interface { - Handle(PatchConfigParams, interface{}) middleware.Responder -} - -// NewPatchConfig creates a new http.Handler for the patch config operation -func NewPatchConfig(ctx *middleware.Context, handler PatchConfigHandler) *PatchConfig { - return &PatchConfig{Context: ctx, Handler: handler} -} - -/* PatchConfig swagger:route PATCH /configs/{id} Config patchConfig - -Update the supplied fields on a config - -Update the supplied fields on a config. Requires admin access. - -*/ -type PatchConfig struct { - Context *middleware.Context - Handler PatchConfigHandler -} - -func (o *PatchConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchConfigParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/patch_config_parameters.go b/rest_management_api_server/operations/config/patch_config_parameters.go deleted file mode 100644 index fa1b8adbb..000000000 --- a/rest_management_api_server/operations/config/patch_config_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchConfigParams creates a new PatchConfigParams object -// -// There are no default values defined in the spec. -func NewPatchConfigParams() PatchConfigParams { - - return PatchConfigParams{} -} - -// PatchConfigParams contains all the bound params for the patch config operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchConfig -type PatchConfigParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A config patch object - Required: true - In: body - */ - Config *rest_model.ConfigPatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchConfigParams() beforehand. -func (o *PatchConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ConfigPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("config", "body", "")) - } else { - res = append(res, errors.NewParseError("config", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Config = &body - } - } - } else { - res = append(res, errors.Required("config", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchConfigParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/patch_config_responses.go b/rest_management_api_server/operations/config/patch_config_responses.go deleted file mode 100644 index 31be8acb9..000000000 --- a/rest_management_api_server/operations/config/patch_config_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchConfigOKCode is the HTTP code returned for type PatchConfigOK -const PatchConfigOKCode int = 200 - -/*PatchConfigOK The patch request was successful and the resource has been altered - -swagger:response patchConfigOK -*/ -type PatchConfigOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchConfigOK creates PatchConfigOK with default headers values -func NewPatchConfigOK() *PatchConfigOK { - - return &PatchConfigOK{} -} - -// WithPayload adds the payload to the patch config o k response -func (o *PatchConfigOK) WithPayload(payload *rest_model.Empty) *PatchConfigOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config o k response -func (o *PatchConfigOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchConfigBadRequestCode is the HTTP code returned for type PatchConfigBadRequest -const PatchConfigBadRequestCode int = 400 - -/*PatchConfigBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchConfigBadRequest -*/ -type PatchConfigBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchConfigBadRequest creates PatchConfigBadRequest with default headers values -func NewPatchConfigBadRequest() *PatchConfigBadRequest { - - return &PatchConfigBadRequest{} -} - -// WithPayload adds the payload to the patch config bad request response -func (o *PatchConfigBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchConfigBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config bad request response -func (o *PatchConfigBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchConfigUnauthorizedCode is the HTTP code returned for type PatchConfigUnauthorized -const PatchConfigUnauthorizedCode int = 401 - -/*PatchConfigUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchConfigUnauthorized -*/ -type PatchConfigUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchConfigUnauthorized creates PatchConfigUnauthorized with default headers values -func NewPatchConfigUnauthorized() *PatchConfigUnauthorized { - - return &PatchConfigUnauthorized{} -} - -// WithPayload adds the payload to the patch config unauthorized response -func (o *PatchConfigUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchConfigUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config unauthorized response -func (o *PatchConfigUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchConfigNotFoundCode is the HTTP code returned for type PatchConfigNotFound -const PatchConfigNotFoundCode int = 404 - -/*PatchConfigNotFound The requested resource does not exist - -swagger:response patchConfigNotFound -*/ -type PatchConfigNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchConfigNotFound creates PatchConfigNotFound with default headers values -func NewPatchConfigNotFound() *PatchConfigNotFound { - - return &PatchConfigNotFound{} -} - -// WithPayload adds the payload to the patch config not found response -func (o *PatchConfigNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchConfigNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config not found response -func (o *PatchConfigNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/patch_config_type.go b/rest_management_api_server/operations/config/patch_config_type.go deleted file mode 100644 index 86046691b..000000000 --- a/rest_management_api_server/operations/config/patch_config_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchConfigTypeHandlerFunc turns a function with the right signature into a patch config type handler -type PatchConfigTypeHandlerFunc func(PatchConfigTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchConfigTypeHandlerFunc) Handle(params PatchConfigTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchConfigTypeHandler interface for that can handle valid patch config type params -type PatchConfigTypeHandler interface { - Handle(PatchConfigTypeParams, interface{}) middleware.Responder -} - -// NewPatchConfigType creates a new http.Handler for the patch config type operation -func NewPatchConfigType(ctx *middleware.Context, handler PatchConfigTypeHandler) *PatchConfigType { - return &PatchConfigType{Context: ctx, Handler: handler} -} - -/* PatchConfigType swagger:route PATCH /config-types/{id} Config patchConfigType - -Update the supplied fields on a config-type - -Update the supplied fields on a config-type. Requires admin access. - -*/ -type PatchConfigType struct { - Context *middleware.Context - Handler PatchConfigTypeHandler -} - -func (o *PatchConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchConfigTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/patch_config_type_parameters.go b/rest_management_api_server/operations/config/patch_config_type_parameters.go deleted file mode 100644 index 2a843f268..000000000 --- a/rest_management_api_server/operations/config/patch_config_type_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchConfigTypeParams creates a new PatchConfigTypeParams object -// -// There are no default values defined in the spec. -func NewPatchConfigTypeParams() PatchConfigTypeParams { - - return PatchConfigTypeParams{} -} - -// PatchConfigTypeParams contains all the bound params for the patch config type operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchConfigType -type PatchConfigTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A config-type patch object - Required: true - In: body - */ - ConfigType *rest_model.ConfigTypePatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchConfigTypeParams() beforehand. -func (o *PatchConfigTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ConfigTypePatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("configType", "body", "")) - } else { - res = append(res, errors.NewParseError("configType", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ConfigType = &body - } - } - } else { - res = append(res, errors.Required("configType", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchConfigTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/patch_config_type_responses.go b/rest_management_api_server/operations/config/patch_config_type_responses.go deleted file mode 100644 index d035b822b..000000000 --- a/rest_management_api_server/operations/config/patch_config_type_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchConfigTypeOKCode is the HTTP code returned for type PatchConfigTypeOK -const PatchConfigTypeOKCode int = 200 - -/*PatchConfigTypeOK The patch request was successful and the resource has been altered - -swagger:response patchConfigTypeOK -*/ -type PatchConfigTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchConfigTypeOK creates PatchConfigTypeOK with default headers values -func NewPatchConfigTypeOK() *PatchConfigTypeOK { - - return &PatchConfigTypeOK{} -} - -// WithPayload adds the payload to the patch config type o k response -func (o *PatchConfigTypeOK) WithPayload(payload *rest_model.Empty) *PatchConfigTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config type o k response -func (o *PatchConfigTypeOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchConfigTypeBadRequestCode is the HTTP code returned for type PatchConfigTypeBadRequest -const PatchConfigTypeBadRequestCode int = 400 - -/*PatchConfigTypeBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchConfigTypeBadRequest -*/ -type PatchConfigTypeBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchConfigTypeBadRequest creates PatchConfigTypeBadRequest with default headers values -func NewPatchConfigTypeBadRequest() *PatchConfigTypeBadRequest { - - return &PatchConfigTypeBadRequest{} -} - -// WithPayload adds the payload to the patch config type bad request response -func (o *PatchConfigTypeBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchConfigTypeBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config type bad request response -func (o *PatchConfigTypeBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigTypeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchConfigTypeUnauthorizedCode is the HTTP code returned for type PatchConfigTypeUnauthorized -const PatchConfigTypeUnauthorizedCode int = 401 - -/*PatchConfigTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchConfigTypeUnauthorized -*/ -type PatchConfigTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchConfigTypeUnauthorized creates PatchConfigTypeUnauthorized with default headers values -func NewPatchConfigTypeUnauthorized() *PatchConfigTypeUnauthorized { - - return &PatchConfigTypeUnauthorized{} -} - -// WithPayload adds the payload to the patch config type unauthorized response -func (o *PatchConfigTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchConfigTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config type unauthorized response -func (o *PatchConfigTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchConfigTypeNotFoundCode is the HTTP code returned for type PatchConfigTypeNotFound -const PatchConfigTypeNotFoundCode int = 404 - -/*PatchConfigTypeNotFound The requested resource does not exist - -swagger:response patchConfigTypeNotFound -*/ -type PatchConfigTypeNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchConfigTypeNotFound creates PatchConfigTypeNotFound with default headers values -func NewPatchConfigTypeNotFound() *PatchConfigTypeNotFound { - - return &PatchConfigTypeNotFound{} -} - -// WithPayload adds the payload to the patch config type not found response -func (o *PatchConfigTypeNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchConfigTypeNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch config type not found response -func (o *PatchConfigTypeNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchConfigTypeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/patch_config_type_urlbuilder.go b/rest_management_api_server/operations/config/patch_config_type_urlbuilder.go deleted file mode 100644 index 6d8679397..000000000 --- a/rest_management_api_server/operations/config/patch_config_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchConfigTypeURL generates an URL for the patch config type operation -type PatchConfigTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchConfigTypeURL) WithBasePath(bp string) *PatchConfigTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchConfigTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchConfigTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchConfigTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchConfigTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchConfigTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchConfigTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchConfigTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchConfigTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchConfigTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/patch_config_urlbuilder.go b/rest_management_api_server/operations/config/patch_config_urlbuilder.go deleted file mode 100644 index a42a2ab3d..000000000 --- a/rest_management_api_server/operations/config/patch_config_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchConfigURL generates an URL for the patch config operation -type PatchConfigURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchConfigURL) WithBasePath(bp string) *PatchConfigURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchConfigURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchConfigURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/configs/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchConfigURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchConfigURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchConfigURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchConfigURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchConfigURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchConfigURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchConfigURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/update_config.go b/rest_management_api_server/operations/config/update_config.go deleted file mode 100644 index 08c96d25c..000000000 --- a/rest_management_api_server/operations/config/update_config.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateConfigHandlerFunc turns a function with the right signature into a update config handler -type UpdateConfigHandlerFunc func(UpdateConfigParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateConfigHandlerFunc) Handle(params UpdateConfigParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateConfigHandler interface for that can handle valid update config params -type UpdateConfigHandler interface { - Handle(UpdateConfigParams, interface{}) middleware.Responder -} - -// NewUpdateConfig creates a new http.Handler for the update config operation -func NewUpdateConfig(ctx *middleware.Context, handler UpdateConfigHandler) *UpdateConfig { - return &UpdateConfig{Context: ctx, Handler: handler} -} - -/* UpdateConfig swagger:route PUT /configs/{id} Config updateConfig - -Update all fields on a config - -Update all fields on a config by id. Requires admin access. - -*/ -type UpdateConfig struct { - Context *middleware.Context - Handler UpdateConfigHandler -} - -func (o *UpdateConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateConfigParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/update_config_parameters.go b/rest_management_api_server/operations/config/update_config_parameters.go deleted file mode 100644 index 910f7960f..000000000 --- a/rest_management_api_server/operations/config/update_config_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateConfigParams creates a new UpdateConfigParams object -// -// There are no default values defined in the spec. -func NewUpdateConfigParams() UpdateConfigParams { - - return UpdateConfigParams{} -} - -// UpdateConfigParams contains all the bound params for the update config operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateConfig -type UpdateConfigParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A config update object - Required: true - In: body - */ - Config *rest_model.ConfigUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateConfigParams() beforehand. -func (o *UpdateConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ConfigUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("config", "body", "")) - } else { - res = append(res, errors.NewParseError("config", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Config = &body - } - } - } else { - res = append(res, errors.Required("config", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateConfigParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/update_config_responses.go b/rest_management_api_server/operations/config/update_config_responses.go deleted file mode 100644 index 8a156f2b0..000000000 --- a/rest_management_api_server/operations/config/update_config_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateConfigOKCode is the HTTP code returned for type UpdateConfigOK -const UpdateConfigOKCode int = 200 - -/*UpdateConfigOK The update request was successful and the resource has been altered - -swagger:response updateConfigOK -*/ -type UpdateConfigOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateConfigOK creates UpdateConfigOK with default headers values -func NewUpdateConfigOK() *UpdateConfigOK { - - return &UpdateConfigOK{} -} - -// WithPayload adds the payload to the update config o k response -func (o *UpdateConfigOK) WithPayload(payload *rest_model.Empty) *UpdateConfigOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config o k response -func (o *UpdateConfigOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateConfigBadRequestCode is the HTTP code returned for type UpdateConfigBadRequest -const UpdateConfigBadRequestCode int = 400 - -/*UpdateConfigBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateConfigBadRequest -*/ -type UpdateConfigBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateConfigBadRequest creates UpdateConfigBadRequest with default headers values -func NewUpdateConfigBadRequest() *UpdateConfigBadRequest { - - return &UpdateConfigBadRequest{} -} - -// WithPayload adds the payload to the update config bad request response -func (o *UpdateConfigBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateConfigBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config bad request response -func (o *UpdateConfigBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateConfigUnauthorizedCode is the HTTP code returned for type UpdateConfigUnauthorized -const UpdateConfigUnauthorizedCode int = 401 - -/*UpdateConfigUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateConfigUnauthorized -*/ -type UpdateConfigUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateConfigUnauthorized creates UpdateConfigUnauthorized with default headers values -func NewUpdateConfigUnauthorized() *UpdateConfigUnauthorized { - - return &UpdateConfigUnauthorized{} -} - -// WithPayload adds the payload to the update config unauthorized response -func (o *UpdateConfigUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateConfigUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config unauthorized response -func (o *UpdateConfigUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateConfigNotFoundCode is the HTTP code returned for type UpdateConfigNotFound -const UpdateConfigNotFoundCode int = 404 - -/*UpdateConfigNotFound The requested resource does not exist - -swagger:response updateConfigNotFound -*/ -type UpdateConfigNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateConfigNotFound creates UpdateConfigNotFound with default headers values -func NewUpdateConfigNotFound() *UpdateConfigNotFound { - - return &UpdateConfigNotFound{} -} - -// WithPayload adds the payload to the update config not found response -func (o *UpdateConfigNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateConfigNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config not found response -func (o *UpdateConfigNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/update_config_type.go b/rest_management_api_server/operations/config/update_config_type.go deleted file mode 100644 index d8031b2f2..000000000 --- a/rest_management_api_server/operations/config/update_config_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateConfigTypeHandlerFunc turns a function with the right signature into a update config type handler -type UpdateConfigTypeHandlerFunc func(UpdateConfigTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateConfigTypeHandlerFunc) Handle(params UpdateConfigTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateConfigTypeHandler interface for that can handle valid update config type params -type UpdateConfigTypeHandler interface { - Handle(UpdateConfigTypeParams, interface{}) middleware.Responder -} - -// NewUpdateConfigType creates a new http.Handler for the update config type operation -func NewUpdateConfigType(ctx *middleware.Context, handler UpdateConfigTypeHandler) *UpdateConfigType { - return &UpdateConfigType{Context: ctx, Handler: handler} -} - -/* UpdateConfigType swagger:route PUT /config-types/{id} Config updateConfigType - -Update all fields on a config-type - -Update all fields on a config-type by id. Requires admin access. - -*/ -type UpdateConfigType struct { - Context *middleware.Context - Handler UpdateConfigTypeHandler -} - -func (o *UpdateConfigType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateConfigTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/config/update_config_type_parameters.go b/rest_management_api_server/operations/config/update_config_type_parameters.go deleted file mode 100644 index d3abf231f..000000000 --- a/rest_management_api_server/operations/config/update_config_type_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateConfigTypeParams creates a new UpdateConfigTypeParams object -// -// There are no default values defined in the spec. -func NewUpdateConfigTypeParams() UpdateConfigTypeParams { - - return UpdateConfigTypeParams{} -} - -// UpdateConfigTypeParams contains all the bound params for the update config type operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateConfigType -type UpdateConfigTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A config-type update object - Required: true - In: body - */ - ConfigType *rest_model.ConfigTypeUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateConfigTypeParams() beforehand. -func (o *UpdateConfigTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ConfigTypeUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("configType", "body", "")) - } else { - res = append(res, errors.NewParseError("configType", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ConfigType = &body - } - } - } else { - res = append(res, errors.Required("configType", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateConfigTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/config/update_config_type_responses.go b/rest_management_api_server/operations/config/update_config_type_responses.go deleted file mode 100644 index aac515653..000000000 --- a/rest_management_api_server/operations/config/update_config_type_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateConfigTypeOKCode is the HTTP code returned for type UpdateConfigTypeOK -const UpdateConfigTypeOKCode int = 200 - -/*UpdateConfigTypeOK The update request was successful and the resource has been altered - -swagger:response updateConfigTypeOK -*/ -type UpdateConfigTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateConfigTypeOK creates UpdateConfigTypeOK with default headers values -func NewUpdateConfigTypeOK() *UpdateConfigTypeOK { - - return &UpdateConfigTypeOK{} -} - -// WithPayload adds the payload to the update config type o k response -func (o *UpdateConfigTypeOK) WithPayload(payload *rest_model.Empty) *UpdateConfigTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config type o k response -func (o *UpdateConfigTypeOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateConfigTypeBadRequestCode is the HTTP code returned for type UpdateConfigTypeBadRequest -const UpdateConfigTypeBadRequestCode int = 400 - -/*UpdateConfigTypeBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateConfigTypeBadRequest -*/ -type UpdateConfigTypeBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateConfigTypeBadRequest creates UpdateConfigTypeBadRequest with default headers values -func NewUpdateConfigTypeBadRequest() *UpdateConfigTypeBadRequest { - - return &UpdateConfigTypeBadRequest{} -} - -// WithPayload adds the payload to the update config type bad request response -func (o *UpdateConfigTypeBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateConfigTypeBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config type bad request response -func (o *UpdateConfigTypeBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigTypeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateConfigTypeUnauthorizedCode is the HTTP code returned for type UpdateConfigTypeUnauthorized -const UpdateConfigTypeUnauthorizedCode int = 401 - -/*UpdateConfigTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateConfigTypeUnauthorized -*/ -type UpdateConfigTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateConfigTypeUnauthorized creates UpdateConfigTypeUnauthorized with default headers values -func NewUpdateConfigTypeUnauthorized() *UpdateConfigTypeUnauthorized { - - return &UpdateConfigTypeUnauthorized{} -} - -// WithPayload adds the payload to the update config type unauthorized response -func (o *UpdateConfigTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateConfigTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config type unauthorized response -func (o *UpdateConfigTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateConfigTypeNotFoundCode is the HTTP code returned for type UpdateConfigTypeNotFound -const UpdateConfigTypeNotFoundCode int = 404 - -/*UpdateConfigTypeNotFound The requested resource does not exist - -swagger:response updateConfigTypeNotFound -*/ -type UpdateConfigTypeNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateConfigTypeNotFound creates UpdateConfigTypeNotFound with default headers values -func NewUpdateConfigTypeNotFound() *UpdateConfigTypeNotFound { - - return &UpdateConfigTypeNotFound{} -} - -// WithPayload adds the payload to the update config type not found response -func (o *UpdateConfigTypeNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateConfigTypeNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update config type not found response -func (o *UpdateConfigTypeNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateConfigTypeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/config/update_config_type_urlbuilder.go b/rest_management_api_server/operations/config/update_config_type_urlbuilder.go deleted file mode 100644 index 069cd6140..000000000 --- a/rest_management_api_server/operations/config/update_config_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateConfigTypeURL generates an URL for the update config type operation -type UpdateConfigTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateConfigTypeURL) WithBasePath(bp string) *UpdateConfigTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateConfigTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateConfigTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/config-types/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateConfigTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateConfigTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateConfigTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateConfigTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateConfigTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateConfigTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateConfigTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/config/update_config_urlbuilder.go b/rest_management_api_server/operations/config/update_config_urlbuilder.go deleted file mode 100644 index 2f56f073e..000000000 --- a/rest_management_api_server/operations/config/update_config_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package config - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateConfigURL generates an URL for the update config operation -type UpdateConfigURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateConfigURL) WithBasePath(bp string) *UpdateConfigURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateConfigURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateConfigURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/configs/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateConfigURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateConfigURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateConfigURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateConfigURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateConfigURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateConfigURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateConfigURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/delete_current_api_session.go b/rest_management_api_server/operations/current_api_session/delete_current_api_session.go deleted file mode 100644 index 82483fb71..000000000 --- a/rest_management_api_server/operations/current_api_session/delete_current_api_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteCurrentAPISessionHandlerFunc turns a function with the right signature into a delete current API session handler -type DeleteCurrentAPISessionHandlerFunc func(DeleteCurrentAPISessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteCurrentAPISessionHandlerFunc) Handle(params DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteCurrentAPISessionHandler interface for that can handle valid delete current API session params -type DeleteCurrentAPISessionHandler interface { - Handle(DeleteCurrentAPISessionParams, interface{}) middleware.Responder -} - -// NewDeleteCurrentAPISession creates a new http.Handler for the delete current API session operation -func NewDeleteCurrentAPISession(ctx *middleware.Context, handler DeleteCurrentAPISessionHandler) *DeleteCurrentAPISession { - return &DeleteCurrentAPISession{Context: ctx, Handler: handler} -} - -/* DeleteCurrentAPISession swagger:route DELETE /current-api-session Current API Session deleteCurrentApiSession - -Logout - -Terminates the current API session - -*/ -type DeleteCurrentAPISession struct { - Context *middleware.Context - Handler DeleteCurrentAPISessionHandler -} - -func (o *DeleteCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteCurrentAPISessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/delete_current_api_session_parameters.go b/rest_management_api_server/operations/current_api_session/delete_current_api_session_parameters.go deleted file mode 100644 index b6d0efc60..000000000 --- a/rest_management_api_server/operations/current_api_session/delete_current_api_session_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDeleteCurrentAPISessionParams creates a new DeleteCurrentAPISessionParams object -// -// There are no default values defined in the spec. -func NewDeleteCurrentAPISessionParams() DeleteCurrentAPISessionParams { - - return DeleteCurrentAPISessionParams{} -} - -// DeleteCurrentAPISessionParams contains all the bound params for the delete current API session operation -// typically these are obtained from a http.Request -// -// swagger:parameters DeleteCurrentAPISession -type DeleteCurrentAPISessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteCurrentAPISessionParams() beforehand. -func (o *DeleteCurrentAPISessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/delete_current_api_session_responses.go b/rest_management_api_server/operations/current_api_session/delete_current_api_session_responses.go deleted file mode 100644 index dde823955..000000000 --- a/rest_management_api_server/operations/current_api_session/delete_current_api_session_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteCurrentAPISessionOKCode is the HTTP code returned for type DeleteCurrentAPISessionOK -const DeleteCurrentAPISessionOKCode int = 200 - -/*DeleteCurrentAPISessionOK Base empty response - -swagger:response deleteCurrentApiSessionOK -*/ -type DeleteCurrentAPISessionOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionOK creates DeleteCurrentAPISessionOK with default headers values -func NewDeleteCurrentAPISessionOK() *DeleteCurrentAPISessionOK { - - return &DeleteCurrentAPISessionOK{} -} - -// WithPayload adds the payload to the delete current Api session o k response -func (o *DeleteCurrentAPISessionOK) WithPayload(payload *rest_model.Empty) *DeleteCurrentAPISessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session o k response -func (o *DeleteCurrentAPISessionOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCurrentAPISessionUnauthorizedCode is the HTTP code returned for type DeleteCurrentAPISessionUnauthorized -const DeleteCurrentAPISessionUnauthorizedCode int = 401 - -/*DeleteCurrentAPISessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteCurrentApiSessionUnauthorized -*/ -type DeleteCurrentAPISessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteCurrentAPISessionUnauthorized creates DeleteCurrentAPISessionUnauthorized with default headers values -func NewDeleteCurrentAPISessionUnauthorized() *DeleteCurrentAPISessionUnauthorized { - - return &DeleteCurrentAPISessionUnauthorized{} -} - -// WithPayload adds the payload to the delete current Api session unauthorized response -func (o *DeleteCurrentAPISessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteCurrentAPISessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete current Api session unauthorized response -func (o *DeleteCurrentAPISessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCurrentAPISessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go b/rest_management_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go deleted file mode 100644 index cc95c0a64..000000000 --- a/rest_management_api_server/operations/current_api_session/delete_current_api_session_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DeleteCurrentAPISessionURL generates an URL for the delete current API session operation -type DeleteCurrentAPISessionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCurrentAPISessionURL) WithBasePath(bp string) *DeleteCurrentAPISessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCurrentAPISessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteCurrentAPISessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteCurrentAPISessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteCurrentAPISessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteCurrentAPISessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteCurrentAPISessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteCurrentAPISessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteCurrentAPISessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator.go b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator.go deleted file mode 100644 index 75bdaca49..000000000 --- a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a detail current identity authenticator handler -type DetailCurrentIdentityAuthenticatorHandlerFunc func(DetailCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailCurrentIdentityAuthenticatorHandlerFunc) Handle(params DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailCurrentIdentityAuthenticatorHandler interface for that can handle valid detail current identity authenticator params -type DetailCurrentIdentityAuthenticatorHandler interface { - Handle(DetailCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewDetailCurrentIdentityAuthenticator creates a new http.Handler for the detail current identity authenticator operation -func NewDetailCurrentIdentityAuthenticator(ctx *middleware.Context, handler DetailCurrentIdentityAuthenticatorHandler) *DetailCurrentIdentityAuthenticator { - return &DetailCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* DetailCurrentIdentityAuthenticator swagger:route GET /current-identity/authenticators/{id} Current API Session detailCurrentIdentityAuthenticator - -Retrieve an authenticator for the current identity - -Retrieves a single authenticator by id. Will only show authenticators assigned to the API session's identity. - -*/ -type DetailCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler DetailCurrentIdentityAuthenticatorHandler -} - -func (o *DetailCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go deleted file mode 100644 index 130f64a5e..000000000 --- a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailCurrentIdentityAuthenticatorParams creates a new DetailCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewDetailCurrentIdentityAuthenticatorParams() DetailCurrentIdentityAuthenticatorParams { - - return DetailCurrentIdentityAuthenticatorParams{} -} - -// DetailCurrentIdentityAuthenticatorParams contains all the bound params for the detail current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailCurrentIdentityAuthenticator -type DetailCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailCurrentIdentityAuthenticatorParams() beforehand. -func (o *DetailCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go deleted file mode 100644 index 42a0fe506..000000000 --- a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type DetailCurrentIdentityAuthenticatorOK -const DetailCurrentIdentityAuthenticatorOKCode int = 200 - -/*DetailCurrentIdentityAuthenticatorOK A singular authenticator resource - -swagger:response detailCurrentIdentityAuthenticatorOK -*/ -type DetailCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailAuthenticatorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentIdentityAuthenticatorOK creates DetailCurrentIdentityAuthenticatorOK with default headers values -func NewDetailCurrentIdentityAuthenticatorOK() *DetailCurrentIdentityAuthenticatorOK { - - return &DetailCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the detail current identity authenticator o k response -func (o *DetailCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.DetailAuthenticatorEnvelope) *DetailCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current identity authenticator o k response -func (o *DetailCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.DetailAuthenticatorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type DetailCurrentIdentityAuthenticatorUnauthorized -const DetailCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*DetailCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailCurrentIdentityAuthenticatorUnauthorized -*/ -type DetailCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentIdentityAuthenticatorUnauthorized creates DetailCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewDetailCurrentIdentityAuthenticatorUnauthorized() *DetailCurrentIdentityAuthenticatorUnauthorized { - - return &DetailCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the detail current identity authenticator unauthorized response -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current identity authenticator unauthorized response -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailCurrentIdentityAuthenticatorNotFoundCode is the HTTP code returned for type DetailCurrentIdentityAuthenticatorNotFound -const DetailCurrentIdentityAuthenticatorNotFoundCode int = 404 - -/*DetailCurrentIdentityAuthenticatorNotFound The requested resource does not exist - -swagger:response detailCurrentIdentityAuthenticatorNotFound -*/ -type DetailCurrentIdentityAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailCurrentIdentityAuthenticatorNotFound creates DetailCurrentIdentityAuthenticatorNotFound with default headers values -func NewDetailCurrentIdentityAuthenticatorNotFound() *DetailCurrentIdentityAuthenticatorNotFound { - - return &DetailCurrentIdentityAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the detail current identity authenticator not found response -func (o *DetailCurrentIdentityAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailCurrentIdentityAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail current identity authenticator not found response -func (o *DetailCurrentIdentityAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailCurrentIdentityAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go b/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index efd5a39c6..000000000 --- a/rest_management_api_server/operations/current_api_session/detail_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailCurrentIdentityAuthenticatorURL generates an URL for the detail current identity authenticator operation -type DetailCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *DetailCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator.go b/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator.go deleted file mode 100644 index d65c2283a..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ExtendCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a extend current identity authenticator handler -type ExtendCurrentIdentityAuthenticatorHandlerFunc func(ExtendCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ExtendCurrentIdentityAuthenticatorHandlerFunc) Handle(params ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ExtendCurrentIdentityAuthenticatorHandler interface for that can handle valid extend current identity authenticator params -type ExtendCurrentIdentityAuthenticatorHandler interface { - Handle(ExtendCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewExtendCurrentIdentityAuthenticator creates a new http.Handler for the extend current identity authenticator operation -func NewExtendCurrentIdentityAuthenticator(ctx *middleware.Context, handler ExtendCurrentIdentityAuthenticatorHandler) *ExtendCurrentIdentityAuthenticator { - return &ExtendCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* ExtendCurrentIdentityAuthenticator swagger:route POST /current-identity/authenticators/{id}/extend Current API Session Enroll Extend Enrollment extendCurrentIdentityAuthenticator - -Allows the current identity to recieve a new certificate associated with a certificate based authenticator - -This endpoint only functions for certificates issued by the controller. 3rd party certificates are not handled. -Allows an identity to extend its certificate's expiration date by using its current and valid client certificate to submit a CSR. This CSR may be passed in using a new private key, thus allowing private key rotation. -The response from this endpoint is a new client certificate which the client must be verified via the /authenticators/{id}/extend-verify endpoint. -After verification is completion any new connections must be made with new certificate. Prior to verification the old client certificate remains active. - -*/ -type ExtendCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler ExtendCurrentIdentityAuthenticatorHandler -} - -func (o *ExtendCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewExtendCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_parameters.go b/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_parameters.go deleted file mode 100644 index 909b29717..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendCurrentIdentityAuthenticatorParams creates a new ExtendCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewExtendCurrentIdentityAuthenticatorParams() ExtendCurrentIdentityAuthenticatorParams { - - return ExtendCurrentIdentityAuthenticatorParams{} -} - -// ExtendCurrentIdentityAuthenticatorParams contains all the bound params for the extend current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters extendCurrentIdentityAuthenticator -type ExtendCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Extend *rest_model.IdentityExtendEnrollmentRequest - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewExtendCurrentIdentityAuthenticatorParams() beforehand. -func (o *ExtendCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityExtendEnrollmentRequest - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("extend", "body", "")) - } else { - res = append(res, errors.NewParseError("extend", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Extend = &body - } - } - } else { - res = append(res, errors.Required("extend", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ExtendCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_responses.go b/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_responses.go deleted file mode 100644 index 5e9d93ab6..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ExtendCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type ExtendCurrentIdentityAuthenticatorOK -const ExtendCurrentIdentityAuthenticatorOKCode int = 200 - -/*ExtendCurrentIdentityAuthenticatorOK A response containg the identity's new certificate - -swagger:response extendCurrentIdentityAuthenticatorOK -*/ -type ExtendCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.IdentityExtendEnrollmentEnvelope `json:"body,omitempty"` -} - -// NewExtendCurrentIdentityAuthenticatorOK creates ExtendCurrentIdentityAuthenticatorOK with default headers values -func NewExtendCurrentIdentityAuthenticatorOK() *ExtendCurrentIdentityAuthenticatorOK { - - return &ExtendCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the extend current identity authenticator o k response -func (o *ExtendCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.IdentityExtendEnrollmentEnvelope) *ExtendCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend current identity authenticator o k response -func (o *ExtendCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.IdentityExtendEnrollmentEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ExtendCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type ExtendCurrentIdentityAuthenticatorUnauthorized -const ExtendCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*ExtendCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response extendCurrentIdentityAuthenticatorUnauthorized -*/ -type ExtendCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewExtendCurrentIdentityAuthenticatorUnauthorized creates ExtendCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendCurrentIdentityAuthenticatorUnauthorized() *ExtendCurrentIdentityAuthenticatorUnauthorized { - - return &ExtendCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the extend current identity authenticator unauthorized response -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ExtendCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend current identity authenticator unauthorized response -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_urlbuilder.go b/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index 37612d006..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ExtendCurrentIdentityAuthenticatorURL generates an URL for the extend current identity authenticator operation -type ExtendCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *ExtendCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ExtendCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}/extend" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ExtendCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ExtendCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ExtendCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ExtendCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ExtendCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ExtendCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ExtendCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator.go b/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator.go deleted file mode 100644 index 7f41148ba..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a extend verify current identity authenticator handler -type ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc func(ExtendVerifyCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc) Handle(params ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ExtendVerifyCurrentIdentityAuthenticatorHandler interface for that can handle valid extend verify current identity authenticator params -type ExtendVerifyCurrentIdentityAuthenticatorHandler interface { - Handle(ExtendVerifyCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewExtendVerifyCurrentIdentityAuthenticator creates a new http.Handler for the extend verify current identity authenticator operation -func NewExtendVerifyCurrentIdentityAuthenticator(ctx *middleware.Context, handler ExtendVerifyCurrentIdentityAuthenticatorHandler) *ExtendVerifyCurrentIdentityAuthenticator { - return &ExtendVerifyCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* ExtendVerifyCurrentIdentityAuthenticator swagger:route POST /current-identity/authenticators/{id}/extend-verify Current API Session Enroll Extend Enrollment extendVerifyCurrentIdentityAuthenticator - -Allows the current identity to validate reciept of a new client certificate - -After submitting a CSR for a new client certificate the resulting public certificate must be re-submitted to this endpoint to verify receipt. -After receipt, the new client certificate must be used for new authentication requests. - -*/ -type ExtendVerifyCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler ExtendVerifyCurrentIdentityAuthenticatorHandler -} - -func (o *ExtendVerifyCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewExtendVerifyCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_parameters.go b/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_parameters.go deleted file mode 100644 index 508eb09a3..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewExtendVerifyCurrentIdentityAuthenticatorParams creates a new ExtendVerifyCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewExtendVerifyCurrentIdentityAuthenticatorParams() ExtendVerifyCurrentIdentityAuthenticatorParams { - - return ExtendVerifyCurrentIdentityAuthenticatorParams{} -} - -// ExtendVerifyCurrentIdentityAuthenticatorParams contains all the bound params for the extend verify current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters extendVerifyCurrentIdentityAuthenticator -type ExtendVerifyCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Extend *rest_model.IdentityExtendValidateEnrollmentRequest - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewExtendVerifyCurrentIdentityAuthenticatorParams() beforehand. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityExtendValidateEnrollmentRequest - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("extend", "body", "")) - } else { - res = append(res, errors.NewParseError("extend", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Extend = &body - } - } - } else { - res = append(res, errors.Required("extend", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ExtendVerifyCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_responses.go b/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_responses.go deleted file mode 100644 index d12cee7a8..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ExtendVerifyCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type ExtendVerifyCurrentIdentityAuthenticatorOK -const ExtendVerifyCurrentIdentityAuthenticatorOKCode int = 200 - -/*ExtendVerifyCurrentIdentityAuthenticatorOK Base empty response - -swagger:response extendVerifyCurrentIdentityAuthenticatorOK -*/ -type ExtendVerifyCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewExtendVerifyCurrentIdentityAuthenticatorOK creates ExtendVerifyCurrentIdentityAuthenticatorOK with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorOK() *ExtendVerifyCurrentIdentityAuthenticatorOK { - - return &ExtendVerifyCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the extend verify current identity authenticator o k response -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.Empty) *ExtendVerifyCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend verify current identity authenticator o k response -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendVerifyCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ExtendVerifyCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type ExtendVerifyCurrentIdentityAuthenticatorUnauthorized -const ExtendVerifyCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*ExtendVerifyCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response extendVerifyCurrentIdentityAuthenticatorUnauthorized -*/ -type ExtendVerifyCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized creates ExtendVerifyCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewExtendVerifyCurrentIdentityAuthenticatorUnauthorized() *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized { - - return &ExtendVerifyCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the extend verify current identity authenticator unauthorized response -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the extend verify current identity authenticator unauthorized response -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ExtendVerifyCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_urlbuilder.go b/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index c27cc3a05..000000000 --- a/rest_management_api_server/operations/current_api_session/extend_verify_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ExtendVerifyCurrentIdentityAuthenticatorURL generates an URL for the extend verify current identity authenticator operation -type ExtendVerifyCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *ExtendVerifyCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}/extend-verify" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ExtendVerifyCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ExtendVerifyCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ExtendVerifyCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ExtendVerifyCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/get_current_api_session.go b/rest_management_api_server/operations/current_api_session/get_current_api_session.go deleted file mode 100644 index 24caec5b0..000000000 --- a/rest_management_api_server/operations/current_api_session/get_current_api_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCurrentAPISessionHandlerFunc turns a function with the right signature into a get current API session handler -type GetCurrentAPISessionHandlerFunc func(GetCurrentAPISessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCurrentAPISessionHandlerFunc) Handle(params GetCurrentAPISessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetCurrentAPISessionHandler interface for that can handle valid get current API session params -type GetCurrentAPISessionHandler interface { - Handle(GetCurrentAPISessionParams, interface{}) middleware.Responder -} - -// NewGetCurrentAPISession creates a new http.Handler for the get current API session operation -func NewGetCurrentAPISession(ctx *middleware.Context, handler GetCurrentAPISessionHandler) *GetCurrentAPISession { - return &GetCurrentAPISession{Context: ctx, Handler: handler} -} - -/* GetCurrentAPISession swagger:route GET /current-api-session Current API Session getCurrentApiSession - -Return the current API session - -Retrieves the API session that was used to issue the current request - -*/ -type GetCurrentAPISession struct { - Context *middleware.Context - Handler GetCurrentAPISessionHandler -} - -func (o *GetCurrentAPISession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCurrentAPISessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/get_current_api_session_parameters.go b/rest_management_api_server/operations/current_api_session/get_current_api_session_parameters.go deleted file mode 100644 index 651296d9f..000000000 --- a/rest_management_api_server/operations/current_api_session/get_current_api_session_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetCurrentAPISessionParams creates a new GetCurrentAPISessionParams object -// -// There are no default values defined in the spec. -func NewGetCurrentAPISessionParams() GetCurrentAPISessionParams { - - return GetCurrentAPISessionParams{} -} - -// GetCurrentAPISessionParams contains all the bound params for the get current API session operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCurrentAPISession -type GetCurrentAPISessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCurrentAPISessionParams() beforehand. -func (o *GetCurrentAPISessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/get_current_api_session_responses.go b/rest_management_api_server/operations/current_api_session/get_current_api_session_responses.go deleted file mode 100644 index b5b461a57..000000000 --- a/rest_management_api_server/operations/current_api_session/get_current_api_session_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentAPISessionOKCode is the HTTP code returned for type GetCurrentAPISessionOK -const GetCurrentAPISessionOKCode int = 200 - -/*GetCurrentAPISessionOK The API session associated with the session used to issue the request - -swagger:response getCurrentApiSessionOK -*/ -type GetCurrentAPISessionOK struct { - - /* - In: Body - */ - Payload *rest_model.CurrentAPISessionDetailEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentAPISessionOK creates GetCurrentAPISessionOK with default headers values -func NewGetCurrentAPISessionOK() *GetCurrentAPISessionOK { - - return &GetCurrentAPISessionOK{} -} - -// WithPayload adds the payload to the get current Api session o k response -func (o *GetCurrentAPISessionOK) WithPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) *GetCurrentAPISessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current Api session o k response -func (o *GetCurrentAPISessionOK) SetPayload(payload *rest_model.CurrentAPISessionDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentAPISessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCurrentAPISessionUnauthorizedCode is the HTTP code returned for type GetCurrentAPISessionUnauthorized -const GetCurrentAPISessionUnauthorizedCode int = 401 - -/*GetCurrentAPISessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getCurrentApiSessionUnauthorized -*/ -type GetCurrentAPISessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentAPISessionUnauthorized creates GetCurrentAPISessionUnauthorized with default headers values -func NewGetCurrentAPISessionUnauthorized() *GetCurrentAPISessionUnauthorized { - - return &GetCurrentAPISessionUnauthorized{} -} - -// WithPayload adds the payload to the get current Api session unauthorized response -func (o *GetCurrentAPISessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCurrentAPISessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current Api session unauthorized response -func (o *GetCurrentAPISessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentAPISessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go b/rest_management_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go deleted file mode 100644 index a6af11fff..000000000 --- a/rest_management_api_server/operations/current_api_session/get_current_api_session_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetCurrentAPISessionURL generates an URL for the get current API session operation -type GetCurrentAPISessionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentAPISessionURL) WithBasePath(bp string) *GetCurrentAPISessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentAPISessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCurrentAPISessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-api-session" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCurrentAPISessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCurrentAPISessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCurrentAPISessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCurrentAPISessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCurrentAPISessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCurrentAPISessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators.go b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators.go deleted file mode 100644 index c41037d12..000000000 --- a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListCurrentIdentityAuthenticatorsHandlerFunc turns a function with the right signature into a list current identity authenticators handler -type ListCurrentIdentityAuthenticatorsHandlerFunc func(ListCurrentIdentityAuthenticatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListCurrentIdentityAuthenticatorsHandlerFunc) Handle(params ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListCurrentIdentityAuthenticatorsHandler interface for that can handle valid list current identity authenticators params -type ListCurrentIdentityAuthenticatorsHandler interface { - Handle(ListCurrentIdentityAuthenticatorsParams, interface{}) middleware.Responder -} - -// NewListCurrentIdentityAuthenticators creates a new http.Handler for the list current identity authenticators operation -func NewListCurrentIdentityAuthenticators(ctx *middleware.Context, handler ListCurrentIdentityAuthenticatorsHandler) *ListCurrentIdentityAuthenticators { - return &ListCurrentIdentityAuthenticators{Context: ctx, Handler: handler} -} - -/* ListCurrentIdentityAuthenticators swagger:route GET /current-identity/authenticators Current API Session listCurrentIdentityAuthenticators - -List authenticators for the current identity - -Retrieves a list of authenticators assigned to the current API session's identity; supports filtering, sorting, and pagination. - -*/ -type ListCurrentIdentityAuthenticators struct { - Context *middleware.Context - Handler ListCurrentIdentityAuthenticatorsHandler -} - -func (o *ListCurrentIdentityAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListCurrentIdentityAuthenticatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go deleted file mode 100644 index 0625dd6de..000000000 --- a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListCurrentIdentityAuthenticatorsParams creates a new ListCurrentIdentityAuthenticatorsParams object -// -// There are no default values defined in the spec. -func NewListCurrentIdentityAuthenticatorsParams() ListCurrentIdentityAuthenticatorsParams { - - return ListCurrentIdentityAuthenticatorsParams{} -} - -// ListCurrentIdentityAuthenticatorsParams contains all the bound params for the list current identity authenticators operation -// typically these are obtained from a http.Request -// -// swagger:parameters listCurrentIdentityAuthenticators -type ListCurrentIdentityAuthenticatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListCurrentIdentityAuthenticatorsParams() beforehand. -func (o *ListCurrentIdentityAuthenticatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListCurrentIdentityAuthenticatorsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListCurrentIdentityAuthenticatorsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListCurrentIdentityAuthenticatorsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go deleted file mode 100644 index 0f6172743..000000000 --- a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListCurrentIdentityAuthenticatorsOKCode is the HTTP code returned for type ListCurrentIdentityAuthenticatorsOK -const ListCurrentIdentityAuthenticatorsOKCode int = 200 - -/*ListCurrentIdentityAuthenticatorsOK A list of authenticators - -swagger:response listCurrentIdentityAuthenticatorsOK -*/ -type ListCurrentIdentityAuthenticatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListAuthenticatorsEnvelope `json:"body,omitempty"` -} - -// NewListCurrentIdentityAuthenticatorsOK creates ListCurrentIdentityAuthenticatorsOK with default headers values -func NewListCurrentIdentityAuthenticatorsOK() *ListCurrentIdentityAuthenticatorsOK { - - return &ListCurrentIdentityAuthenticatorsOK{} -} - -// WithPayload adds the payload to the list current identity authenticators o k response -func (o *ListCurrentIdentityAuthenticatorsOK) WithPayload(payload *rest_model.ListAuthenticatorsEnvelope) *ListCurrentIdentityAuthenticatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current identity authenticators o k response -func (o *ListCurrentIdentityAuthenticatorsOK) SetPayload(payload *rest_model.ListAuthenticatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentIdentityAuthenticatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCurrentIdentityAuthenticatorsBadRequestCode is the HTTP code returned for type ListCurrentIdentityAuthenticatorsBadRequest -const ListCurrentIdentityAuthenticatorsBadRequestCode int = 400 - -/*ListCurrentIdentityAuthenticatorsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listCurrentIdentityAuthenticatorsBadRequest -*/ -type ListCurrentIdentityAuthenticatorsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCurrentIdentityAuthenticatorsBadRequest creates ListCurrentIdentityAuthenticatorsBadRequest with default headers values -func NewListCurrentIdentityAuthenticatorsBadRequest() *ListCurrentIdentityAuthenticatorsBadRequest { - - return &ListCurrentIdentityAuthenticatorsBadRequest{} -} - -// WithPayload adds the payload to the list current identity authenticators bad request response -func (o *ListCurrentIdentityAuthenticatorsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentIdentityAuthenticatorsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current identity authenticators bad request response -func (o *ListCurrentIdentityAuthenticatorsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentIdentityAuthenticatorsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListCurrentIdentityAuthenticatorsUnauthorizedCode is the HTTP code returned for type ListCurrentIdentityAuthenticatorsUnauthorized -const ListCurrentIdentityAuthenticatorsUnauthorizedCode int = 401 - -/*ListCurrentIdentityAuthenticatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listCurrentIdentityAuthenticatorsUnauthorized -*/ -type ListCurrentIdentityAuthenticatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListCurrentIdentityAuthenticatorsUnauthorized creates ListCurrentIdentityAuthenticatorsUnauthorized with default headers values -func NewListCurrentIdentityAuthenticatorsUnauthorized() *ListCurrentIdentityAuthenticatorsUnauthorized { - - return &ListCurrentIdentityAuthenticatorsUnauthorized{} -} - -// WithPayload adds the payload to the list current identity authenticators unauthorized response -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListCurrentIdentityAuthenticatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list current identity authenticators unauthorized response -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListCurrentIdentityAuthenticatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go b/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go deleted file mode 100644 index 0c788f19e..000000000 --- a/rest_management_api_server/operations/current_api_session/list_current_identity_authenticators_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListCurrentIdentityAuthenticatorsURL generates an URL for the list current identity authenticators operation -type ListCurrentIdentityAuthenticatorsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCurrentIdentityAuthenticatorsURL) WithBasePath(bp string) *ListCurrentIdentityAuthenticatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListCurrentIdentityAuthenticatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListCurrentIdentityAuthenticatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListCurrentIdentityAuthenticatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListCurrentIdentityAuthenticatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListCurrentIdentityAuthenticatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListCurrentIdentityAuthenticatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListCurrentIdentityAuthenticatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListCurrentIdentityAuthenticatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator.go b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator.go deleted file mode 100644 index 9cd5ddf44..000000000 --- a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a patch current identity authenticator handler -type PatchCurrentIdentityAuthenticatorHandlerFunc func(PatchCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchCurrentIdentityAuthenticatorHandlerFunc) Handle(params PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchCurrentIdentityAuthenticatorHandler interface for that can handle valid patch current identity authenticator params -type PatchCurrentIdentityAuthenticatorHandler interface { - Handle(PatchCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewPatchCurrentIdentityAuthenticator creates a new http.Handler for the patch current identity authenticator operation -func NewPatchCurrentIdentityAuthenticator(ctx *middleware.Context, handler PatchCurrentIdentityAuthenticatorHandler) *PatchCurrentIdentityAuthenticator { - return &PatchCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* PatchCurrentIdentityAuthenticator swagger:route PATCH /current-identity/authenticators/{id} Current API Session patchCurrentIdentityAuthenticator - -Update the supplied fields on an authenticator of this identity - -Update the supplied fields on an authenticator by id. Will only update authenticators assigned to the API -session's identity. - - -*/ -type PatchCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler PatchCurrentIdentityAuthenticatorHandler -} - -func (o *PatchCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go deleted file mode 100644 index 9e6a0ff99..000000000 --- a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchCurrentIdentityAuthenticatorParams creates a new PatchCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewPatchCurrentIdentityAuthenticatorParams() PatchCurrentIdentityAuthenticatorParams { - - return PatchCurrentIdentityAuthenticatorParams{} -} - -// PatchCurrentIdentityAuthenticatorParams contains all the bound params for the patch current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchCurrentIdentityAuthenticator -type PatchCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An authenticator patch object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorPatchWithCurrent - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchCurrentIdentityAuthenticatorParams() beforehand. -func (o *PatchCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorPatchWithCurrent - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go deleted file mode 100644 index 34e0d6462..000000000 --- a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorOK -const PatchCurrentIdentityAuthenticatorOKCode int = 200 - -/*PatchCurrentIdentityAuthenticatorOK The patch request was successful and the resource has been altered - -swagger:response patchCurrentIdentityAuthenticatorOK -*/ -type PatchCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorOK creates PatchCurrentIdentityAuthenticatorOK with default headers values -func NewPatchCurrentIdentityAuthenticatorOK() *PatchCurrentIdentityAuthenticatorOK { - - return &PatchCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the patch current identity authenticator o k response -func (o *PatchCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.Empty) *PatchCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator o k response -func (o *PatchCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCurrentIdentityAuthenticatorBadRequestCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorBadRequest -const PatchCurrentIdentityAuthenticatorBadRequestCode int = 400 - -/*PatchCurrentIdentityAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchCurrentIdentityAuthenticatorBadRequest -*/ -type PatchCurrentIdentityAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorBadRequest creates PatchCurrentIdentityAuthenticatorBadRequest with default headers values -func NewPatchCurrentIdentityAuthenticatorBadRequest() *PatchCurrentIdentityAuthenticatorBadRequest { - - return &PatchCurrentIdentityAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the patch current identity authenticator bad request response -func (o *PatchCurrentIdentityAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCurrentIdentityAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator bad request response -func (o *PatchCurrentIdentityAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorUnauthorized -const PatchCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*PatchCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchCurrentIdentityAuthenticatorUnauthorized -*/ -type PatchCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorUnauthorized creates PatchCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewPatchCurrentIdentityAuthenticatorUnauthorized() *PatchCurrentIdentityAuthenticatorUnauthorized { - - return &PatchCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the patch current identity authenticator unauthorized response -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator unauthorized response -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchCurrentIdentityAuthenticatorNotFoundCode is the HTTP code returned for type PatchCurrentIdentityAuthenticatorNotFound -const PatchCurrentIdentityAuthenticatorNotFoundCode int = 404 - -/*PatchCurrentIdentityAuthenticatorNotFound The requested resource does not exist - -swagger:response patchCurrentIdentityAuthenticatorNotFound -*/ -type PatchCurrentIdentityAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchCurrentIdentityAuthenticatorNotFound creates PatchCurrentIdentityAuthenticatorNotFound with default headers values -func NewPatchCurrentIdentityAuthenticatorNotFound() *PatchCurrentIdentityAuthenticatorNotFound { - - return &PatchCurrentIdentityAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the patch current identity authenticator not found response -func (o *PatchCurrentIdentityAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchCurrentIdentityAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch current identity authenticator not found response -func (o *PatchCurrentIdentityAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchCurrentIdentityAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go b/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index 675aed824..000000000 --- a/rest_management_api_server/operations/current_api_session/patch_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchCurrentIdentityAuthenticatorURL generates an URL for the patch current identity authenticator operation -type PatchCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *PatchCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator.go b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator.go deleted file mode 100644 index 495ab4c79..000000000 --- a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateCurrentIdentityAuthenticatorHandlerFunc turns a function with the right signature into a update current identity authenticator handler -type UpdateCurrentIdentityAuthenticatorHandlerFunc func(UpdateCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateCurrentIdentityAuthenticatorHandlerFunc) Handle(params UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateCurrentIdentityAuthenticatorHandler interface for that can handle valid update current identity authenticator params -type UpdateCurrentIdentityAuthenticatorHandler interface { - Handle(UpdateCurrentIdentityAuthenticatorParams, interface{}) middleware.Responder -} - -// NewUpdateCurrentIdentityAuthenticator creates a new http.Handler for the update current identity authenticator operation -func NewUpdateCurrentIdentityAuthenticator(ctx *middleware.Context, handler UpdateCurrentIdentityAuthenticatorHandler) *UpdateCurrentIdentityAuthenticator { - return &UpdateCurrentIdentityAuthenticator{Context: ctx, Handler: handler} -} - -/* UpdateCurrentIdentityAuthenticator swagger:route PUT /current-identity/authenticators/{id} Current API Session updateCurrentIdentityAuthenticator - -Update all fields on an authenticator of this identity - -Update all fields on an authenticator by id. Will only update authenticators assigned to the API session's -identity. - - -*/ -type UpdateCurrentIdentityAuthenticator struct { - Context *middleware.Context - Handler UpdateCurrentIdentityAuthenticatorHandler -} - -func (o *UpdateCurrentIdentityAuthenticator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateCurrentIdentityAuthenticatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go deleted file mode 100644 index 3d68b9dfa..000000000 --- a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateCurrentIdentityAuthenticatorParams creates a new UpdateCurrentIdentityAuthenticatorParams object -// -// There are no default values defined in the spec. -func NewUpdateCurrentIdentityAuthenticatorParams() UpdateCurrentIdentityAuthenticatorParams { - - return UpdateCurrentIdentityAuthenticatorParams{} -} - -// UpdateCurrentIdentityAuthenticatorParams contains all the bound params for the update current identity authenticator operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateCurrentIdentityAuthenticator -type UpdateCurrentIdentityAuthenticatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An authenticator put object - Required: true - In: body - */ - Authenticator *rest_model.AuthenticatorUpdateWithCurrent - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateCurrentIdentityAuthenticatorParams() beforehand. -func (o *UpdateCurrentIdentityAuthenticatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.AuthenticatorUpdateWithCurrent - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("authenticator", "body", "")) - } else { - res = append(res, errors.NewParseError("authenticator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Authenticator = &body - } - } - } else { - res = append(res, errors.Required("authenticator", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateCurrentIdentityAuthenticatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go deleted file mode 100644 index 350d6c974..000000000 --- a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateCurrentIdentityAuthenticatorOKCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorOK -const UpdateCurrentIdentityAuthenticatorOKCode int = 200 - -/*UpdateCurrentIdentityAuthenticatorOK The update request was successful and the resource has been altered - -swagger:response updateCurrentIdentityAuthenticatorOK -*/ -type UpdateCurrentIdentityAuthenticatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorOK creates UpdateCurrentIdentityAuthenticatorOK with default headers values -func NewUpdateCurrentIdentityAuthenticatorOK() *UpdateCurrentIdentityAuthenticatorOK { - - return &UpdateCurrentIdentityAuthenticatorOK{} -} - -// WithPayload adds the payload to the update current identity authenticator o k response -func (o *UpdateCurrentIdentityAuthenticatorOK) WithPayload(payload *rest_model.Empty) *UpdateCurrentIdentityAuthenticatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator o k response -func (o *UpdateCurrentIdentityAuthenticatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCurrentIdentityAuthenticatorBadRequestCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorBadRequest -const UpdateCurrentIdentityAuthenticatorBadRequestCode int = 400 - -/*UpdateCurrentIdentityAuthenticatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateCurrentIdentityAuthenticatorBadRequest -*/ -type UpdateCurrentIdentityAuthenticatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorBadRequest creates UpdateCurrentIdentityAuthenticatorBadRequest with default headers values -func NewUpdateCurrentIdentityAuthenticatorBadRequest() *UpdateCurrentIdentityAuthenticatorBadRequest { - - return &UpdateCurrentIdentityAuthenticatorBadRequest{} -} - -// WithPayload adds the payload to the update current identity authenticator bad request response -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCurrentIdentityAuthenticatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator bad request response -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCurrentIdentityAuthenticatorUnauthorizedCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorUnauthorized -const UpdateCurrentIdentityAuthenticatorUnauthorizedCode int = 401 - -/*UpdateCurrentIdentityAuthenticatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateCurrentIdentityAuthenticatorUnauthorized -*/ -type UpdateCurrentIdentityAuthenticatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorUnauthorized creates UpdateCurrentIdentityAuthenticatorUnauthorized with default headers values -func NewUpdateCurrentIdentityAuthenticatorUnauthorized() *UpdateCurrentIdentityAuthenticatorUnauthorized { - - return &UpdateCurrentIdentityAuthenticatorUnauthorized{} -} - -// WithPayload adds the payload to the update current identity authenticator unauthorized response -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCurrentIdentityAuthenticatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator unauthorized response -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCurrentIdentityAuthenticatorNotFoundCode is the HTTP code returned for type UpdateCurrentIdentityAuthenticatorNotFound -const UpdateCurrentIdentityAuthenticatorNotFoundCode int = 404 - -/*UpdateCurrentIdentityAuthenticatorNotFound The requested resource does not exist - -swagger:response updateCurrentIdentityAuthenticatorNotFound -*/ -type UpdateCurrentIdentityAuthenticatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateCurrentIdentityAuthenticatorNotFound creates UpdateCurrentIdentityAuthenticatorNotFound with default headers values -func NewUpdateCurrentIdentityAuthenticatorNotFound() *UpdateCurrentIdentityAuthenticatorNotFound { - - return &UpdateCurrentIdentityAuthenticatorNotFound{} -} - -// WithPayload adds the payload to the update current identity authenticator not found response -func (o *UpdateCurrentIdentityAuthenticatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateCurrentIdentityAuthenticatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update current identity authenticator not found response -func (o *UpdateCurrentIdentityAuthenticatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCurrentIdentityAuthenticatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go b/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go deleted file mode 100644 index d1ba61b72..000000000 --- a/rest_management_api_server/operations/current_api_session/update_current_identity_authenticator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_api_session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateCurrentIdentityAuthenticatorURL generates an URL for the update current identity authenticator operation -type UpdateCurrentIdentityAuthenticatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCurrentIdentityAuthenticatorURL) WithBasePath(bp string) *UpdateCurrentIdentityAuthenticatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCurrentIdentityAuthenticatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateCurrentIdentityAuthenticatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/authenticators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateCurrentIdentityAuthenticatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateCurrentIdentityAuthenticatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateCurrentIdentityAuthenticatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateCurrentIdentityAuthenticatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateCurrentIdentityAuthenticatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateCurrentIdentityAuthenticatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateCurrentIdentityAuthenticatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes.go b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes.go deleted file mode 100644 index 69b206220..000000000 --- a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMfaRecoveryCodesHandlerFunc turns a function with the right signature into a create mfa recovery codes handler -type CreateMfaRecoveryCodesHandlerFunc func(CreateMfaRecoveryCodesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMfaRecoveryCodesHandlerFunc) Handle(params CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateMfaRecoveryCodesHandler interface for that can handle valid create mfa recovery codes params -type CreateMfaRecoveryCodesHandler interface { - Handle(CreateMfaRecoveryCodesParams, interface{}) middleware.Responder -} - -// NewCreateMfaRecoveryCodes creates a new http.Handler for the create mfa recovery codes operation -func NewCreateMfaRecoveryCodes(ctx *middleware.Context, handler CreateMfaRecoveryCodesHandler) *CreateMfaRecoveryCodes { - return &CreateMfaRecoveryCodes{Context: ctx, Handler: handler} -} - -/* CreateMfaRecoveryCodes swagger:route POST /current-identity/mfa/recovery-codes Current Identity MFA createMfaRecoveryCodes - -For a completed MFA enrollment regenerate the recovery codes - -Allows regeneration of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. This replaces all existing recovery codes. - - -*/ -type CreateMfaRecoveryCodes struct { - Context *middleware.Context - Handler CreateMfaRecoveryCodesHandler -} - -func (o *CreateMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMfaRecoveryCodesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go deleted file mode 100644 index 05cb80b01..000000000 --- a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateMfaRecoveryCodesParams creates a new CreateMfaRecoveryCodesParams object -// -// There are no default values defined in the spec. -func NewCreateMfaRecoveryCodesParams() CreateMfaRecoveryCodesParams { - - return CreateMfaRecoveryCodesParams{} -} - -// CreateMfaRecoveryCodesParams contains all the bound params for the create mfa recovery codes operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMfaRecoveryCodes -type CreateMfaRecoveryCodesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An MFA validation request - Required: true - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMfaRecoveryCodesParams() beforehand. -func (o *CreateMfaRecoveryCodesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("mfaValidation", "body", "")) - } else { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } else { - res = append(res, errors.Required("mfaValidation", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go deleted file mode 100644 index d6e35450e..000000000 --- a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateMfaRecoveryCodesOKCode is the HTTP code returned for type CreateMfaRecoveryCodesOK -const CreateMfaRecoveryCodesOKCode int = 200 - -/*CreateMfaRecoveryCodesOK The recovery codes of an MFA enrollment - -swagger:response createMfaRecoveryCodesOK -*/ -type CreateMfaRecoveryCodesOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailMfaRecoveryCodesEnvelope `json:"body,omitempty"` -} - -// NewCreateMfaRecoveryCodesOK creates CreateMfaRecoveryCodesOK with default headers values -func NewCreateMfaRecoveryCodesOK() *CreateMfaRecoveryCodesOK { - - return &CreateMfaRecoveryCodesOK{} -} - -// WithPayload adds the payload to the create mfa recovery codes o k response -func (o *CreateMfaRecoveryCodesOK) WithPayload(payload *rest_model.DetailMfaRecoveryCodesEnvelope) *CreateMfaRecoveryCodesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create mfa recovery codes o k response -func (o *CreateMfaRecoveryCodesOK) SetPayload(payload *rest_model.DetailMfaRecoveryCodesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMfaRecoveryCodesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMfaRecoveryCodesUnauthorizedCode is the HTTP code returned for type CreateMfaRecoveryCodesUnauthorized -const CreateMfaRecoveryCodesUnauthorizedCode int = 401 - -/*CreateMfaRecoveryCodesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createMfaRecoveryCodesUnauthorized -*/ -type CreateMfaRecoveryCodesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateMfaRecoveryCodesUnauthorized creates CreateMfaRecoveryCodesUnauthorized with default headers values -func NewCreateMfaRecoveryCodesUnauthorized() *CreateMfaRecoveryCodesUnauthorized { - - return &CreateMfaRecoveryCodesUnauthorized{} -} - -// WithPayload adds the payload to the create mfa recovery codes unauthorized response -func (o *CreateMfaRecoveryCodesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateMfaRecoveryCodesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create mfa recovery codes unauthorized response -func (o *CreateMfaRecoveryCodesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMfaRecoveryCodesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMfaRecoveryCodesNotFoundCode is the HTTP code returned for type CreateMfaRecoveryCodesNotFound -const CreateMfaRecoveryCodesNotFoundCode int = 404 - -/*CreateMfaRecoveryCodesNotFound The requested resource does not exist - -swagger:response createMfaRecoveryCodesNotFound -*/ -type CreateMfaRecoveryCodesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateMfaRecoveryCodesNotFound creates CreateMfaRecoveryCodesNotFound with default headers values -func NewCreateMfaRecoveryCodesNotFound() *CreateMfaRecoveryCodesNotFound { - - return &CreateMfaRecoveryCodesNotFound{} -} - -// WithPayload adds the payload to the create mfa recovery codes not found response -func (o *CreateMfaRecoveryCodesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateMfaRecoveryCodesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create mfa recovery codes not found response -func (o *CreateMfaRecoveryCodesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMfaRecoveryCodesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go b/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go deleted file mode 100644 index 537e5e152..000000000 --- a/rest_management_api_server/operations/current_identity/create_mfa_recovery_codes_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMfaRecoveryCodesURL generates an URL for the create mfa recovery codes operation -type CreateMfaRecoveryCodesURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMfaRecoveryCodesURL) WithBasePath(bp string) *CreateMfaRecoveryCodesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMfaRecoveryCodesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMfaRecoveryCodesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/recovery-codes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMfaRecoveryCodesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMfaRecoveryCodesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMfaRecoveryCodesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMfaRecoveryCodesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMfaRecoveryCodesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMfaRecoveryCodesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/delete_mfa.go b/rest_management_api_server/operations/current_identity/delete_mfa.go deleted file mode 100644 index f1d223a8a..000000000 --- a/rest_management_api_server/operations/current_identity/delete_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteMfaHandlerFunc turns a function with the right signature into a delete mfa handler -type DeleteMfaHandlerFunc func(DeleteMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteMfaHandlerFunc) Handle(params DeleteMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteMfaHandler interface for that can handle valid delete mfa params -type DeleteMfaHandler interface { - Handle(DeleteMfaParams, interface{}) middleware.Responder -} - -// NewDeleteMfa creates a new http.Handler for the delete mfa operation -func NewDeleteMfa(ctx *middleware.Context, handler DeleteMfaHandler) *DeleteMfa { - return &DeleteMfa{Context: ctx, Handler: handler} -} - -/* DeleteMfa swagger:route DELETE /current-identity/mfa Current Identity MFA deleteMfa - -Disable MFA for the current identity - -Disable MFA for the current identity. Requires a current valid time based one time password if MFA enrollment has been completed. If not, code should be an empty string. If one time passwords are not available and admin account can be used to remove MFA from the identity via `DELETE /identities//mfa`. - - -*/ -type DeleteMfa struct { - Context *middleware.Context - Handler DeleteMfaHandler -} - -func (o *DeleteMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/delete_mfa_parameters.go b/rest_management_api_server/operations/current_identity/delete_mfa_parameters.go deleted file mode 100644 index 8b8d084ed..000000000 --- a/rest_management_api_server/operations/current_identity/delete_mfa_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewDeleteMfaParams creates a new DeleteMfaParams object -// -// There are no default values defined in the spec. -func NewDeleteMfaParams() DeleteMfaParams { - - return DeleteMfaParams{} -} - -// DeleteMfaParams contains all the bound params for the delete mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteMfa -type DeleteMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: header - */ - MfaValidationCode *string - /*An MFA validation request - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteMfaParams() beforehand. -func (o *DeleteMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindMfaValidationCode(r.Header[http.CanonicalHeaderKey("mfa-validation-code")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMfaValidationCode binds and validates parameter MfaValidationCode from header. -func (o *DeleteMfaParams) bindMfaValidationCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.MfaValidationCode = &raw - - return nil -} diff --git a/rest_management_api_server/operations/current_identity/delete_mfa_responses.go b/rest_management_api_server/operations/current_identity/delete_mfa_responses.go deleted file mode 100644 index 20a9c3e42..000000000 --- a/rest_management_api_server/operations/current_identity/delete_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteMfaOKCode is the HTTP code returned for type DeleteMfaOK -const DeleteMfaOKCode int = 200 - -/*DeleteMfaOK Base empty response - -swagger:response deleteMfaOK -*/ -type DeleteMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteMfaOK creates DeleteMfaOK with default headers values -func NewDeleteMfaOK() *DeleteMfaOK { - - return &DeleteMfaOK{} -} - -// WithPayload adds the payload to the delete mfa o k response -func (o *DeleteMfaOK) WithPayload(payload *rest_model.Empty) *DeleteMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete mfa o k response -func (o *DeleteMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMfaUnauthorizedCode is the HTTP code returned for type DeleteMfaUnauthorized -const DeleteMfaUnauthorizedCode int = 401 - -/*DeleteMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteMfaUnauthorized -*/ -type DeleteMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteMfaUnauthorized creates DeleteMfaUnauthorized with default headers values -func NewDeleteMfaUnauthorized() *DeleteMfaUnauthorized { - - return &DeleteMfaUnauthorized{} -} - -// WithPayload adds the payload to the delete mfa unauthorized response -func (o *DeleteMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete mfa unauthorized response -func (o *DeleteMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMfaNotFoundCode is the HTTP code returned for type DeleteMfaNotFound -const DeleteMfaNotFoundCode int = 404 - -/*DeleteMfaNotFound The requested resource does not exist - -swagger:response deleteMfaNotFound -*/ -type DeleteMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteMfaNotFound creates DeleteMfaNotFound with default headers values -func NewDeleteMfaNotFound() *DeleteMfaNotFound { - - return &DeleteMfaNotFound{} -} - -// WithPayload adds the payload to the delete mfa not found response -func (o *DeleteMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete mfa not found response -func (o *DeleteMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/delete_mfa_urlbuilder.go b/rest_management_api_server/operations/current_identity/delete_mfa_urlbuilder.go deleted file mode 100644 index f2b3efe18..000000000 --- a/rest_management_api_server/operations/current_identity/delete_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DeleteMfaURL generates an URL for the delete mfa operation -type DeleteMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMfaURL) WithBasePath(bp string) *DeleteMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa.go b/rest_management_api_server/operations/current_identity/detail_mfa.go deleted file mode 100644 index bdcf3a6f1..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailMfaHandlerFunc turns a function with the right signature into a detail mfa handler -type DetailMfaHandlerFunc func(DetailMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailMfaHandlerFunc) Handle(params DetailMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailMfaHandler interface for that can handle valid detail mfa params -type DetailMfaHandler interface { - Handle(DetailMfaParams, interface{}) middleware.Responder -} - -// NewDetailMfa creates a new http.Handler for the detail mfa operation -func NewDetailMfa(ctx *middleware.Context, handler DetailMfaHandler) *DetailMfa { - return &DetailMfa{Context: ctx, Handler: handler} -} - -/* DetailMfa swagger:route GET /current-identity/mfa Current Identity MFA detailMfa - -Returns the current status of MFA enrollment - -Returns details about the current MFA enrollment. If enrollment has not been completed it will return the current MFA configuration details necessary to complete a `POST /current-identity/mfa/verify`. - - -*/ -type DetailMfa struct { - Context *middleware.Context - Handler DetailMfaHandler -} - -func (o *DetailMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_parameters.go b/rest_management_api_server/operations/current_identity/detail_mfa_parameters.go deleted file mode 100644 index 193dfed87..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDetailMfaParams creates a new DetailMfaParams object -// -// There are no default values defined in the spec. -func NewDetailMfaParams() DetailMfaParams { - - return DetailMfaParams{} -} - -// DetailMfaParams contains all the bound params for the detail mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailMfa -type DetailMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailMfaParams() beforehand. -func (o *DetailMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code.go b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code.go deleted file mode 100644 index d6c3c01ac..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailMfaQrCodeHandlerFunc turns a function with the right signature into a detail mfa qr code handler -type DetailMfaQrCodeHandlerFunc func(DetailMfaQrCodeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailMfaQrCodeHandlerFunc) Handle(params DetailMfaQrCodeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailMfaQrCodeHandler interface for that can handle valid detail mfa qr code params -type DetailMfaQrCodeHandler interface { - Handle(DetailMfaQrCodeParams, interface{}) middleware.Responder -} - -// NewDetailMfaQrCode creates a new http.Handler for the detail mfa qr code operation -func NewDetailMfaQrCode(ctx *middleware.Context, handler DetailMfaQrCodeHandler) *DetailMfaQrCode { - return &DetailMfaQrCode{Context: ctx, Handler: handler} -} - -/* DetailMfaQrCode swagger:route GET /current-identity/mfa/qr-code Current Identity MFA detailMfaQrCode - -Show a QR code for unverified MFA enrollments - -Shows an QR code image for unverified MFA enrollments. 404s if the MFA enrollment has been completed or not started. - - -*/ -type DetailMfaQrCode struct { - Context *middleware.Context - Handler DetailMfaQrCodeHandler -} - -func (o *DetailMfaQrCode) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailMfaQrCodeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go deleted file mode 100644 index 79cc9ea72..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDetailMfaQrCodeParams creates a new DetailMfaQrCodeParams object -// -// There are no default values defined in the spec. -func NewDetailMfaQrCodeParams() DetailMfaQrCodeParams { - - return DetailMfaQrCodeParams{} -} - -// DetailMfaQrCodeParams contains all the bound params for the detail mfa qr code operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailMfaQrCode -type DetailMfaQrCodeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailMfaQrCodeParams() beforehand. -func (o *DetailMfaQrCodeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_responses.go b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_responses.go deleted file mode 100644 index d82baeb0a..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_responses.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// DetailMfaQrCodeOKCode is the HTTP code returned for type DetailMfaQrCodeOK -const DetailMfaQrCodeOKCode int = 200 - -/*DetailMfaQrCodeOK OK - -swagger:response detailMfaQrCodeOK -*/ -type DetailMfaQrCodeOK struct { -} - -// NewDetailMfaQrCodeOK creates DetailMfaQrCodeOK with default headers values -func NewDetailMfaQrCodeOK() *DetailMfaQrCodeOK { - - return &DetailMfaQrCodeOK{} -} - -// WriteResponse to the client -func (o *DetailMfaQrCodeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(200) -} - -// DetailMfaQrCodeNotFoundCode is the HTTP code returned for type DetailMfaQrCodeNotFound -const DetailMfaQrCodeNotFoundCode int = 404 - -/*DetailMfaQrCodeNotFound No MFA enrollment or MFA enrollment is completed - -swagger:response detailMfaQrCodeNotFound -*/ -type DetailMfaQrCodeNotFound struct { -} - -// NewDetailMfaQrCodeNotFound creates DetailMfaQrCodeNotFound with default headers values -func NewDetailMfaQrCodeNotFound() *DetailMfaQrCodeNotFound { - - return &DetailMfaQrCodeNotFound{} -} - -// WriteResponse to the client -func (o *DetailMfaQrCodeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go b/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go deleted file mode 100644 index 6eaa97c04..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_qr_code_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DetailMfaQrCodeURL generates an URL for the detail mfa qr code operation -type DetailMfaQrCodeURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaQrCodeURL) WithBasePath(bp string) *DetailMfaQrCodeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaQrCodeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailMfaQrCodeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/qr-code" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailMfaQrCodeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailMfaQrCodeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailMfaQrCodeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailMfaQrCodeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailMfaQrCodeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailMfaQrCodeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes.go b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes.go deleted file mode 100644 index 39f25d570..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailMfaRecoveryCodesHandlerFunc turns a function with the right signature into a detail mfa recovery codes handler -type DetailMfaRecoveryCodesHandlerFunc func(DetailMfaRecoveryCodesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailMfaRecoveryCodesHandlerFunc) Handle(params DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailMfaRecoveryCodesHandler interface for that can handle valid detail mfa recovery codes params -type DetailMfaRecoveryCodesHandler interface { - Handle(DetailMfaRecoveryCodesParams, interface{}) middleware.Responder -} - -// NewDetailMfaRecoveryCodes creates a new http.Handler for the detail mfa recovery codes operation -func NewDetailMfaRecoveryCodes(ctx *middleware.Context, handler DetailMfaRecoveryCodesHandler) *DetailMfaRecoveryCodes { - return &DetailMfaRecoveryCodes{Context: ctx, Handler: handler} -} - -/* DetailMfaRecoveryCodes swagger:route GET /current-identity/mfa/recovery-codes Current Identity MFA detailMfaRecoveryCodes - -For a completed MFA enrollment view the current recovery codes - -Allows the viewing of recovery codes of an MFA enrollment. Requires a current valid time based one time password to interact with. Available after a completed MFA enrollment. - - -*/ -type DetailMfaRecoveryCodes struct { - Context *middleware.Context - Handler DetailMfaRecoveryCodesHandler -} - -func (o *DetailMfaRecoveryCodes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailMfaRecoveryCodesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go deleted file mode 100644 index 2184f7921..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_parameters.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewDetailMfaRecoveryCodesParams creates a new DetailMfaRecoveryCodesParams object -// -// There are no default values defined in the spec. -func NewDetailMfaRecoveryCodesParams() DetailMfaRecoveryCodesParams { - - return DetailMfaRecoveryCodesParams{} -} - -// DetailMfaRecoveryCodesParams contains all the bound params for the detail mfa recovery codes operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailMfaRecoveryCodes -type DetailMfaRecoveryCodesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: header - */ - MfaValidationCode *string - /*An MFA validation request - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailMfaRecoveryCodesParams() beforehand. -func (o *DetailMfaRecoveryCodesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindMfaValidationCode(r.Header[http.CanonicalHeaderKey("mfa-validation-code")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMfaValidationCode binds and validates parameter MfaValidationCode from header. -func (o *DetailMfaRecoveryCodesParams) bindMfaValidationCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.MfaValidationCode = &raw - - return nil -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go deleted file mode 100644 index b701009b4..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaRecoveryCodesOKCode is the HTTP code returned for type DetailMfaRecoveryCodesOK -const DetailMfaRecoveryCodesOKCode int = 200 - -/*DetailMfaRecoveryCodesOK Base empty response - -swagger:response detailMfaRecoveryCodesOK -*/ -type DetailMfaRecoveryCodesOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDetailMfaRecoveryCodesOK creates DetailMfaRecoveryCodesOK with default headers values -func NewDetailMfaRecoveryCodesOK() *DetailMfaRecoveryCodesOK { - - return &DetailMfaRecoveryCodesOK{} -} - -// WithPayload adds the payload to the detail mfa recovery codes o k response -func (o *DetailMfaRecoveryCodesOK) WithPayload(payload *rest_model.Empty) *DetailMfaRecoveryCodesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa recovery codes o k response -func (o *DetailMfaRecoveryCodesOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaRecoveryCodesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaRecoveryCodesUnauthorizedCode is the HTTP code returned for type DetailMfaRecoveryCodesUnauthorized -const DetailMfaRecoveryCodesUnauthorizedCode int = 401 - -/*DetailMfaRecoveryCodesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailMfaRecoveryCodesUnauthorized -*/ -type DetailMfaRecoveryCodesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaRecoveryCodesUnauthorized creates DetailMfaRecoveryCodesUnauthorized with default headers values -func NewDetailMfaRecoveryCodesUnauthorized() *DetailMfaRecoveryCodesUnauthorized { - - return &DetailMfaRecoveryCodesUnauthorized{} -} - -// WithPayload adds the payload to the detail mfa recovery codes unauthorized response -func (o *DetailMfaRecoveryCodesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaRecoveryCodesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa recovery codes unauthorized response -func (o *DetailMfaRecoveryCodesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaRecoveryCodesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaRecoveryCodesNotFoundCode is the HTTP code returned for type DetailMfaRecoveryCodesNotFound -const DetailMfaRecoveryCodesNotFoundCode int = 404 - -/*DetailMfaRecoveryCodesNotFound The requested resource does not exist - -swagger:response detailMfaRecoveryCodesNotFound -*/ -type DetailMfaRecoveryCodesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaRecoveryCodesNotFound creates DetailMfaRecoveryCodesNotFound with default headers values -func NewDetailMfaRecoveryCodesNotFound() *DetailMfaRecoveryCodesNotFound { - - return &DetailMfaRecoveryCodesNotFound{} -} - -// WithPayload adds the payload to the detail mfa recovery codes not found response -func (o *DetailMfaRecoveryCodesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaRecoveryCodesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa recovery codes not found response -func (o *DetailMfaRecoveryCodesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaRecoveryCodesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go b/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go deleted file mode 100644 index 25265c7ce..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_recovery_codes_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DetailMfaRecoveryCodesURL generates an URL for the detail mfa recovery codes operation -type DetailMfaRecoveryCodesURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaRecoveryCodesURL) WithBasePath(bp string) *DetailMfaRecoveryCodesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaRecoveryCodesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailMfaRecoveryCodesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/recovery-codes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailMfaRecoveryCodesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailMfaRecoveryCodesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailMfaRecoveryCodesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailMfaRecoveryCodesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailMfaRecoveryCodesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailMfaRecoveryCodesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_responses.go b/rest_management_api_server/operations/current_identity/detail_mfa_responses.go deleted file mode 100644 index 95431cbec..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailMfaOKCode is the HTTP code returned for type DetailMfaOK -const DetailMfaOKCode int = 200 - -/*DetailMfaOK The details of an MFA enrollment - -swagger:response detailMfaOK -*/ -type DetailMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailMfaEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaOK creates DetailMfaOK with default headers values -func NewDetailMfaOK() *DetailMfaOK { - - return &DetailMfaOK{} -} - -// WithPayload adds the payload to the detail mfa o k response -func (o *DetailMfaOK) WithPayload(payload *rest_model.DetailMfaEnvelope) *DetailMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa o k response -func (o *DetailMfaOK) SetPayload(payload *rest_model.DetailMfaEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaUnauthorizedCode is the HTTP code returned for type DetailMfaUnauthorized -const DetailMfaUnauthorizedCode int = 401 - -/*DetailMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailMfaUnauthorized -*/ -type DetailMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaUnauthorized creates DetailMfaUnauthorized with default headers values -func NewDetailMfaUnauthorized() *DetailMfaUnauthorized { - - return &DetailMfaUnauthorized{} -} - -// WithPayload adds the payload to the detail mfa unauthorized response -func (o *DetailMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa unauthorized response -func (o *DetailMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailMfaNotFoundCode is the HTTP code returned for type DetailMfaNotFound -const DetailMfaNotFoundCode int = 404 - -/*DetailMfaNotFound The requested resource does not exist - -swagger:response detailMfaNotFound -*/ -type DetailMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailMfaNotFound creates DetailMfaNotFound with default headers values -func NewDetailMfaNotFound() *DetailMfaNotFound { - - return &DetailMfaNotFound{} -} - -// WithPayload adds the payload to the detail mfa not found response -func (o *DetailMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail mfa not found response -func (o *DetailMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/detail_mfa_urlbuilder.go b/rest_management_api_server/operations/current_identity/detail_mfa_urlbuilder.go deleted file mode 100644 index 2239fd0dc..000000000 --- a/rest_management_api_server/operations/current_identity/detail_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DetailMfaURL generates an URL for the detail mfa operation -type DetailMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaURL) WithBasePath(bp string) *DetailMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/enroll_mfa.go b/rest_management_api_server/operations/current_identity/enroll_mfa.go deleted file mode 100644 index a3198da0c..000000000 --- a/rest_management_api_server/operations/current_identity/enroll_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnrollMfaHandlerFunc turns a function with the right signature into a enroll mfa handler -type EnrollMfaHandlerFunc func(EnrollMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnrollMfaHandlerFunc) Handle(params EnrollMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// EnrollMfaHandler interface for that can handle valid enroll mfa params -type EnrollMfaHandler interface { - Handle(EnrollMfaParams, interface{}) middleware.Responder -} - -// NewEnrollMfa creates a new http.Handler for the enroll mfa operation -func NewEnrollMfa(ctx *middleware.Context, handler EnrollMfaHandler) *EnrollMfa { - return &EnrollMfa{Context: ctx, Handler: handler} -} - -/* EnrollMfa swagger:route POST /current-identity/mfa Current Identity MFA enrollMfa - -Initiate MFA enrollment - -Allows authenticator based MFA enrollment. If enrollment has already been completed, it must be disabled before attempting to re-enroll. Subsequent enrollment request is completed via `POST /current-identity/mfa/verify` - - -*/ -type EnrollMfa struct { - Context *middleware.Context - Handler EnrollMfaHandler -} - -func (o *EnrollMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnrollMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/enroll_mfa_parameters.go b/rest_management_api_server/operations/current_identity/enroll_mfa_parameters.go deleted file mode 100644 index 7dd1be19b..000000000 --- a/rest_management_api_server/operations/current_identity/enroll_mfa_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewEnrollMfaParams creates a new EnrollMfaParams object -// -// There are no default values defined in the spec. -func NewEnrollMfaParams() EnrollMfaParams { - - return EnrollMfaParams{} -} - -// EnrollMfaParams contains all the bound params for the enroll mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters enrollMfa -type EnrollMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnrollMfaParams() beforehand. -func (o *EnrollMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_identity/enroll_mfa_responses.go b/rest_management_api_server/operations/current_identity/enroll_mfa_responses.go deleted file mode 100644 index 129c7f35f..000000000 --- a/rest_management_api_server/operations/current_identity/enroll_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnrollMfaCreatedCode is the HTTP code returned for type EnrollMfaCreated -const EnrollMfaCreatedCode int = 201 - -/*EnrollMfaCreated The create request was successful and the resource has been added at the following location - -swagger:response enrollMfaCreated -*/ -type EnrollMfaCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewEnrollMfaCreated creates EnrollMfaCreated with default headers values -func NewEnrollMfaCreated() *EnrollMfaCreated { - - return &EnrollMfaCreated{} -} - -// WithPayload adds the payload to the enroll mfa created response -func (o *EnrollMfaCreated) WithPayload(payload *rest_model.CreateEnvelope) *EnrollMfaCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll mfa created response -func (o *EnrollMfaCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollMfaCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnrollMfaUnauthorizedCode is the HTTP code returned for type EnrollMfaUnauthorized -const EnrollMfaUnauthorizedCode int = 401 - -/*EnrollMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response enrollMfaUnauthorized -*/ -type EnrollMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollMfaUnauthorized creates EnrollMfaUnauthorized with default headers values -func NewEnrollMfaUnauthorized() *EnrollMfaUnauthorized { - - return &EnrollMfaUnauthorized{} -} - -// WithPayload adds the payload to the enroll mfa unauthorized response -func (o *EnrollMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll mfa unauthorized response -func (o *EnrollMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnrollMfaConflictCode is the HTTP code returned for type EnrollMfaConflict -const EnrollMfaConflictCode int = 409 - -/*EnrollMfaConflict The identity is already enrolled in MFA - -swagger:response enrollMfaConflict -*/ -type EnrollMfaConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnrollMfaConflict creates EnrollMfaConflict with default headers values -func NewEnrollMfaConflict() *EnrollMfaConflict { - - return &EnrollMfaConflict{} -} - -// WithPayload adds the payload to the enroll mfa conflict response -func (o *EnrollMfaConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *EnrollMfaConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enroll mfa conflict response -func (o *EnrollMfaConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnrollMfaConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/enroll_mfa_urlbuilder.go b/rest_management_api_server/operations/current_identity/enroll_mfa_urlbuilder.go deleted file mode 100644 index f229f0cfb..000000000 --- a/rest_management_api_server/operations/current_identity/enroll_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// EnrollMfaURL generates an URL for the enroll mfa operation -type EnrollMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollMfaURL) WithBasePath(bp string) *EnrollMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnrollMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnrollMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnrollMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnrollMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnrollMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnrollMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnrollMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnrollMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/get_current_identity.go b/rest_management_api_server/operations/current_identity/get_current_identity.go deleted file mode 100644 index 5977517ed..000000000 --- a/rest_management_api_server/operations/current_identity/get_current_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCurrentIdentityHandlerFunc turns a function with the right signature into a get current identity handler -type GetCurrentIdentityHandlerFunc func(GetCurrentIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCurrentIdentityHandlerFunc) Handle(params GetCurrentIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetCurrentIdentityHandler interface for that can handle valid get current identity params -type GetCurrentIdentityHandler interface { - Handle(GetCurrentIdentityParams, interface{}) middleware.Responder -} - -// NewGetCurrentIdentity creates a new http.Handler for the get current identity operation -func NewGetCurrentIdentity(ctx *middleware.Context, handler GetCurrentIdentityHandler) *GetCurrentIdentity { - return &GetCurrentIdentity{Context: ctx, Handler: handler} -} - -/* GetCurrentIdentity swagger:route GET /current-identity Current Identity getCurrentIdentity - -Return the current identity - -Returns the identity associated with the API sessions used to issue the current request - -*/ -type GetCurrentIdentity struct { - Context *middleware.Context - Handler GetCurrentIdentityHandler -} - -func (o *GetCurrentIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCurrentIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/get_current_identity_parameters.go b/rest_management_api_server/operations/current_identity/get_current_identity_parameters.go deleted file mode 100644 index 8dcd51073..000000000 --- a/rest_management_api_server/operations/current_identity/get_current_identity_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetCurrentIdentityParams creates a new GetCurrentIdentityParams object -// -// There are no default values defined in the spec. -func NewGetCurrentIdentityParams() GetCurrentIdentityParams { - - return GetCurrentIdentityParams{} -} - -// GetCurrentIdentityParams contains all the bound params for the get current identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCurrentIdentity -type GetCurrentIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCurrentIdentityParams() beforehand. -func (o *GetCurrentIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_identity/get_current_identity_responses.go b/rest_management_api_server/operations/current_identity/get_current_identity_responses.go deleted file mode 100644 index 88ab42cd7..000000000 --- a/rest_management_api_server/operations/current_identity/get_current_identity_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetCurrentIdentityOKCode is the HTTP code returned for type GetCurrentIdentityOK -const GetCurrentIdentityOKCode int = 200 - -/*GetCurrentIdentityOK The identity associated with the API Session used to issue the request - -swagger:response getCurrentIdentityOK -*/ -type GetCurrentIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.CurrentIdentityDetailEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentIdentityOK creates GetCurrentIdentityOK with default headers values -func NewGetCurrentIdentityOK() *GetCurrentIdentityOK { - - return &GetCurrentIdentityOK{} -} - -// WithPayload adds the payload to the get current identity o k response -func (o *GetCurrentIdentityOK) WithPayload(payload *rest_model.CurrentIdentityDetailEnvelope) *GetCurrentIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current identity o k response -func (o *GetCurrentIdentityOK) SetPayload(payload *rest_model.CurrentIdentityDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCurrentIdentityUnauthorizedCode is the HTTP code returned for type GetCurrentIdentityUnauthorized -const GetCurrentIdentityUnauthorizedCode int = 401 - -/*GetCurrentIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getCurrentIdentityUnauthorized -*/ -type GetCurrentIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetCurrentIdentityUnauthorized creates GetCurrentIdentityUnauthorized with default headers values -func NewGetCurrentIdentityUnauthorized() *GetCurrentIdentityUnauthorized { - - return &GetCurrentIdentityUnauthorized{} -} - -// WithPayload adds the payload to the get current identity unauthorized response -func (o *GetCurrentIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetCurrentIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get current identity unauthorized response -func (o *GetCurrentIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCurrentIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/get_current_identity_urlbuilder.go b/rest_management_api_server/operations/current_identity/get_current_identity_urlbuilder.go deleted file mode 100644 index 41d6e8b33..000000000 --- a/rest_management_api_server/operations/current_identity/get_current_identity_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetCurrentIdentityURL generates an URL for the get current identity operation -type GetCurrentIdentityURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentIdentityURL) WithBasePath(bp string) *GetCurrentIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCurrentIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCurrentIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCurrentIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCurrentIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCurrentIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCurrentIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCurrentIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCurrentIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/current_identity/verify_mfa.go b/rest_management_api_server/operations/current_identity/verify_mfa.go deleted file mode 100644 index c6971318b..000000000 --- a/rest_management_api_server/operations/current_identity/verify_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// VerifyMfaHandlerFunc turns a function with the right signature into a verify mfa handler -type VerifyMfaHandlerFunc func(VerifyMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn VerifyMfaHandlerFunc) Handle(params VerifyMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// VerifyMfaHandler interface for that can handle valid verify mfa params -type VerifyMfaHandler interface { - Handle(VerifyMfaParams, interface{}) middleware.Responder -} - -// NewVerifyMfa creates a new http.Handler for the verify mfa operation -func NewVerifyMfa(ctx *middleware.Context, handler VerifyMfaHandler) *VerifyMfa { - return &VerifyMfa{Context: ctx, Handler: handler} -} - -/* VerifyMfa swagger:route POST /current-identity/mfa/verify Current Identity MFA verifyMfa - -Complete MFA enrollment by verifying a time based one time token - -Completes MFA enrollment by accepting a time based one time password as verification. Called after MFA enrollment has been initiated via `POST /current-identity/mfa`. - - -*/ -type VerifyMfa struct { - Context *middleware.Context - Handler VerifyMfaHandler -} - -func (o *VerifyMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewVerifyMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/current_identity/verify_mfa_parameters.go b/rest_management_api_server/operations/current_identity/verify_mfa_parameters.go deleted file mode 100644 index 18e642116..000000000 --- a/rest_management_api_server/operations/current_identity/verify_mfa_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewVerifyMfaParams creates a new VerifyMfaParams object -// -// There are no default values defined in the spec. -func NewVerifyMfaParams() VerifyMfaParams { - - return VerifyMfaParams{} -} - -// VerifyMfaParams contains all the bound params for the verify mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters verifyMfa -type VerifyMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An MFA validation request - Required: true - In: body - */ - MfaValidation *rest_model.MfaCode -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewVerifyMfaParams() beforehand. -func (o *VerifyMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.MfaCode - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("mfaValidation", "body", "")) - } else { - res = append(res, errors.NewParseError("mfaValidation", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.MfaValidation = &body - } - } - } else { - res = append(res, errors.Required("mfaValidation", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/current_identity/verify_mfa_responses.go b/rest_management_api_server/operations/current_identity/verify_mfa_responses.go deleted file mode 100644 index 3c8bfc849..000000000 --- a/rest_management_api_server/operations/current_identity/verify_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// VerifyMfaOKCode is the HTTP code returned for type VerifyMfaOK -const VerifyMfaOKCode int = 200 - -/*VerifyMfaOK Base empty response - -swagger:response verifyMfaOK -*/ -type VerifyMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewVerifyMfaOK creates VerifyMfaOK with default headers values -func NewVerifyMfaOK() *VerifyMfaOK { - - return &VerifyMfaOK{} -} - -// WithPayload adds the payload to the verify mfa o k response -func (o *VerifyMfaOK) WithPayload(payload *rest_model.Empty) *VerifyMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify mfa o k response -func (o *VerifyMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyMfaUnauthorizedCode is the HTTP code returned for type VerifyMfaUnauthorized -const VerifyMfaUnauthorizedCode int = 401 - -/*VerifyMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response verifyMfaUnauthorized -*/ -type VerifyMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyMfaUnauthorized creates VerifyMfaUnauthorized with default headers values -func NewVerifyMfaUnauthorized() *VerifyMfaUnauthorized { - - return &VerifyMfaUnauthorized{} -} - -// WithPayload adds the payload to the verify mfa unauthorized response -func (o *VerifyMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify mfa unauthorized response -func (o *VerifyMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VerifyMfaNotFoundCode is the HTTP code returned for type VerifyMfaNotFound -const VerifyMfaNotFoundCode int = 404 - -/*VerifyMfaNotFound The requested resource does not exist - -swagger:response verifyMfaNotFound -*/ -type VerifyMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewVerifyMfaNotFound creates VerifyMfaNotFound with default headers values -func NewVerifyMfaNotFound() *VerifyMfaNotFound { - - return &VerifyMfaNotFound{} -} - -// WithPayload adds the payload to the verify mfa not found response -func (o *VerifyMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *VerifyMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the verify mfa not found response -func (o *VerifyMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VerifyMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/current_identity/verify_mfa_urlbuilder.go b/rest_management_api_server/operations/current_identity/verify_mfa_urlbuilder.go deleted file mode 100644 index df37d977f..000000000 --- a/rest_management_api_server/operations/current_identity/verify_mfa_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package current_identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// VerifyMfaURL generates an URL for the verify mfa operation -type VerifyMfaURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VerifyMfaURL) WithBasePath(bp string) *VerifyMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VerifyMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *VerifyMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/current-identity/mfa/verify" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *VerifyMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *VerifyMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *VerifyMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on VerifyMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on VerifyMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *VerifyMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/database/check_data_integrity.go b/rest_management_api_server/operations/database/check_data_integrity.go deleted file mode 100644 index b9adacad6..000000000 --- a/rest_management_api_server/operations/database/check_data_integrity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CheckDataIntegrityHandlerFunc turns a function with the right signature into a check data integrity handler -type CheckDataIntegrityHandlerFunc func(CheckDataIntegrityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CheckDataIntegrityHandlerFunc) Handle(params CheckDataIntegrityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CheckDataIntegrityHandler interface for that can handle valid check data integrity params -type CheckDataIntegrityHandler interface { - Handle(CheckDataIntegrityParams, interface{}) middleware.Responder -} - -// NewCheckDataIntegrity creates a new http.Handler for the check data integrity operation -func NewCheckDataIntegrity(ctx *middleware.Context, handler CheckDataIntegrityHandler) *CheckDataIntegrity { - return &CheckDataIntegrity{Context: ctx, Handler: handler} -} - -/* CheckDataIntegrity swagger:route POST /database/check-data-integrity Database checkDataIntegrity - -Starts a data integrity scan on the datastore - -Starts a data integrity scan on the datastore. Requires admin access. Only once instance may run at a time, including runs of fixDataIntegrity. - -*/ -type CheckDataIntegrity struct { - Context *middleware.Context - Handler CheckDataIntegrityHandler -} - -func (o *CheckDataIntegrity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCheckDataIntegrityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/database/check_data_integrity_parameters.go b/rest_management_api_server/operations/database/check_data_integrity_parameters.go deleted file mode 100644 index a35cacd3d..000000000 --- a/rest_management_api_server/operations/database/check_data_integrity_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewCheckDataIntegrityParams creates a new CheckDataIntegrityParams object -// -// There are no default values defined in the spec. -func NewCheckDataIntegrityParams() CheckDataIntegrityParams { - - return CheckDataIntegrityParams{} -} - -// CheckDataIntegrityParams contains all the bound params for the check data integrity operation -// typically these are obtained from a http.Request -// -// swagger:parameters checkDataIntegrity -type CheckDataIntegrityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCheckDataIntegrityParams() beforehand. -func (o *CheckDataIntegrityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/database/check_data_integrity_responses.go b/rest_management_api_server/operations/database/check_data_integrity_responses.go deleted file mode 100644 index 8180a9710..000000000 --- a/rest_management_api_server/operations/database/check_data_integrity_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CheckDataIntegrityAcceptedCode is the HTTP code returned for type CheckDataIntegrityAccepted -const CheckDataIntegrityAcceptedCode int = 202 - -/*CheckDataIntegrityAccepted Base empty response - -swagger:response checkDataIntegrityAccepted -*/ -type CheckDataIntegrityAccepted struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewCheckDataIntegrityAccepted creates CheckDataIntegrityAccepted with default headers values -func NewCheckDataIntegrityAccepted() *CheckDataIntegrityAccepted { - - return &CheckDataIntegrityAccepted{} -} - -// WithPayload adds the payload to the check data integrity accepted response -func (o *CheckDataIntegrityAccepted) WithPayload(payload *rest_model.Empty) *CheckDataIntegrityAccepted { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the check data integrity accepted response -func (o *CheckDataIntegrityAccepted) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CheckDataIntegrityAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(202) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CheckDataIntegrityUnauthorizedCode is the HTTP code returned for type CheckDataIntegrityUnauthorized -const CheckDataIntegrityUnauthorizedCode int = 401 - -/*CheckDataIntegrityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response checkDataIntegrityUnauthorized -*/ -type CheckDataIntegrityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCheckDataIntegrityUnauthorized creates CheckDataIntegrityUnauthorized with default headers values -func NewCheckDataIntegrityUnauthorized() *CheckDataIntegrityUnauthorized { - - return &CheckDataIntegrityUnauthorized{} -} - -// WithPayload adds the payload to the check data integrity unauthorized response -func (o *CheckDataIntegrityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CheckDataIntegrityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the check data integrity unauthorized response -func (o *CheckDataIntegrityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CheckDataIntegrityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CheckDataIntegrityTooManyRequestsCode is the HTTP code returned for type CheckDataIntegrityTooManyRequests -const CheckDataIntegrityTooManyRequestsCode int = 429 - -/*CheckDataIntegrityTooManyRequests The resource requested is rate limited and the rate limit has been exceeded - -swagger:response checkDataIntegrityTooManyRequests -*/ -type CheckDataIntegrityTooManyRequests struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCheckDataIntegrityTooManyRequests creates CheckDataIntegrityTooManyRequests with default headers values -func NewCheckDataIntegrityTooManyRequests() *CheckDataIntegrityTooManyRequests { - - return &CheckDataIntegrityTooManyRequests{} -} - -// WithPayload adds the payload to the check data integrity too many requests response -func (o *CheckDataIntegrityTooManyRequests) WithPayload(payload *rest_model.APIErrorEnvelope) *CheckDataIntegrityTooManyRequests { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the check data integrity too many requests response -func (o *CheckDataIntegrityTooManyRequests) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CheckDataIntegrityTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(429) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/database/check_data_integrity_urlbuilder.go b/rest_management_api_server/operations/database/check_data_integrity_urlbuilder.go deleted file mode 100644 index d8a398643..000000000 --- a/rest_management_api_server/operations/database/check_data_integrity_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CheckDataIntegrityURL generates an URL for the check data integrity operation -type CheckDataIntegrityURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CheckDataIntegrityURL) WithBasePath(bp string) *CheckDataIntegrityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CheckDataIntegrityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CheckDataIntegrityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/database/check-data-integrity" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CheckDataIntegrityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CheckDataIntegrityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CheckDataIntegrityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CheckDataIntegrityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CheckDataIntegrityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CheckDataIntegrityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/database/create_database_snapshot.go b/rest_management_api_server/operations/database/create_database_snapshot.go deleted file mode 100644 index 42b9e6eef..000000000 --- a/rest_management_api_server/operations/database/create_database_snapshot.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateDatabaseSnapshotHandlerFunc turns a function with the right signature into a create database snapshot handler -type CreateDatabaseSnapshotHandlerFunc func(CreateDatabaseSnapshotParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateDatabaseSnapshotHandlerFunc) Handle(params CreateDatabaseSnapshotParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateDatabaseSnapshotHandler interface for that can handle valid create database snapshot params -type CreateDatabaseSnapshotHandler interface { - Handle(CreateDatabaseSnapshotParams, interface{}) middleware.Responder -} - -// NewCreateDatabaseSnapshot creates a new http.Handler for the create database snapshot operation -func NewCreateDatabaseSnapshot(ctx *middleware.Context, handler CreateDatabaseSnapshotHandler) *CreateDatabaseSnapshot { - return &CreateDatabaseSnapshot{Context: ctx, Handler: handler} -} - -/* CreateDatabaseSnapshot swagger:route POST /database/snapshot Database createDatabaseSnapshot - -Create a new database snapshot - -Create a new database snapshot. Requires admin access. - -*/ -type CreateDatabaseSnapshot struct { - Context *middleware.Context - Handler CreateDatabaseSnapshotHandler -} - -func (o *CreateDatabaseSnapshot) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateDatabaseSnapshotParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/database/create_database_snapshot_parameters.go b/rest_management_api_server/operations/database/create_database_snapshot_parameters.go deleted file mode 100644 index 7d225fac2..000000000 --- a/rest_management_api_server/operations/database/create_database_snapshot_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewCreateDatabaseSnapshotParams creates a new CreateDatabaseSnapshotParams object -// -// There are no default values defined in the spec. -func NewCreateDatabaseSnapshotParams() CreateDatabaseSnapshotParams { - - return CreateDatabaseSnapshotParams{} -} - -// CreateDatabaseSnapshotParams contains all the bound params for the create database snapshot operation -// typically these are obtained from a http.Request -// -// swagger:parameters createDatabaseSnapshot -type CreateDatabaseSnapshotParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateDatabaseSnapshotParams() beforehand. -func (o *CreateDatabaseSnapshotParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/database/create_database_snapshot_responses.go b/rest_management_api_server/operations/database/create_database_snapshot_responses.go deleted file mode 100644 index 10e0d9215..000000000 --- a/rest_management_api_server/operations/database/create_database_snapshot_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateDatabaseSnapshotOKCode is the HTTP code returned for type CreateDatabaseSnapshotOK -const CreateDatabaseSnapshotOKCode int = 200 - -/*CreateDatabaseSnapshotOK Base empty response - -swagger:response createDatabaseSnapshotOK -*/ -type CreateDatabaseSnapshotOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewCreateDatabaseSnapshotOK creates CreateDatabaseSnapshotOK with default headers values -func NewCreateDatabaseSnapshotOK() *CreateDatabaseSnapshotOK { - - return &CreateDatabaseSnapshotOK{} -} - -// WithPayload adds the payload to the create database snapshot o k response -func (o *CreateDatabaseSnapshotOK) WithPayload(payload *rest_model.Empty) *CreateDatabaseSnapshotOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create database snapshot o k response -func (o *CreateDatabaseSnapshotOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateDatabaseSnapshotOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateDatabaseSnapshotUnauthorizedCode is the HTTP code returned for type CreateDatabaseSnapshotUnauthorized -const CreateDatabaseSnapshotUnauthorizedCode int = 401 - -/*CreateDatabaseSnapshotUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createDatabaseSnapshotUnauthorized -*/ -type CreateDatabaseSnapshotUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateDatabaseSnapshotUnauthorized creates CreateDatabaseSnapshotUnauthorized with default headers values -func NewCreateDatabaseSnapshotUnauthorized() *CreateDatabaseSnapshotUnauthorized { - - return &CreateDatabaseSnapshotUnauthorized{} -} - -// WithPayload adds the payload to the create database snapshot unauthorized response -func (o *CreateDatabaseSnapshotUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateDatabaseSnapshotUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create database snapshot unauthorized response -func (o *CreateDatabaseSnapshotUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateDatabaseSnapshotUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateDatabaseSnapshotTooManyRequestsCode is the HTTP code returned for type CreateDatabaseSnapshotTooManyRequests -const CreateDatabaseSnapshotTooManyRequestsCode int = 429 - -/*CreateDatabaseSnapshotTooManyRequests The resource requested is rate limited and the rate limit has been exceeded - -swagger:response createDatabaseSnapshotTooManyRequests -*/ -type CreateDatabaseSnapshotTooManyRequests struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateDatabaseSnapshotTooManyRequests creates CreateDatabaseSnapshotTooManyRequests with default headers values -func NewCreateDatabaseSnapshotTooManyRequests() *CreateDatabaseSnapshotTooManyRequests { - - return &CreateDatabaseSnapshotTooManyRequests{} -} - -// WithPayload adds the payload to the create database snapshot too many requests response -func (o *CreateDatabaseSnapshotTooManyRequests) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateDatabaseSnapshotTooManyRequests { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create database snapshot too many requests response -func (o *CreateDatabaseSnapshotTooManyRequests) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateDatabaseSnapshotTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(429) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/database/create_database_snapshot_urlbuilder.go b/rest_management_api_server/operations/database/create_database_snapshot_urlbuilder.go deleted file mode 100644 index 0f20f9f35..000000000 --- a/rest_management_api_server/operations/database/create_database_snapshot_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateDatabaseSnapshotURL generates an URL for the create database snapshot operation -type CreateDatabaseSnapshotURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateDatabaseSnapshotURL) WithBasePath(bp string) *CreateDatabaseSnapshotURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateDatabaseSnapshotURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateDatabaseSnapshotURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/database/snapshot" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateDatabaseSnapshotURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateDatabaseSnapshotURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateDatabaseSnapshotURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateDatabaseSnapshotURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateDatabaseSnapshotURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateDatabaseSnapshotURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/database/data_integrity_results.go b/rest_management_api_server/operations/database/data_integrity_results.go deleted file mode 100644 index 648f178e8..000000000 --- a/rest_management_api_server/operations/database/data_integrity_results.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DataIntegrityResultsHandlerFunc turns a function with the right signature into a data integrity results handler -type DataIntegrityResultsHandlerFunc func(DataIntegrityResultsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DataIntegrityResultsHandlerFunc) Handle(params DataIntegrityResultsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DataIntegrityResultsHandler interface for that can handle valid data integrity results params -type DataIntegrityResultsHandler interface { - Handle(DataIntegrityResultsParams, interface{}) middleware.Responder -} - -// NewDataIntegrityResults creates a new http.Handler for the data integrity results operation -func NewDataIntegrityResults(ctx *middleware.Context, handler DataIntegrityResultsHandler) *DataIntegrityResults { - return &DataIntegrityResults{Context: ctx, Handler: handler} -} - -/* DataIntegrityResults swagger:route GET /database/data-integrity-results Database dataIntegrityResults - -Returns any results found from in-progress integrity checks - -Returns any results found from in-progress integrity checks. Requires admin access. - -*/ -type DataIntegrityResults struct { - Context *middleware.Context - Handler DataIntegrityResultsHandler -} - -func (o *DataIntegrityResults) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDataIntegrityResultsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/database/data_integrity_results_parameters.go b/rest_management_api_server/operations/database/data_integrity_results_parameters.go deleted file mode 100644 index 9e50495ba..000000000 --- a/rest_management_api_server/operations/database/data_integrity_results_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewDataIntegrityResultsParams creates a new DataIntegrityResultsParams object -// -// There are no default values defined in the spec. -func NewDataIntegrityResultsParams() DataIntegrityResultsParams { - - return DataIntegrityResultsParams{} -} - -// DataIntegrityResultsParams contains all the bound params for the data integrity results operation -// typically these are obtained from a http.Request -// -// swagger:parameters dataIntegrityResults -type DataIntegrityResultsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDataIntegrityResultsParams() beforehand. -func (o *DataIntegrityResultsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/database/data_integrity_results_responses.go b/rest_management_api_server/operations/database/data_integrity_results_responses.go deleted file mode 100644 index 541ebd68f..000000000 --- a/rest_management_api_server/operations/database/data_integrity_results_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DataIntegrityResultsOKCode is the HTTP code returned for type DataIntegrityResultsOK -const DataIntegrityResultsOKCode int = 200 - -/*DataIntegrityResultsOK A list of data integrity issues found - -swagger:response dataIntegrityResultsOK -*/ -type DataIntegrityResultsOK struct { - - /* - In: Body - */ - Payload *rest_model.DataIntegrityCheckResultEnvelope `json:"body,omitempty"` -} - -// NewDataIntegrityResultsOK creates DataIntegrityResultsOK with default headers values -func NewDataIntegrityResultsOK() *DataIntegrityResultsOK { - - return &DataIntegrityResultsOK{} -} - -// WithPayload adds the payload to the data integrity results o k response -func (o *DataIntegrityResultsOK) WithPayload(payload *rest_model.DataIntegrityCheckResultEnvelope) *DataIntegrityResultsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the data integrity results o k response -func (o *DataIntegrityResultsOK) SetPayload(payload *rest_model.DataIntegrityCheckResultEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DataIntegrityResultsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DataIntegrityResultsUnauthorizedCode is the HTTP code returned for type DataIntegrityResultsUnauthorized -const DataIntegrityResultsUnauthorizedCode int = 401 - -/*DataIntegrityResultsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response dataIntegrityResultsUnauthorized -*/ -type DataIntegrityResultsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDataIntegrityResultsUnauthorized creates DataIntegrityResultsUnauthorized with default headers values -func NewDataIntegrityResultsUnauthorized() *DataIntegrityResultsUnauthorized { - - return &DataIntegrityResultsUnauthorized{} -} - -// WithPayload adds the payload to the data integrity results unauthorized response -func (o *DataIntegrityResultsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DataIntegrityResultsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the data integrity results unauthorized response -func (o *DataIntegrityResultsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DataIntegrityResultsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/database/data_integrity_results_urlbuilder.go b/rest_management_api_server/operations/database/data_integrity_results_urlbuilder.go deleted file mode 100644 index 60be3c89c..000000000 --- a/rest_management_api_server/operations/database/data_integrity_results_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// DataIntegrityResultsURL generates an URL for the data integrity results operation -type DataIntegrityResultsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DataIntegrityResultsURL) WithBasePath(bp string) *DataIntegrityResultsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DataIntegrityResultsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DataIntegrityResultsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/database/data-integrity-results" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DataIntegrityResultsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DataIntegrityResultsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DataIntegrityResultsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DataIntegrityResultsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DataIntegrityResultsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DataIntegrityResultsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/database/fix_data_integrity.go b/rest_management_api_server/operations/database/fix_data_integrity.go deleted file mode 100644 index 9a9d91127..000000000 --- a/rest_management_api_server/operations/database/fix_data_integrity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// FixDataIntegrityHandlerFunc turns a function with the right signature into a fix data integrity handler -type FixDataIntegrityHandlerFunc func(FixDataIntegrityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn FixDataIntegrityHandlerFunc) Handle(params FixDataIntegrityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// FixDataIntegrityHandler interface for that can handle valid fix data integrity params -type FixDataIntegrityHandler interface { - Handle(FixDataIntegrityParams, interface{}) middleware.Responder -} - -// NewFixDataIntegrity creates a new http.Handler for the fix data integrity operation -func NewFixDataIntegrity(ctx *middleware.Context, handler FixDataIntegrityHandler) *FixDataIntegrity { - return &FixDataIntegrity{Context: ctx, Handler: handler} -} - -/* FixDataIntegrity swagger:route POST /database/fix-data-integrity Database fixDataIntegrity - -Runs a data integrity scan on the datastore, attempts to fix any issues it can and returns any found issues - -Runs a data integrity scan on the datastore, attempts to fix any issues it can, and returns any found issues. Requires admin access. Only once instance may run at a time, including runs of checkDataIntegrity. - -*/ -type FixDataIntegrity struct { - Context *middleware.Context - Handler FixDataIntegrityHandler -} - -func (o *FixDataIntegrity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewFixDataIntegrityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/database/fix_data_integrity_parameters.go b/rest_management_api_server/operations/database/fix_data_integrity_parameters.go deleted file mode 100644 index de460e405..000000000 --- a/rest_management_api_server/operations/database/fix_data_integrity_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewFixDataIntegrityParams creates a new FixDataIntegrityParams object -// -// There are no default values defined in the spec. -func NewFixDataIntegrityParams() FixDataIntegrityParams { - - return FixDataIntegrityParams{} -} - -// FixDataIntegrityParams contains all the bound params for the fix data integrity operation -// typically these are obtained from a http.Request -// -// swagger:parameters fixDataIntegrity -type FixDataIntegrityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewFixDataIntegrityParams() beforehand. -func (o *FixDataIntegrityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/database/fix_data_integrity_responses.go b/rest_management_api_server/operations/database/fix_data_integrity_responses.go deleted file mode 100644 index 6045607f6..000000000 --- a/rest_management_api_server/operations/database/fix_data_integrity_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// FixDataIntegrityAcceptedCode is the HTTP code returned for type FixDataIntegrityAccepted -const FixDataIntegrityAcceptedCode int = 202 - -/*FixDataIntegrityAccepted Base empty response - -swagger:response fixDataIntegrityAccepted -*/ -type FixDataIntegrityAccepted struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewFixDataIntegrityAccepted creates FixDataIntegrityAccepted with default headers values -func NewFixDataIntegrityAccepted() *FixDataIntegrityAccepted { - - return &FixDataIntegrityAccepted{} -} - -// WithPayload adds the payload to the fix data integrity accepted response -func (o *FixDataIntegrityAccepted) WithPayload(payload *rest_model.Empty) *FixDataIntegrityAccepted { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fix data integrity accepted response -func (o *FixDataIntegrityAccepted) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FixDataIntegrityAccepted) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(202) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FixDataIntegrityUnauthorizedCode is the HTTP code returned for type FixDataIntegrityUnauthorized -const FixDataIntegrityUnauthorizedCode int = 401 - -/*FixDataIntegrityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response fixDataIntegrityUnauthorized -*/ -type FixDataIntegrityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewFixDataIntegrityUnauthorized creates FixDataIntegrityUnauthorized with default headers values -func NewFixDataIntegrityUnauthorized() *FixDataIntegrityUnauthorized { - - return &FixDataIntegrityUnauthorized{} -} - -// WithPayload adds the payload to the fix data integrity unauthorized response -func (o *FixDataIntegrityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *FixDataIntegrityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fix data integrity unauthorized response -func (o *FixDataIntegrityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FixDataIntegrityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FixDataIntegrityTooManyRequestsCode is the HTTP code returned for type FixDataIntegrityTooManyRequests -const FixDataIntegrityTooManyRequestsCode int = 429 - -/*FixDataIntegrityTooManyRequests The resource requested is rate limited and the rate limit has been exceeded - -swagger:response fixDataIntegrityTooManyRequests -*/ -type FixDataIntegrityTooManyRequests struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewFixDataIntegrityTooManyRequests creates FixDataIntegrityTooManyRequests with default headers values -func NewFixDataIntegrityTooManyRequests() *FixDataIntegrityTooManyRequests { - - return &FixDataIntegrityTooManyRequests{} -} - -// WithPayload adds the payload to the fix data integrity too many requests response -func (o *FixDataIntegrityTooManyRequests) WithPayload(payload *rest_model.APIErrorEnvelope) *FixDataIntegrityTooManyRequests { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fix data integrity too many requests response -func (o *FixDataIntegrityTooManyRequests) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FixDataIntegrityTooManyRequests) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(429) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/database/fix_data_integrity_urlbuilder.go b/rest_management_api_server/operations/database/fix_data_integrity_urlbuilder.go deleted file mode 100644 index d9e22a1bf..000000000 --- a/rest_management_api_server/operations/database/fix_data_integrity_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package database - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// FixDataIntegrityURL generates an URL for the fix data integrity operation -type FixDataIntegrityURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *FixDataIntegrityURL) WithBasePath(bp string) *FixDataIntegrityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *FixDataIntegrityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *FixDataIntegrityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/database/fix-data-integrity" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *FixDataIntegrityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *FixDataIntegrityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *FixDataIntegrityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on FixDataIntegrityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on FixDataIntegrityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *FixDataIntegrityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/create_edge_router.go b/rest_management_api_server/operations/edge_router/create_edge_router.go deleted file mode 100644 index c4f2f7d01..000000000 --- a/rest_management_api_server/operations/edge_router/create_edge_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateEdgeRouterHandlerFunc turns a function with the right signature into a create edge router handler -type CreateEdgeRouterHandlerFunc func(CreateEdgeRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateEdgeRouterHandlerFunc) Handle(params CreateEdgeRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateEdgeRouterHandler interface for that can handle valid create edge router params -type CreateEdgeRouterHandler interface { - Handle(CreateEdgeRouterParams, interface{}) middleware.Responder -} - -// NewCreateEdgeRouter creates a new http.Handler for the create edge router operation -func NewCreateEdgeRouter(ctx *middleware.Context, handler CreateEdgeRouterHandler) *CreateEdgeRouter { - return &CreateEdgeRouter{Context: ctx, Handler: handler} -} - -/* CreateEdgeRouter swagger:route POST /edge-routers Edge Router createEdgeRouter - -Create an edge router - -Create a edge router resource. Requires admin access. - -*/ -type CreateEdgeRouter struct { - Context *middleware.Context - Handler CreateEdgeRouterHandler -} - -func (o *CreateEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateEdgeRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/create_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/create_edge_router_parameters.go deleted file mode 100644 index 72bc9a854..000000000 --- a/rest_management_api_server/operations/edge_router/create_edge_router_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateEdgeRouterParams creates a new CreateEdgeRouterParams object -// -// There are no default values defined in the spec. -func NewCreateEdgeRouterParams() CreateEdgeRouterParams { - - return CreateEdgeRouterParams{} -} - -// CreateEdgeRouterParams contains all the bound params for the create edge router operation -// typically these are obtained from a http.Request -// -// swagger:parameters createEdgeRouter -type CreateEdgeRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A edge router to create - Required: true - In: body - */ - EdgeRouter *rest_model.EdgeRouterCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateEdgeRouterParams() beforehand. -func (o *CreateEdgeRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EdgeRouterCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("edgeRouter", "body", "")) - } else { - res = append(res, errors.NewParseError("edgeRouter", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.EdgeRouter = &body - } - } - } else { - res = append(res, errors.Required("edgeRouter", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/edge_router/create_edge_router_responses.go b/rest_management_api_server/operations/edge_router/create_edge_router_responses.go deleted file mode 100644 index 8f01ba0a7..000000000 --- a/rest_management_api_server/operations/edge_router/create_edge_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateEdgeRouterCreatedCode is the HTTP code returned for type CreateEdgeRouterCreated -const CreateEdgeRouterCreatedCode int = 201 - -/*CreateEdgeRouterCreated The create request was successful and the resource has been added at the following location - -swagger:response createEdgeRouterCreated -*/ -type CreateEdgeRouterCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateEdgeRouterCreated creates CreateEdgeRouterCreated with default headers values -func NewCreateEdgeRouterCreated() *CreateEdgeRouterCreated { - - return &CreateEdgeRouterCreated{} -} - -// WithPayload adds the payload to the create edge router created response -func (o *CreateEdgeRouterCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateEdgeRouterCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create edge router created response -func (o *CreateEdgeRouterCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEdgeRouterCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEdgeRouterBadRequestCode is the HTTP code returned for type CreateEdgeRouterBadRequest -const CreateEdgeRouterBadRequestCode int = 400 - -/*CreateEdgeRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createEdgeRouterBadRequest -*/ -type CreateEdgeRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEdgeRouterBadRequest creates CreateEdgeRouterBadRequest with default headers values -func NewCreateEdgeRouterBadRequest() *CreateEdgeRouterBadRequest { - - return &CreateEdgeRouterBadRequest{} -} - -// WithPayload adds the payload to the create edge router bad request response -func (o *CreateEdgeRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEdgeRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create edge router bad request response -func (o *CreateEdgeRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEdgeRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEdgeRouterUnauthorizedCode is the HTTP code returned for type CreateEdgeRouterUnauthorized -const CreateEdgeRouterUnauthorizedCode int = 401 - -/*CreateEdgeRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createEdgeRouterUnauthorized -*/ -type CreateEdgeRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEdgeRouterUnauthorized creates CreateEdgeRouterUnauthorized with default headers values -func NewCreateEdgeRouterUnauthorized() *CreateEdgeRouterUnauthorized { - - return &CreateEdgeRouterUnauthorized{} -} - -// WithPayload adds the payload to the create edge router unauthorized response -func (o *CreateEdgeRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEdgeRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create edge router unauthorized response -func (o *CreateEdgeRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEdgeRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/create_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/create_edge_router_urlbuilder.go deleted file mode 100644 index 74a9f89e2..000000000 --- a/rest_management_api_server/operations/edge_router/create_edge_router_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateEdgeRouterURL generates an URL for the create edge router operation -type CreateEdgeRouterURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEdgeRouterURL) WithBasePath(bp string) *CreateEdgeRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEdgeRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateEdgeRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateEdgeRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateEdgeRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateEdgeRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateEdgeRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateEdgeRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateEdgeRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/delete_edge_router.go b/rest_management_api_server/operations/edge_router/delete_edge_router.go deleted file mode 100644 index 08eb82f71..000000000 --- a/rest_management_api_server/operations/edge_router/delete_edge_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteEdgeRouterHandlerFunc turns a function with the right signature into a delete edge router handler -type DeleteEdgeRouterHandlerFunc func(DeleteEdgeRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteEdgeRouterHandlerFunc) Handle(params DeleteEdgeRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteEdgeRouterHandler interface for that can handle valid delete edge router params -type DeleteEdgeRouterHandler interface { - Handle(DeleteEdgeRouterParams, interface{}) middleware.Responder -} - -// NewDeleteEdgeRouter creates a new http.Handler for the delete edge router operation -func NewDeleteEdgeRouter(ctx *middleware.Context, handler DeleteEdgeRouterHandler) *DeleteEdgeRouter { - return &DeleteEdgeRouter{Context: ctx, Handler: handler} -} - -/* DeleteEdgeRouter swagger:route DELETE /edge-routers/{id} Edge Router deleteEdgeRouter - -Delete an edge router - -Delete an edge router by id. Requires admin access. - -*/ -type DeleteEdgeRouter struct { - Context *middleware.Context - Handler DeleteEdgeRouterHandler -} - -func (o *DeleteEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteEdgeRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/delete_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/delete_edge_router_parameters.go deleted file mode 100644 index 21c853158..000000000 --- a/rest_management_api_server/operations/edge_router/delete_edge_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEdgeRouterParams creates a new DeleteEdgeRouterParams object -// -// There are no default values defined in the spec. -func NewDeleteEdgeRouterParams() DeleteEdgeRouterParams { - - return DeleteEdgeRouterParams{} -} - -// DeleteEdgeRouterParams contains all the bound params for the delete edge router operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteEdgeRouter -type DeleteEdgeRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteEdgeRouterParams() beforehand. -func (o *DeleteEdgeRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteEdgeRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/delete_edge_router_responses.go b/rest_management_api_server/operations/edge_router/delete_edge_router_responses.go deleted file mode 100644 index 3d2f126fb..000000000 --- a/rest_management_api_server/operations/edge_router/delete_edge_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteEdgeRouterOKCode is the HTTP code returned for type DeleteEdgeRouterOK -const DeleteEdgeRouterOKCode int = 200 - -/*DeleteEdgeRouterOK The delete request was successful and the resource has been removed - -swagger:response deleteEdgeRouterOK -*/ -type DeleteEdgeRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterOK creates DeleteEdgeRouterOK with default headers values -func NewDeleteEdgeRouterOK() *DeleteEdgeRouterOK { - - return &DeleteEdgeRouterOK{} -} - -// WithPayload adds the payload to the delete edge router o k response -func (o *DeleteEdgeRouterOK) WithPayload(payload *rest_model.Empty) *DeleteEdgeRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router o k response -func (o *DeleteEdgeRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEdgeRouterBadRequestCode is the HTTP code returned for type DeleteEdgeRouterBadRequest -const DeleteEdgeRouterBadRequestCode int = 400 - -/*DeleteEdgeRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteEdgeRouterBadRequest -*/ -type DeleteEdgeRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterBadRequest creates DeleteEdgeRouterBadRequest with default headers values -func NewDeleteEdgeRouterBadRequest() *DeleteEdgeRouterBadRequest { - - return &DeleteEdgeRouterBadRequest{} -} - -// WithPayload adds the payload to the delete edge router bad request response -func (o *DeleteEdgeRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEdgeRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router bad request response -func (o *DeleteEdgeRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEdgeRouterUnauthorizedCode is the HTTP code returned for type DeleteEdgeRouterUnauthorized -const DeleteEdgeRouterUnauthorizedCode int = 401 - -/*DeleteEdgeRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteEdgeRouterUnauthorized -*/ -type DeleteEdgeRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterUnauthorized creates DeleteEdgeRouterUnauthorized with default headers values -func NewDeleteEdgeRouterUnauthorized() *DeleteEdgeRouterUnauthorized { - - return &DeleteEdgeRouterUnauthorized{} -} - -// WithPayload adds the payload to the delete edge router unauthorized response -func (o *DeleteEdgeRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEdgeRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router unauthorized response -func (o *DeleteEdgeRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEdgeRouterConflictCode is the HTTP code returned for type DeleteEdgeRouterConflict -const DeleteEdgeRouterConflictCode int = 409 - -/*DeleteEdgeRouterConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteEdgeRouterConflict -*/ -type DeleteEdgeRouterConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterConflict creates DeleteEdgeRouterConflict with default headers values -func NewDeleteEdgeRouterConflict() *DeleteEdgeRouterConflict { - - return &DeleteEdgeRouterConflict{} -} - -// WithPayload adds the payload to the delete edge router conflict response -func (o *DeleteEdgeRouterConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEdgeRouterConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router conflict response -func (o *DeleteEdgeRouterConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/delete_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/delete_edge_router_urlbuilder.go deleted file mode 100644 index 02711ee3c..000000000 --- a/rest_management_api_server/operations/edge_router/delete_edge_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteEdgeRouterURL generates an URL for the delete edge router operation -type DeleteEdgeRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEdgeRouterURL) WithBasePath(bp string) *DeleteEdgeRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEdgeRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteEdgeRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteEdgeRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteEdgeRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteEdgeRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteEdgeRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteEdgeRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteEdgeRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteEdgeRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/detail_edge_router.go b/rest_management_api_server/operations/edge_router/detail_edge_router.go deleted file mode 100644 index bfb4e33f2..000000000 --- a/rest_management_api_server/operations/edge_router/detail_edge_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailEdgeRouterHandlerFunc turns a function with the right signature into a detail edge router handler -type DetailEdgeRouterHandlerFunc func(DetailEdgeRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailEdgeRouterHandlerFunc) Handle(params DetailEdgeRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailEdgeRouterHandler interface for that can handle valid detail edge router params -type DetailEdgeRouterHandler interface { - Handle(DetailEdgeRouterParams, interface{}) middleware.Responder -} - -// NewDetailEdgeRouter creates a new http.Handler for the detail edge router operation -func NewDetailEdgeRouter(ctx *middleware.Context, handler DetailEdgeRouterHandler) *DetailEdgeRouter { - return &DetailEdgeRouter{Context: ctx, Handler: handler} -} - -/* DetailEdgeRouter swagger:route GET /edge-routers/{id} Edge Router detailEdgeRouter - -Retrieves a single edge router - -Retrieves a single edge router by id. Requires admin access. - -*/ -type DetailEdgeRouter struct { - Context *middleware.Context - Handler DetailEdgeRouterHandler -} - -func (o *DetailEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailEdgeRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/detail_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/detail_edge_router_parameters.go deleted file mode 100644 index 96d363f00..000000000 --- a/rest_management_api_server/operations/edge_router/detail_edge_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailEdgeRouterParams creates a new DetailEdgeRouterParams object -// -// There are no default values defined in the spec. -func NewDetailEdgeRouterParams() DetailEdgeRouterParams { - - return DetailEdgeRouterParams{} -} - -// DetailEdgeRouterParams contains all the bound params for the detail edge router operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailEdgeRouter -type DetailEdgeRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailEdgeRouterParams() beforehand. -func (o *DetailEdgeRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailEdgeRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/detail_edge_router_responses.go b/rest_management_api_server/operations/edge_router/detail_edge_router_responses.go deleted file mode 100644 index 06a27cb0c..000000000 --- a/rest_management_api_server/operations/edge_router/detail_edge_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailEdgeRouterOKCode is the HTTP code returned for type DetailEdgeRouterOK -const DetailEdgeRouterOKCode int = 200 - -/*DetailEdgeRouterOK A singular edge router resource - -swagger:response detailEdgeRouterOK -*/ -type DetailEdgeRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailedEdgeRouterEnvelope `json:"body,omitempty"` -} - -// NewDetailEdgeRouterOK creates DetailEdgeRouterOK with default headers values -func NewDetailEdgeRouterOK() *DetailEdgeRouterOK { - - return &DetailEdgeRouterOK{} -} - -// WithPayload adds the payload to the detail edge router o k response -func (o *DetailEdgeRouterOK) WithPayload(payload *rest_model.DetailedEdgeRouterEnvelope) *DetailEdgeRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail edge router o k response -func (o *DetailEdgeRouterOK) SetPayload(payload *rest_model.DetailedEdgeRouterEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEdgeRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailEdgeRouterUnauthorizedCode is the HTTP code returned for type DetailEdgeRouterUnauthorized -const DetailEdgeRouterUnauthorizedCode int = 401 - -/*DetailEdgeRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailEdgeRouterUnauthorized -*/ -type DetailEdgeRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailEdgeRouterUnauthorized creates DetailEdgeRouterUnauthorized with default headers values -func NewDetailEdgeRouterUnauthorized() *DetailEdgeRouterUnauthorized { - - return &DetailEdgeRouterUnauthorized{} -} - -// WithPayload adds the payload to the detail edge router unauthorized response -func (o *DetailEdgeRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailEdgeRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail edge router unauthorized response -func (o *DetailEdgeRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEdgeRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailEdgeRouterNotFoundCode is the HTTP code returned for type DetailEdgeRouterNotFound -const DetailEdgeRouterNotFoundCode int = 404 - -/*DetailEdgeRouterNotFound The requested resource does not exist - -swagger:response detailEdgeRouterNotFound -*/ -type DetailEdgeRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailEdgeRouterNotFound creates DetailEdgeRouterNotFound with default headers values -func NewDetailEdgeRouterNotFound() *DetailEdgeRouterNotFound { - - return &DetailEdgeRouterNotFound{} -} - -// WithPayload adds the payload to the detail edge router not found response -func (o *DetailEdgeRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailEdgeRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail edge router not found response -func (o *DetailEdgeRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEdgeRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/detail_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/detail_edge_router_urlbuilder.go deleted file mode 100644 index 27e72de78..000000000 --- a/rest_management_api_server/operations/edge_router/detail_edge_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailEdgeRouterURL generates an URL for the detail edge router operation -type DetailEdgeRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailEdgeRouterURL) WithBasePath(bp string) *DetailEdgeRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailEdgeRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailEdgeRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailEdgeRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailEdgeRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailEdgeRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailEdgeRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailEdgeRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailEdgeRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailEdgeRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies.go b/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies.go deleted file mode 100644 index 995ce23e0..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterEdgeRouterPoliciesHandlerFunc turns a function with the right signature into a list edge router edge router policies handler -type ListEdgeRouterEdgeRouterPoliciesHandlerFunc func(ListEdgeRouterEdgeRouterPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterEdgeRouterPoliciesHandlerFunc) Handle(params ListEdgeRouterEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterEdgeRouterPoliciesHandler interface for that can handle valid list edge router edge router policies params -type ListEdgeRouterEdgeRouterPoliciesHandler interface { - Handle(ListEdgeRouterEdgeRouterPoliciesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterEdgeRouterPolicies creates a new http.Handler for the list edge router edge router policies operation -func NewListEdgeRouterEdgeRouterPolicies(ctx *middleware.Context, handler ListEdgeRouterEdgeRouterPoliciesHandler) *ListEdgeRouterEdgeRouterPolicies { - return &ListEdgeRouterEdgeRouterPolicies{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterEdgeRouterPolicies swagger:route GET /edge-routers/{id}/edge-router-policies Edge Router listEdgeRouterEdgeRouterPolicies - -List the edge router policies that affect an edge router - -Retrieves a list of edge router policies that apply to the specified edge router. - -*/ -type ListEdgeRouterEdgeRouterPolicies struct { - Context *middleware.Context - Handler ListEdgeRouterEdgeRouterPoliciesHandler -} - -func (o *ListEdgeRouterEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterEdgeRouterPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_parameters.go deleted file mode 100644 index b935b92ec..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterEdgeRouterPoliciesParams creates a new ListEdgeRouterEdgeRouterPoliciesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterEdgeRouterPoliciesParams() ListEdgeRouterEdgeRouterPoliciesParams { - - return ListEdgeRouterEdgeRouterPoliciesParams{} -} - -// ListEdgeRouterEdgeRouterPoliciesParams contains all the bound params for the list edge router edge router policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterEdgeRouterPolicies -type ListEdgeRouterEdgeRouterPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterEdgeRouterPoliciesParams() beforehand. -func (o *ListEdgeRouterEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListEdgeRouterEdgeRouterPoliciesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_responses.go b/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_responses.go deleted file mode 100644 index 56a0f9f17..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterEdgeRouterPoliciesOKCode is the HTTP code returned for type ListEdgeRouterEdgeRouterPoliciesOK -const ListEdgeRouterEdgeRouterPoliciesOKCode int = 200 - -/*ListEdgeRouterEdgeRouterPoliciesOK A list of edge router policies - -swagger:response listEdgeRouterEdgeRouterPoliciesOK -*/ -type ListEdgeRouterEdgeRouterPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRouterPoliciesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterEdgeRouterPoliciesOK creates ListEdgeRouterEdgeRouterPoliciesOK with default headers values -func NewListEdgeRouterEdgeRouterPoliciesOK() *ListEdgeRouterEdgeRouterPoliciesOK { - - return &ListEdgeRouterEdgeRouterPoliciesOK{} -} - -// WithPayload adds the payload to the list edge router edge router policies o k response -func (o *ListEdgeRouterEdgeRouterPoliciesOK) WithPayload(payload *rest_model.ListEdgeRouterPoliciesEnvelope) *ListEdgeRouterEdgeRouterPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router edge router policies o k response -func (o *ListEdgeRouterEdgeRouterPoliciesOK) SetPayload(payload *rest_model.ListEdgeRouterPoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterEdgeRouterPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterEdgeRouterPoliciesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterEdgeRouterPoliciesUnauthorized -const ListEdgeRouterEdgeRouterPoliciesUnauthorizedCode int = 401 - -/*ListEdgeRouterEdgeRouterPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterEdgeRouterPoliciesUnauthorized -*/ -type ListEdgeRouterEdgeRouterPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterEdgeRouterPoliciesUnauthorized creates ListEdgeRouterEdgeRouterPoliciesUnauthorized with default headers values -func NewListEdgeRouterEdgeRouterPoliciesUnauthorized() *ListEdgeRouterEdgeRouterPoliciesUnauthorized { - - return &ListEdgeRouterEdgeRouterPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router edge router policies unauthorized response -func (o *ListEdgeRouterEdgeRouterPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterEdgeRouterPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router edge router policies unauthorized response -func (o *ListEdgeRouterEdgeRouterPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterEdgeRouterPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterEdgeRouterPoliciesNotFoundCode is the HTTP code returned for type ListEdgeRouterEdgeRouterPoliciesNotFound -const ListEdgeRouterEdgeRouterPoliciesNotFoundCode int = 404 - -/*ListEdgeRouterEdgeRouterPoliciesNotFound The requested resource does not exist - -swagger:response listEdgeRouterEdgeRouterPoliciesNotFound -*/ -type ListEdgeRouterEdgeRouterPoliciesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterEdgeRouterPoliciesNotFound creates ListEdgeRouterEdgeRouterPoliciesNotFound with default headers values -func NewListEdgeRouterEdgeRouterPoliciesNotFound() *ListEdgeRouterEdgeRouterPoliciesNotFound { - - return &ListEdgeRouterEdgeRouterPoliciesNotFound{} -} - -// WithPayload adds the payload to the list edge router edge router policies not found response -func (o *ListEdgeRouterEdgeRouterPoliciesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterEdgeRouterPoliciesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router edge router policies not found response -func (o *ListEdgeRouterEdgeRouterPoliciesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterEdgeRouterPoliciesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_urlbuilder.go deleted file mode 100644 index b40cf0a24..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_edge_router_policies_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListEdgeRouterEdgeRouterPoliciesURL generates an URL for the list edge router edge router policies operation -type ListEdgeRouterEdgeRouterPoliciesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterEdgeRouterPoliciesURL) WithBasePath(bp string) *ListEdgeRouterEdgeRouterPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterEdgeRouterPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterEdgeRouterPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}/edge-router-policies" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListEdgeRouterEdgeRouterPoliciesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterEdgeRouterPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterEdgeRouterPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterEdgeRouterPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterEdgeRouterPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterEdgeRouterPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterEdgeRouterPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_identities.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities.go deleted file mode 100644 index e12418cc0..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_identities.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterIdentitiesHandlerFunc turns a function with the right signature into a list edge router identities handler -type ListEdgeRouterIdentitiesHandlerFunc func(ListEdgeRouterIdentitiesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterIdentitiesHandlerFunc) Handle(params ListEdgeRouterIdentitiesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterIdentitiesHandler interface for that can handle valid list edge router identities params -type ListEdgeRouterIdentitiesHandler interface { - Handle(ListEdgeRouterIdentitiesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterIdentities creates a new http.Handler for the list edge router identities operation -func NewListEdgeRouterIdentities(ctx *middleware.Context, handler ListEdgeRouterIdentitiesHandler) *ListEdgeRouterIdentities { - return &ListEdgeRouterIdentities{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterIdentities swagger:route GET /edge-routers/{id}/identities Edge Router listEdgeRouterIdentities - -List associated identities - -Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouterIdentities struct { - Context *middleware.Context - Handler ListEdgeRouterIdentitiesHandler -} - -func (o *ListEdgeRouterIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterIdentitiesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_identities_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities_parameters.go deleted file mode 100644 index b76b62110..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_identities_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterIdentitiesParams creates a new ListEdgeRouterIdentitiesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterIdentitiesParams() ListEdgeRouterIdentitiesParams { - - return ListEdgeRouterIdentitiesParams{} -} - -// ListEdgeRouterIdentitiesParams contains all the bound params for the list edge router identities operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterIdentities -type ListEdgeRouterIdentitiesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterIdentitiesParams() beforehand. -func (o *ListEdgeRouterIdentitiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListEdgeRouterIdentitiesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_identities_responses.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities_responses.go deleted file mode 100644 index ece1bc4f1..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_identities_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterIdentitiesOKCode is the HTTP code returned for type ListEdgeRouterIdentitiesOK -const ListEdgeRouterIdentitiesOKCode int = 200 - -/*ListEdgeRouterIdentitiesOK A list of identities - -swagger:response listEdgeRouterIdentitiesOK -*/ -type ListEdgeRouterIdentitiesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListIdentitiesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterIdentitiesOK creates ListEdgeRouterIdentitiesOK with default headers values -func NewListEdgeRouterIdentitiesOK() *ListEdgeRouterIdentitiesOK { - - return &ListEdgeRouterIdentitiesOK{} -} - -// WithPayload adds the payload to the list edge router identities o k response -func (o *ListEdgeRouterIdentitiesOK) WithPayload(payload *rest_model.ListIdentitiesEnvelope) *ListEdgeRouterIdentitiesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router identities o k response -func (o *ListEdgeRouterIdentitiesOK) SetPayload(payload *rest_model.ListIdentitiesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterIdentitiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterIdentitiesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterIdentitiesUnauthorized -const ListEdgeRouterIdentitiesUnauthorizedCode int = 401 - -/*ListEdgeRouterIdentitiesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterIdentitiesUnauthorized -*/ -type ListEdgeRouterIdentitiesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterIdentitiesUnauthorized creates ListEdgeRouterIdentitiesUnauthorized with default headers values -func NewListEdgeRouterIdentitiesUnauthorized() *ListEdgeRouterIdentitiesUnauthorized { - - return &ListEdgeRouterIdentitiesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router identities unauthorized response -func (o *ListEdgeRouterIdentitiesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterIdentitiesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router identities unauthorized response -func (o *ListEdgeRouterIdentitiesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterIdentitiesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterIdentitiesNotFoundCode is the HTTP code returned for type ListEdgeRouterIdentitiesNotFound -const ListEdgeRouterIdentitiesNotFoundCode int = 404 - -/*ListEdgeRouterIdentitiesNotFound The requested resource does not exist - -swagger:response listEdgeRouterIdentitiesNotFound -*/ -type ListEdgeRouterIdentitiesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterIdentitiesNotFound creates ListEdgeRouterIdentitiesNotFound with default headers values -func NewListEdgeRouterIdentitiesNotFound() *ListEdgeRouterIdentitiesNotFound { - - return &ListEdgeRouterIdentitiesNotFound{} -} - -// WithPayload adds the payload to the list edge router identities not found response -func (o *ListEdgeRouterIdentitiesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterIdentitiesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router identities not found response -func (o *ListEdgeRouterIdentitiesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterIdentitiesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_identities_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_router_identities_urlbuilder.go deleted file mode 100644 index 02f240e0b..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_identities_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListEdgeRouterIdentitiesURL generates an URL for the list edge router identities operation -type ListEdgeRouterIdentitiesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterIdentitiesURL) WithBasePath(bp string) *ListEdgeRouterIdentitiesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterIdentitiesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterIdentitiesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}/identities" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListEdgeRouterIdentitiesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterIdentitiesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterIdentitiesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterIdentitiesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterIdentitiesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterIdentitiesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterIdentitiesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies.go b/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies.go deleted file mode 100644 index 6520526ff..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc turns a function with the right signature into a list edge router service edge router policies handler -type ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc func(ListEdgeRouterServiceEdgeRouterPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc) Handle(params ListEdgeRouterServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterServiceEdgeRouterPoliciesHandler interface for that can handle valid list edge router service edge router policies params -type ListEdgeRouterServiceEdgeRouterPoliciesHandler interface { - Handle(ListEdgeRouterServiceEdgeRouterPoliciesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterServiceEdgeRouterPolicies creates a new http.Handler for the list edge router service edge router policies operation -func NewListEdgeRouterServiceEdgeRouterPolicies(ctx *middleware.Context, handler ListEdgeRouterServiceEdgeRouterPoliciesHandler) *ListEdgeRouterServiceEdgeRouterPolicies { - return &ListEdgeRouterServiceEdgeRouterPolicies{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterServiceEdgeRouterPolicies swagger:route GET /edge-routers/{id}/service-edge-router-policies Edge Router listEdgeRouterServiceEdgeRouterPolicies - -List the service policies that affect an edge router - -Retrieves a list of service policies policies that apply to the specified edge router. - -*/ -type ListEdgeRouterServiceEdgeRouterPolicies struct { - Context *middleware.Context - Handler ListEdgeRouterServiceEdgeRouterPoliciesHandler -} - -func (o *ListEdgeRouterServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterServiceEdgeRouterPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_parameters.go deleted file mode 100644 index c8f32861f..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterServiceEdgeRouterPoliciesParams creates a new ListEdgeRouterServiceEdgeRouterPoliciesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterServiceEdgeRouterPoliciesParams() ListEdgeRouterServiceEdgeRouterPoliciesParams { - - return ListEdgeRouterServiceEdgeRouterPoliciesParams{} -} - -// ListEdgeRouterServiceEdgeRouterPoliciesParams contains all the bound params for the list edge router service edge router policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterServiceEdgeRouterPolicies -type ListEdgeRouterServiceEdgeRouterPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterServiceEdgeRouterPoliciesParams() beforehand. -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListEdgeRouterServiceEdgeRouterPoliciesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_responses.go b/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_responses.go deleted file mode 100644 index 0c4a1ca91..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterServiceEdgeRouterPoliciesOKCode is the HTTP code returned for type ListEdgeRouterServiceEdgeRouterPoliciesOK -const ListEdgeRouterServiceEdgeRouterPoliciesOKCode int = 200 - -/*ListEdgeRouterServiceEdgeRouterPoliciesOK A list of service policies - -swagger:response listEdgeRouterServiceEdgeRouterPoliciesOK -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicePoliciesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesOK creates ListEdgeRouterServiceEdgeRouterPoliciesOK with default headers values -func NewListEdgeRouterServiceEdgeRouterPoliciesOK() *ListEdgeRouterServiceEdgeRouterPoliciesOK { - - return &ListEdgeRouterServiceEdgeRouterPoliciesOK{} -} - -// WithPayload adds the payload to the list edge router service edge router policies o k response -func (o *ListEdgeRouterServiceEdgeRouterPoliciesOK) WithPayload(payload *rest_model.ListServicePoliciesEnvelope) *ListEdgeRouterServiceEdgeRouterPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router service edge router policies o k response -func (o *ListEdgeRouterServiceEdgeRouterPoliciesOK) SetPayload(payload *rest_model.ListServicePoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterServiceEdgeRouterPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterServiceEdgeRouterPoliciesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized -const ListEdgeRouterServiceEdgeRouterPoliciesUnauthorizedCode int = 401 - -/*ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterServiceEdgeRouterPoliciesUnauthorized -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesUnauthorized creates ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized with default headers values -func NewListEdgeRouterServiceEdgeRouterPoliciesUnauthorized() *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized { - - return &ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router service edge router policies unauthorized response -func (o *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router service edge router policies unauthorized response -func (o *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterServiceEdgeRouterPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterServiceEdgeRouterPoliciesNotFoundCode is the HTTP code returned for type ListEdgeRouterServiceEdgeRouterPoliciesNotFound -const ListEdgeRouterServiceEdgeRouterPoliciesNotFoundCode int = 404 - -/*ListEdgeRouterServiceEdgeRouterPoliciesNotFound The requested resource does not exist - -swagger:response listEdgeRouterServiceEdgeRouterPoliciesNotFound -*/ -type ListEdgeRouterServiceEdgeRouterPoliciesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterServiceEdgeRouterPoliciesNotFound creates ListEdgeRouterServiceEdgeRouterPoliciesNotFound with default headers values -func NewListEdgeRouterServiceEdgeRouterPoliciesNotFound() *ListEdgeRouterServiceEdgeRouterPoliciesNotFound { - - return &ListEdgeRouterServiceEdgeRouterPoliciesNotFound{} -} - -// WithPayload adds the payload to the list edge router service edge router policies not found response -func (o *ListEdgeRouterServiceEdgeRouterPoliciesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterServiceEdgeRouterPoliciesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router service edge router policies not found response -func (o *ListEdgeRouterServiceEdgeRouterPoliciesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterServiceEdgeRouterPoliciesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_urlbuilder.go deleted file mode 100644 index 028d8958e..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_service_edge_router_policies_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListEdgeRouterServiceEdgeRouterPoliciesURL generates an URL for the list edge router service edge router policies operation -type ListEdgeRouterServiceEdgeRouterPoliciesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) WithBasePath(bp string) *ListEdgeRouterServiceEdgeRouterPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}/service-edge-router-policies" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListEdgeRouterServiceEdgeRouterPoliciesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterServiceEdgeRouterPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterServiceEdgeRouterPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterServiceEdgeRouterPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_services.go b/rest_management_api_server/operations/edge_router/list_edge_router_services.go deleted file mode 100644 index a266670c0..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_services.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterServicesHandlerFunc turns a function with the right signature into a list edge router services handler -type ListEdgeRouterServicesHandlerFunc func(ListEdgeRouterServicesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterServicesHandlerFunc) Handle(params ListEdgeRouterServicesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterServicesHandler interface for that can handle valid list edge router services params -type ListEdgeRouterServicesHandler interface { - Handle(ListEdgeRouterServicesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterServices creates a new http.Handler for the list edge router services operation -func NewListEdgeRouterServices(ctx *middleware.Context, handler ListEdgeRouterServicesHandler) *ListEdgeRouterServices { - return &ListEdgeRouterServices{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterServices swagger:route GET /edge-routers/{id}/services Edge Router listEdgeRouterServices - -List associated services - -Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouterServices struct { - Context *middleware.Context - Handler ListEdgeRouterServicesHandler -} - -func (o *ListEdgeRouterServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterServicesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_services_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_router_services_parameters.go deleted file mode 100644 index 70d8e9da5..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_services_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterServicesParams creates a new ListEdgeRouterServicesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterServicesParams() ListEdgeRouterServicesParams { - - return ListEdgeRouterServicesParams{} -} - -// ListEdgeRouterServicesParams contains all the bound params for the list edge router services operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterServices -type ListEdgeRouterServicesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterServicesParams() beforehand. -func (o *ListEdgeRouterServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListEdgeRouterServicesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_services_responses.go b/rest_management_api_server/operations/edge_router/list_edge_router_services_responses.go deleted file mode 100644 index 56d2a081d..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_services_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterServicesOKCode is the HTTP code returned for type ListEdgeRouterServicesOK -const ListEdgeRouterServicesOKCode int = 200 - -/*ListEdgeRouterServicesOK A list of services - -swagger:response listEdgeRouterServicesOK -*/ -type ListEdgeRouterServicesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterServicesOK creates ListEdgeRouterServicesOK with default headers values -func NewListEdgeRouterServicesOK() *ListEdgeRouterServicesOK { - - return &ListEdgeRouterServicesOK{} -} - -// WithPayload adds the payload to the list edge router services o k response -func (o *ListEdgeRouterServicesOK) WithPayload(payload *rest_model.ListServicesEnvelope) *ListEdgeRouterServicesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router services o k response -func (o *ListEdgeRouterServicesOK) SetPayload(payload *rest_model.ListServicesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterServicesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterServicesUnauthorized -const ListEdgeRouterServicesUnauthorizedCode int = 401 - -/*ListEdgeRouterServicesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterServicesUnauthorized -*/ -type ListEdgeRouterServicesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterServicesUnauthorized creates ListEdgeRouterServicesUnauthorized with default headers values -func NewListEdgeRouterServicesUnauthorized() *ListEdgeRouterServicesUnauthorized { - - return &ListEdgeRouterServicesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router services unauthorized response -func (o *ListEdgeRouterServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterServicesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router services unauthorized response -func (o *ListEdgeRouterServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterServicesNotFoundCode is the HTTP code returned for type ListEdgeRouterServicesNotFound -const ListEdgeRouterServicesNotFoundCode int = 404 - -/*ListEdgeRouterServicesNotFound The requested resource does not exist - -swagger:response listEdgeRouterServicesNotFound -*/ -type ListEdgeRouterServicesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterServicesNotFound creates ListEdgeRouterServicesNotFound with default headers values -func NewListEdgeRouterServicesNotFound() *ListEdgeRouterServicesNotFound { - - return &ListEdgeRouterServicesNotFound{} -} - -// WithPayload adds the payload to the list edge router services not found response -func (o *ListEdgeRouterServicesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterServicesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router services not found response -func (o *ListEdgeRouterServicesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterServicesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_router_services_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_router_services_urlbuilder.go deleted file mode 100644 index f30057e04..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_router_services_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListEdgeRouterServicesURL generates an URL for the list edge router services operation -type ListEdgeRouterServicesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterServicesURL) WithBasePath(bp string) *ListEdgeRouterServicesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterServicesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterServicesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}/services" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListEdgeRouterServicesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterServicesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterServicesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterServicesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterServicesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterServicesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterServicesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_routers.go b/rest_management_api_server/operations/edge_router/list_edge_routers.go deleted file mode 100644 index 221bab671..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_routers.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRoutersHandlerFunc turns a function with the right signature into a list edge routers handler -type ListEdgeRoutersHandlerFunc func(ListEdgeRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRoutersHandlerFunc) Handle(params ListEdgeRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRoutersHandler interface for that can handle valid list edge routers params -type ListEdgeRoutersHandler interface { - Handle(ListEdgeRoutersParams, interface{}) middleware.Responder -} - -// NewListEdgeRouters creates a new http.Handler for the list edge routers operation -func NewListEdgeRouters(ctx *middleware.Context, handler ListEdgeRoutersHandler) *ListEdgeRouters { - return &ListEdgeRouters{Context: ctx, Handler: handler} -} - -/* ListEdgeRouters swagger:route GET /edge-routers Edge Router listEdgeRouters - -List edge routers - -Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouters struct { - Context *middleware.Context - Handler ListEdgeRoutersHandler -} - -func (o *ListEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_routers_parameters.go b/rest_management_api_server/operations/edge_router/list_edge_routers_parameters.go deleted file mode 100644 index feb145e9b..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_routers_parameters.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEdgeRoutersParams creates a new ListEdgeRoutersParams object -// -// There are no default values defined in the spec. -func NewListEdgeRoutersParams() ListEdgeRoutersParams { - - return ListEdgeRoutersParams{} -} - -// ListEdgeRoutersParams contains all the bound params for the list edge routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouters -type ListEdgeRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /* - In: query - Collection Format: multi - */ - RoleFilter []string - /* - In: query - */ - RoleSemantic *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRoutersParams() beforehand. -func (o *ListEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qRoleFilter, qhkRoleFilter, _ := qs.GetOK("roleFilter") - if err := o.bindRoleFilter(qRoleFilter, qhkRoleFilter, route.Formats); err != nil { - res = append(res, err) - } - - qRoleSemantic, qhkRoleSemantic, _ := qs.GetOK("roleSemantic") - if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListEdgeRoutersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListEdgeRoutersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListEdgeRoutersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindRoleFilter binds and validates array parameter RoleFilter from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *ListEdgeRoutersParams) bindRoleFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - roleFilterIC := rawData - if len(roleFilterIC) == 0 { - return nil - } - - var roleFilterIR []string - for _, roleFilterIV := range roleFilterIC { - roleFilterI := roleFilterIV - - roleFilterIR = append(roleFilterIR, roleFilterI) - } - - o.RoleFilter = roleFilterIR - - return nil -} - -// bindRoleSemantic binds and validates parameter RoleSemantic from query. -func (o *ListEdgeRoutersParams) bindRoleSemantic(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RoleSemantic = &raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_routers_responses.go b/rest_management_api_server/operations/edge_router/list_edge_routers_responses.go deleted file mode 100644 index 8750c2169..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRoutersOKCode is the HTTP code returned for type ListEdgeRoutersOK -const ListEdgeRoutersOKCode int = 200 - -/*ListEdgeRoutersOK A list of edge routers - -swagger:response listEdgeRoutersOK -*/ -type ListEdgeRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRoutersOK creates ListEdgeRoutersOK with default headers values -func NewListEdgeRoutersOK() *ListEdgeRoutersOK { - - return &ListEdgeRoutersOK{} -} - -// WithPayload adds the payload to the list edge routers o k response -func (o *ListEdgeRoutersOK) WithPayload(payload *rest_model.ListEdgeRoutersEnvelope) *ListEdgeRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge routers o k response -func (o *ListEdgeRoutersOK) SetPayload(payload *rest_model.ListEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRoutersBadRequestCode is the HTTP code returned for type ListEdgeRoutersBadRequest -const ListEdgeRoutersBadRequestCode int = 400 - -/*ListEdgeRoutersBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listEdgeRoutersBadRequest -*/ -type ListEdgeRoutersBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRoutersBadRequest creates ListEdgeRoutersBadRequest with default headers values -func NewListEdgeRoutersBadRequest() *ListEdgeRoutersBadRequest { - - return &ListEdgeRoutersBadRequest{} -} - -// WithPayload adds the payload to the list edge routers bad request response -func (o *ListEdgeRoutersBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRoutersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge routers bad request response -func (o *ListEdgeRoutersBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRoutersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRoutersUnauthorizedCode is the HTTP code returned for type ListEdgeRoutersUnauthorized -const ListEdgeRoutersUnauthorizedCode int = 401 - -/*ListEdgeRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRoutersUnauthorized -*/ -type ListEdgeRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRoutersUnauthorized creates ListEdgeRoutersUnauthorized with default headers values -func NewListEdgeRoutersUnauthorized() *ListEdgeRoutersUnauthorized { - - return &ListEdgeRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list edge routers unauthorized response -func (o *ListEdgeRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge routers unauthorized response -func (o *ListEdgeRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/list_edge_routers_urlbuilder.go b/rest_management_api_server/operations/edge_router/list_edge_routers_urlbuilder.go deleted file mode 100644 index 2b4ee7dd9..000000000 --- a/rest_management_api_server/operations/edge_router/list_edge_routers_urlbuilder.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListEdgeRoutersURL generates an URL for the list edge routers operation -type ListEdgeRoutersURL struct { - Filter *string - Limit *int64 - Offset *int64 - RoleFilter []string - RoleSemantic *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRoutersURL) WithBasePath(bp string) *ListEdgeRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var roleFilterIR []string - for _, roleFilterI := range o.RoleFilter { - roleFilterIS := roleFilterI - if roleFilterIS != "" { - roleFilterIR = append(roleFilterIR, roleFilterIS) - } - } - - roleFilter := swag.JoinByFormat(roleFilterIR, "multi") - - for _, qsv := range roleFilter { - qs.Add("roleFilter", qsv) - } - - var roleSemanticQ string - if o.RoleSemantic != nil { - roleSemanticQ = *o.RoleSemantic - } - if roleSemanticQ != "" { - qs.Set("roleSemantic", roleSemanticQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/patch_edge_router.go b/rest_management_api_server/operations/edge_router/patch_edge_router.go deleted file mode 100644 index 8c3909cee..000000000 --- a/rest_management_api_server/operations/edge_router/patch_edge_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchEdgeRouterHandlerFunc turns a function with the right signature into a patch edge router handler -type PatchEdgeRouterHandlerFunc func(PatchEdgeRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchEdgeRouterHandlerFunc) Handle(params PatchEdgeRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchEdgeRouterHandler interface for that can handle valid patch edge router params -type PatchEdgeRouterHandler interface { - Handle(PatchEdgeRouterParams, interface{}) middleware.Responder -} - -// NewPatchEdgeRouter creates a new http.Handler for the patch edge router operation -func NewPatchEdgeRouter(ctx *middleware.Context, handler PatchEdgeRouterHandler) *PatchEdgeRouter { - return &PatchEdgeRouter{Context: ctx, Handler: handler} -} - -/* PatchEdgeRouter swagger:route PATCH /edge-routers/{id} Edge Router patchEdgeRouter - -Update the supplied fields on an edge router - -Update the supplied fields on an edge router. Requires admin access. - -*/ -type PatchEdgeRouter struct { - Context *middleware.Context - Handler PatchEdgeRouterHandler -} - -func (o *PatchEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchEdgeRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/patch_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/patch_edge_router_parameters.go deleted file mode 100644 index 6579d1dc6..000000000 --- a/rest_management_api_server/operations/edge_router/patch_edge_router_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchEdgeRouterParams creates a new PatchEdgeRouterParams object -// -// There are no default values defined in the spec. -func NewPatchEdgeRouterParams() PatchEdgeRouterParams { - - return PatchEdgeRouterParams{} -} - -// PatchEdgeRouterParams contains all the bound params for the patch edge router operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchEdgeRouter -type PatchEdgeRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An edge router patch object - Required: true - In: body - */ - EdgeRouter *rest_model.EdgeRouterPatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchEdgeRouterParams() beforehand. -func (o *PatchEdgeRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EdgeRouterPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("edgeRouter", "body", "")) - } else { - res = append(res, errors.NewParseError("edgeRouter", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.EdgeRouter = &body - } - } - } else { - res = append(res, errors.Required("edgeRouter", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchEdgeRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/patch_edge_router_responses.go b/rest_management_api_server/operations/edge_router/patch_edge_router_responses.go deleted file mode 100644 index 7f0f316fd..000000000 --- a/rest_management_api_server/operations/edge_router/patch_edge_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchEdgeRouterOKCode is the HTTP code returned for type PatchEdgeRouterOK -const PatchEdgeRouterOKCode int = 200 - -/*PatchEdgeRouterOK The patch request was successful and the resource has been altered - -swagger:response patchEdgeRouterOK -*/ -type PatchEdgeRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchEdgeRouterOK creates PatchEdgeRouterOK with default headers values -func NewPatchEdgeRouterOK() *PatchEdgeRouterOK { - - return &PatchEdgeRouterOK{} -} - -// WithPayload adds the payload to the patch edge router o k response -func (o *PatchEdgeRouterOK) WithPayload(payload *rest_model.Empty) *PatchEdgeRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router o k response -func (o *PatchEdgeRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchEdgeRouterBadRequestCode is the HTTP code returned for type PatchEdgeRouterBadRequest -const PatchEdgeRouterBadRequestCode int = 400 - -/*PatchEdgeRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchEdgeRouterBadRequest -*/ -type PatchEdgeRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchEdgeRouterBadRequest creates PatchEdgeRouterBadRequest with default headers values -func NewPatchEdgeRouterBadRequest() *PatchEdgeRouterBadRequest { - - return &PatchEdgeRouterBadRequest{} -} - -// WithPayload adds the payload to the patch edge router bad request response -func (o *PatchEdgeRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchEdgeRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router bad request response -func (o *PatchEdgeRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchEdgeRouterUnauthorizedCode is the HTTP code returned for type PatchEdgeRouterUnauthorized -const PatchEdgeRouterUnauthorizedCode int = 401 - -/*PatchEdgeRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchEdgeRouterUnauthorized -*/ -type PatchEdgeRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchEdgeRouterUnauthorized creates PatchEdgeRouterUnauthorized with default headers values -func NewPatchEdgeRouterUnauthorized() *PatchEdgeRouterUnauthorized { - - return &PatchEdgeRouterUnauthorized{} -} - -// WithPayload adds the payload to the patch edge router unauthorized response -func (o *PatchEdgeRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchEdgeRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router unauthorized response -func (o *PatchEdgeRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchEdgeRouterNotFoundCode is the HTTP code returned for type PatchEdgeRouterNotFound -const PatchEdgeRouterNotFoundCode int = 404 - -/*PatchEdgeRouterNotFound The requested resource does not exist - -swagger:response patchEdgeRouterNotFound -*/ -type PatchEdgeRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchEdgeRouterNotFound creates PatchEdgeRouterNotFound with default headers values -func NewPatchEdgeRouterNotFound() *PatchEdgeRouterNotFound { - - return &PatchEdgeRouterNotFound{} -} - -// WithPayload adds the payload to the patch edge router not found response -func (o *PatchEdgeRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchEdgeRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router not found response -func (o *PatchEdgeRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/patch_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/patch_edge_router_urlbuilder.go deleted file mode 100644 index 0a7672bbb..000000000 --- a/rest_management_api_server/operations/edge_router/patch_edge_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchEdgeRouterURL generates an URL for the patch edge router operation -type PatchEdgeRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchEdgeRouterURL) WithBasePath(bp string) *PatchEdgeRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchEdgeRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchEdgeRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchEdgeRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchEdgeRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchEdgeRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchEdgeRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchEdgeRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchEdgeRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchEdgeRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/re_enroll_edge_router.go b/rest_management_api_server/operations/edge_router/re_enroll_edge_router.go deleted file mode 100644 index a82f7490a..000000000 --- a/rest_management_api_server/operations/edge_router/re_enroll_edge_router.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ReEnrollEdgeRouterHandlerFunc turns a function with the right signature into a re enroll edge router handler -type ReEnrollEdgeRouterHandlerFunc func(ReEnrollEdgeRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ReEnrollEdgeRouterHandlerFunc) Handle(params ReEnrollEdgeRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ReEnrollEdgeRouterHandler interface for that can handle valid re enroll edge router params -type ReEnrollEdgeRouterHandler interface { - Handle(ReEnrollEdgeRouterParams, interface{}) middleware.Responder -} - -// NewReEnrollEdgeRouter creates a new http.Handler for the re enroll edge router operation -func NewReEnrollEdgeRouter(ctx *middleware.Context, handler ReEnrollEdgeRouterHandler) *ReEnrollEdgeRouter { - return &ReEnrollEdgeRouter{Context: ctx, Handler: handler} -} - -/* ReEnrollEdgeRouter swagger:route POST /edge-routers/{id}/re-enroll Edge Router reEnrollEdgeRouter - -Re-enroll an edge router - -Removes current certificate based authentication mechanisms and reverts the edge router into a state where enrollment must be performed. -The router retains all other properties and associations. If the router is currently connected, it will be disconnected and any -attemps to reconnect will fail until the enrollment process is completed with the newly generated JWT. - -If the edge router has an existing outstanding enrollment JWT it will be replaced. The previous JWT will no longer be usable to -complete the enrollment process. - - -*/ -type ReEnrollEdgeRouter struct { - Context *middleware.Context - Handler ReEnrollEdgeRouterHandler -} - -func (o *ReEnrollEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewReEnrollEdgeRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/re_enroll_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/re_enroll_edge_router_parameters.go deleted file mode 100644 index 1b593174e..000000000 --- a/rest_management_api_server/operations/edge_router/re_enroll_edge_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewReEnrollEdgeRouterParams creates a new ReEnrollEdgeRouterParams object -// -// There are no default values defined in the spec. -func NewReEnrollEdgeRouterParams() ReEnrollEdgeRouterParams { - - return ReEnrollEdgeRouterParams{} -} - -// ReEnrollEdgeRouterParams contains all the bound params for the re enroll edge router operation -// typically these are obtained from a http.Request -// -// swagger:parameters reEnrollEdgeRouter -type ReEnrollEdgeRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewReEnrollEdgeRouterParams() beforehand. -func (o *ReEnrollEdgeRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ReEnrollEdgeRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/re_enroll_edge_router_responses.go b/rest_management_api_server/operations/edge_router/re_enroll_edge_router_responses.go deleted file mode 100644 index 492750894..000000000 --- a/rest_management_api_server/operations/edge_router/re_enroll_edge_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ReEnrollEdgeRouterOKCode is the HTTP code returned for type ReEnrollEdgeRouterOK -const ReEnrollEdgeRouterOKCode int = 200 - -/*ReEnrollEdgeRouterOK Base empty response - -swagger:response reEnrollEdgeRouterOK -*/ -type ReEnrollEdgeRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewReEnrollEdgeRouterOK creates ReEnrollEdgeRouterOK with default headers values -func NewReEnrollEdgeRouterOK() *ReEnrollEdgeRouterOK { - - return &ReEnrollEdgeRouterOK{} -} - -// WithPayload adds the payload to the re enroll edge router o k response -func (o *ReEnrollEdgeRouterOK) WithPayload(payload *rest_model.Empty) *ReEnrollEdgeRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the re enroll edge router o k response -func (o *ReEnrollEdgeRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReEnrollEdgeRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReEnrollEdgeRouterUnauthorizedCode is the HTTP code returned for type ReEnrollEdgeRouterUnauthorized -const ReEnrollEdgeRouterUnauthorizedCode int = 401 - -/*ReEnrollEdgeRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response reEnrollEdgeRouterUnauthorized -*/ -type ReEnrollEdgeRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewReEnrollEdgeRouterUnauthorized creates ReEnrollEdgeRouterUnauthorized with default headers values -func NewReEnrollEdgeRouterUnauthorized() *ReEnrollEdgeRouterUnauthorized { - - return &ReEnrollEdgeRouterUnauthorized{} -} - -// WithPayload adds the payload to the re enroll edge router unauthorized response -func (o *ReEnrollEdgeRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ReEnrollEdgeRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the re enroll edge router unauthorized response -func (o *ReEnrollEdgeRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReEnrollEdgeRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReEnrollEdgeRouterNotFoundCode is the HTTP code returned for type ReEnrollEdgeRouterNotFound -const ReEnrollEdgeRouterNotFoundCode int = 404 - -/*ReEnrollEdgeRouterNotFound The requested resource does not exist - -swagger:response reEnrollEdgeRouterNotFound -*/ -type ReEnrollEdgeRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewReEnrollEdgeRouterNotFound creates ReEnrollEdgeRouterNotFound with default headers values -func NewReEnrollEdgeRouterNotFound() *ReEnrollEdgeRouterNotFound { - - return &ReEnrollEdgeRouterNotFound{} -} - -// WithPayload adds the payload to the re enroll edge router not found response -func (o *ReEnrollEdgeRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ReEnrollEdgeRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the re enroll edge router not found response -func (o *ReEnrollEdgeRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReEnrollEdgeRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/re_enroll_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/re_enroll_edge_router_urlbuilder.go deleted file mode 100644 index e6756d987..000000000 --- a/rest_management_api_server/operations/edge_router/re_enroll_edge_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ReEnrollEdgeRouterURL generates an URL for the re enroll edge router operation -type ReEnrollEdgeRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReEnrollEdgeRouterURL) WithBasePath(bp string) *ReEnrollEdgeRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReEnrollEdgeRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ReEnrollEdgeRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}/re-enroll" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ReEnrollEdgeRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ReEnrollEdgeRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ReEnrollEdgeRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ReEnrollEdgeRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ReEnrollEdgeRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ReEnrollEdgeRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ReEnrollEdgeRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router/update_edge_router.go b/rest_management_api_server/operations/edge_router/update_edge_router.go deleted file mode 100644 index 539e1573d..000000000 --- a/rest_management_api_server/operations/edge_router/update_edge_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateEdgeRouterHandlerFunc turns a function with the right signature into a update edge router handler -type UpdateEdgeRouterHandlerFunc func(UpdateEdgeRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateEdgeRouterHandlerFunc) Handle(params UpdateEdgeRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateEdgeRouterHandler interface for that can handle valid update edge router params -type UpdateEdgeRouterHandler interface { - Handle(UpdateEdgeRouterParams, interface{}) middleware.Responder -} - -// NewUpdateEdgeRouter creates a new http.Handler for the update edge router operation -func NewUpdateEdgeRouter(ctx *middleware.Context, handler UpdateEdgeRouterHandler) *UpdateEdgeRouter { - return &UpdateEdgeRouter{Context: ctx, Handler: handler} -} - -/* UpdateEdgeRouter swagger:route PUT /edge-routers/{id} Edge Router updateEdgeRouter - -Update all fields on an edge router - -Update all fields on an edge router by id. Requires admin access. - -*/ -type UpdateEdgeRouter struct { - Context *middleware.Context - Handler UpdateEdgeRouterHandler -} - -func (o *UpdateEdgeRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateEdgeRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router/update_edge_router_parameters.go b/rest_management_api_server/operations/edge_router/update_edge_router_parameters.go deleted file mode 100644 index 36f23d4f6..000000000 --- a/rest_management_api_server/operations/edge_router/update_edge_router_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateEdgeRouterParams creates a new UpdateEdgeRouterParams object -// -// There are no default values defined in the spec. -func NewUpdateEdgeRouterParams() UpdateEdgeRouterParams { - - return UpdateEdgeRouterParams{} -} - -// UpdateEdgeRouterParams contains all the bound params for the update edge router operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateEdgeRouter -type UpdateEdgeRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An edge router update object - Required: true - In: body - */ - EdgeRouter *rest_model.EdgeRouterUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateEdgeRouterParams() beforehand. -func (o *UpdateEdgeRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EdgeRouterUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("edgeRouter", "body", "")) - } else { - res = append(res, errors.NewParseError("edgeRouter", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.EdgeRouter = &body - } - } - } else { - res = append(res, errors.Required("edgeRouter", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateEdgeRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router/update_edge_router_responses.go b/rest_management_api_server/operations/edge_router/update_edge_router_responses.go deleted file mode 100644 index 119b3d342..000000000 --- a/rest_management_api_server/operations/edge_router/update_edge_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateEdgeRouterOKCode is the HTTP code returned for type UpdateEdgeRouterOK -const UpdateEdgeRouterOKCode int = 200 - -/*UpdateEdgeRouterOK The update request was successful and the resource has been altered - -swagger:response updateEdgeRouterOK -*/ -type UpdateEdgeRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterOK creates UpdateEdgeRouterOK with default headers values -func NewUpdateEdgeRouterOK() *UpdateEdgeRouterOK { - - return &UpdateEdgeRouterOK{} -} - -// WithPayload adds the payload to the update edge router o k response -func (o *UpdateEdgeRouterOK) WithPayload(payload *rest_model.Empty) *UpdateEdgeRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router o k response -func (o *UpdateEdgeRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateEdgeRouterBadRequestCode is the HTTP code returned for type UpdateEdgeRouterBadRequest -const UpdateEdgeRouterBadRequestCode int = 400 - -/*UpdateEdgeRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateEdgeRouterBadRequest -*/ -type UpdateEdgeRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterBadRequest creates UpdateEdgeRouterBadRequest with default headers values -func NewUpdateEdgeRouterBadRequest() *UpdateEdgeRouterBadRequest { - - return &UpdateEdgeRouterBadRequest{} -} - -// WithPayload adds the payload to the update edge router bad request response -func (o *UpdateEdgeRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateEdgeRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router bad request response -func (o *UpdateEdgeRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateEdgeRouterUnauthorizedCode is the HTTP code returned for type UpdateEdgeRouterUnauthorized -const UpdateEdgeRouterUnauthorizedCode int = 401 - -/*UpdateEdgeRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateEdgeRouterUnauthorized -*/ -type UpdateEdgeRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterUnauthorized creates UpdateEdgeRouterUnauthorized with default headers values -func NewUpdateEdgeRouterUnauthorized() *UpdateEdgeRouterUnauthorized { - - return &UpdateEdgeRouterUnauthorized{} -} - -// WithPayload adds the payload to the update edge router unauthorized response -func (o *UpdateEdgeRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateEdgeRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router unauthorized response -func (o *UpdateEdgeRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateEdgeRouterNotFoundCode is the HTTP code returned for type UpdateEdgeRouterNotFound -const UpdateEdgeRouterNotFoundCode int = 404 - -/*UpdateEdgeRouterNotFound The requested resource does not exist - -swagger:response updateEdgeRouterNotFound -*/ -type UpdateEdgeRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterNotFound creates UpdateEdgeRouterNotFound with default headers values -func NewUpdateEdgeRouterNotFound() *UpdateEdgeRouterNotFound { - - return &UpdateEdgeRouterNotFound{} -} - -// WithPayload adds the payload to the update edge router not found response -func (o *UpdateEdgeRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateEdgeRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router not found response -func (o *UpdateEdgeRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router/update_edge_router_urlbuilder.go b/rest_management_api_server/operations/edge_router/update_edge_router_urlbuilder.go deleted file mode 100644 index 776d9da6b..000000000 --- a/rest_management_api_server/operations/edge_router/update_edge_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateEdgeRouterURL generates an URL for the update edge router operation -type UpdateEdgeRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateEdgeRouterURL) WithBasePath(bp string) *UpdateEdgeRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateEdgeRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateEdgeRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateEdgeRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateEdgeRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateEdgeRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateEdgeRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateEdgeRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateEdgeRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateEdgeRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy.go deleted file mode 100644 index 4cee3dd3d..000000000 --- a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateEdgeRouterPolicyHandlerFunc turns a function with the right signature into a create edge router policy handler -type CreateEdgeRouterPolicyHandlerFunc func(CreateEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateEdgeRouterPolicyHandlerFunc) Handle(params CreateEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateEdgeRouterPolicyHandler interface for that can handle valid create edge router policy params -type CreateEdgeRouterPolicyHandler interface { - Handle(CreateEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewCreateEdgeRouterPolicy creates a new http.Handler for the create edge router policy operation -func NewCreateEdgeRouterPolicy(ctx *middleware.Context, handler CreateEdgeRouterPolicyHandler) *CreateEdgeRouterPolicy { - return &CreateEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* CreateEdgeRouterPolicy swagger:route POST /edge-router-policies Edge Router Policy createEdgeRouterPolicy - -Create an edge router policy resource - -Create an edge router policy resource. Requires admin access. - -*/ -type CreateEdgeRouterPolicy struct { - Context *middleware.Context - Handler CreateEdgeRouterPolicyHandler -} - -func (o *CreateEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_parameters.go b/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_parameters.go deleted file mode 100644 index d12311160..000000000 --- a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateEdgeRouterPolicyParams creates a new CreateEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewCreateEdgeRouterPolicyParams() CreateEdgeRouterPolicyParams { - - return CreateEdgeRouterPolicyParams{} -} - -// CreateEdgeRouterPolicyParams contains all the bound params for the create edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters createEdgeRouterPolicy -type CreateEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An edge router policy to create - Required: true - In: body - */ - Policy *rest_model.EdgeRouterPolicyCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateEdgeRouterPolicyParams() beforehand. -func (o *CreateEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EdgeRouterPolicyCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_responses.go b/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_responses.go deleted file mode 100644 index 7a77bdc83..000000000 --- a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateEdgeRouterPolicyCreatedCode is the HTTP code returned for type CreateEdgeRouterPolicyCreated -const CreateEdgeRouterPolicyCreatedCode int = 201 - -/*CreateEdgeRouterPolicyCreated The create request was successful and the resource has been added at the following location - -swagger:response createEdgeRouterPolicyCreated -*/ -type CreateEdgeRouterPolicyCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateEdgeRouterPolicyCreated creates CreateEdgeRouterPolicyCreated with default headers values -func NewCreateEdgeRouterPolicyCreated() *CreateEdgeRouterPolicyCreated { - - return &CreateEdgeRouterPolicyCreated{} -} - -// WithPayload adds the payload to the create edge router policy created response -func (o *CreateEdgeRouterPolicyCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateEdgeRouterPolicyCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create edge router policy created response -func (o *CreateEdgeRouterPolicyCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEdgeRouterPolicyCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEdgeRouterPolicyBadRequestCode is the HTTP code returned for type CreateEdgeRouterPolicyBadRequest -const CreateEdgeRouterPolicyBadRequestCode int = 400 - -/*CreateEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createEdgeRouterPolicyBadRequest -*/ -type CreateEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEdgeRouterPolicyBadRequest creates CreateEdgeRouterPolicyBadRequest with default headers values -func NewCreateEdgeRouterPolicyBadRequest() *CreateEdgeRouterPolicyBadRequest { - - return &CreateEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the create edge router policy bad request response -func (o *CreateEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create edge router policy bad request response -func (o *CreateEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type CreateEdgeRouterPolicyUnauthorized -const CreateEdgeRouterPolicyUnauthorizedCode int = 401 - -/*CreateEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createEdgeRouterPolicyUnauthorized -*/ -type CreateEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEdgeRouterPolicyUnauthorized creates CreateEdgeRouterPolicyUnauthorized with default headers values -func NewCreateEdgeRouterPolicyUnauthorized() *CreateEdgeRouterPolicyUnauthorized { - - return &CreateEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the create edge router policy unauthorized response -func (o *CreateEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create edge router policy unauthorized response -func (o *CreateEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_urlbuilder.go deleted file mode 100644 index 590934b9e..000000000 --- a/rest_management_api_server/operations/edge_router_policy/create_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateEdgeRouterPolicyURL generates an URL for the create edge router policy operation -type CreateEdgeRouterPolicyURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEdgeRouterPolicyURL) WithBasePath(bp string) *CreateEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy.go deleted file mode 100644 index ec045e55b..000000000 --- a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteEdgeRouterPolicyHandlerFunc turns a function with the right signature into a delete edge router policy handler -type DeleteEdgeRouterPolicyHandlerFunc func(DeleteEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteEdgeRouterPolicyHandlerFunc) Handle(params DeleteEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteEdgeRouterPolicyHandler interface for that can handle valid delete edge router policy params -type DeleteEdgeRouterPolicyHandler interface { - Handle(DeleteEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewDeleteEdgeRouterPolicy creates a new http.Handler for the delete edge router policy operation -func NewDeleteEdgeRouterPolicy(ctx *middleware.Context, handler DeleteEdgeRouterPolicyHandler) *DeleteEdgeRouterPolicy { - return &DeleteEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* DeleteEdgeRouterPolicy swagger:route DELETE /edge-router-policies/{id} Edge Router Policy deleteEdgeRouterPolicy - -Delete an edge router policy - -Delete an edge router policy by id. Requires admin access. - -*/ -type DeleteEdgeRouterPolicy struct { - Context *middleware.Context - Handler DeleteEdgeRouterPolicyHandler -} - -func (o *DeleteEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_parameters.go b/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_parameters.go deleted file mode 100644 index d8e28edd6..000000000 --- a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEdgeRouterPolicyParams creates a new DeleteEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewDeleteEdgeRouterPolicyParams() DeleteEdgeRouterPolicyParams { - - return DeleteEdgeRouterPolicyParams{} -} - -// DeleteEdgeRouterPolicyParams contains all the bound params for the delete edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteEdgeRouterPolicy -type DeleteEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteEdgeRouterPolicyParams() beforehand. -func (o *DeleteEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_responses.go b/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_responses.go deleted file mode 100644 index 1ec9dafa5..000000000 --- a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteEdgeRouterPolicyOKCode is the HTTP code returned for type DeleteEdgeRouterPolicyOK -const DeleteEdgeRouterPolicyOKCode int = 200 - -/*DeleteEdgeRouterPolicyOK The delete request was successful and the resource has been removed - -swagger:response deleteEdgeRouterPolicyOK -*/ -type DeleteEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterPolicyOK creates DeleteEdgeRouterPolicyOK with default headers values -func NewDeleteEdgeRouterPolicyOK() *DeleteEdgeRouterPolicyOK { - - return &DeleteEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the delete edge router policy o k response -func (o *DeleteEdgeRouterPolicyOK) WithPayload(payload *rest_model.Empty) *DeleteEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router policy o k response -func (o *DeleteEdgeRouterPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEdgeRouterPolicyBadRequestCode is the HTTP code returned for type DeleteEdgeRouterPolicyBadRequest -const DeleteEdgeRouterPolicyBadRequestCode int = 400 - -/*DeleteEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteEdgeRouterPolicyBadRequest -*/ -type DeleteEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterPolicyBadRequest creates DeleteEdgeRouterPolicyBadRequest with default headers values -func NewDeleteEdgeRouterPolicyBadRequest() *DeleteEdgeRouterPolicyBadRequest { - - return &DeleteEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the delete edge router policy bad request response -func (o *DeleteEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router policy bad request response -func (o *DeleteEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type DeleteEdgeRouterPolicyUnauthorized -const DeleteEdgeRouterPolicyUnauthorizedCode int = 401 - -/*DeleteEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteEdgeRouterPolicyUnauthorized -*/ -type DeleteEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterPolicyUnauthorized creates DeleteEdgeRouterPolicyUnauthorized with default headers values -func NewDeleteEdgeRouterPolicyUnauthorized() *DeleteEdgeRouterPolicyUnauthorized { - - return &DeleteEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the delete edge router policy unauthorized response -func (o *DeleteEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router policy unauthorized response -func (o *DeleteEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEdgeRouterPolicyConflictCode is the HTTP code returned for type DeleteEdgeRouterPolicyConflict -const DeleteEdgeRouterPolicyConflictCode int = 409 - -/*DeleteEdgeRouterPolicyConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteEdgeRouterPolicyConflict -*/ -type DeleteEdgeRouterPolicyConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEdgeRouterPolicyConflict creates DeleteEdgeRouterPolicyConflict with default headers values -func NewDeleteEdgeRouterPolicyConflict() *DeleteEdgeRouterPolicyConflict { - - return &DeleteEdgeRouterPolicyConflict{} -} - -// WithPayload adds the payload to the delete edge router policy conflict response -func (o *DeleteEdgeRouterPolicyConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEdgeRouterPolicyConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete edge router policy conflict response -func (o *DeleteEdgeRouterPolicyConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEdgeRouterPolicyConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_urlbuilder.go deleted file mode 100644 index badf9acf9..000000000 --- a/rest_management_api_server/operations/edge_router_policy/delete_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteEdgeRouterPolicyURL generates an URL for the delete edge router policy operation -type DeleteEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEdgeRouterPolicyURL) WithBasePath(bp string) *DeleteEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy.go deleted file mode 100644 index 098d45bd8..000000000 --- a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailEdgeRouterPolicyHandlerFunc turns a function with the right signature into a detail edge router policy handler -type DetailEdgeRouterPolicyHandlerFunc func(DetailEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailEdgeRouterPolicyHandlerFunc) Handle(params DetailEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailEdgeRouterPolicyHandler interface for that can handle valid detail edge router policy params -type DetailEdgeRouterPolicyHandler interface { - Handle(DetailEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewDetailEdgeRouterPolicy creates a new http.Handler for the detail edge router policy operation -func NewDetailEdgeRouterPolicy(ctx *middleware.Context, handler DetailEdgeRouterPolicyHandler) *DetailEdgeRouterPolicy { - return &DetailEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* DetailEdgeRouterPolicy swagger:route GET /edge-router-policies/{id} Edge Router Policy detailEdgeRouterPolicy - -Retrieves a single edge router policy - -Retrieves a single edge router policy by id. Requires admin access. - -*/ -type DetailEdgeRouterPolicy struct { - Context *middleware.Context - Handler DetailEdgeRouterPolicyHandler -} - -func (o *DetailEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_parameters.go b/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_parameters.go deleted file mode 100644 index b784a647c..000000000 --- a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailEdgeRouterPolicyParams creates a new DetailEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewDetailEdgeRouterPolicyParams() DetailEdgeRouterPolicyParams { - - return DetailEdgeRouterPolicyParams{} -} - -// DetailEdgeRouterPolicyParams contains all the bound params for the detail edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailEdgeRouterPolicy -type DetailEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailEdgeRouterPolicyParams() beforehand. -func (o *DetailEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_responses.go b/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_responses.go deleted file mode 100644 index 55e3caec8..000000000 --- a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailEdgeRouterPolicyOKCode is the HTTP code returned for type DetailEdgeRouterPolicyOK -const DetailEdgeRouterPolicyOKCode int = 200 - -/*DetailEdgeRouterPolicyOK A single edge router policy - -swagger:response detailEdgeRouterPolicyOK -*/ -type DetailEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailEdgeRouterPolicyEnvelope `json:"body,omitempty"` -} - -// NewDetailEdgeRouterPolicyOK creates DetailEdgeRouterPolicyOK with default headers values -func NewDetailEdgeRouterPolicyOK() *DetailEdgeRouterPolicyOK { - - return &DetailEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the detail edge router policy o k response -func (o *DetailEdgeRouterPolicyOK) WithPayload(payload *rest_model.DetailEdgeRouterPolicyEnvelope) *DetailEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail edge router policy o k response -func (o *DetailEdgeRouterPolicyOK) SetPayload(payload *rest_model.DetailEdgeRouterPolicyEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type DetailEdgeRouterPolicyUnauthorized -const DetailEdgeRouterPolicyUnauthorizedCode int = 401 - -/*DetailEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailEdgeRouterPolicyUnauthorized -*/ -type DetailEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailEdgeRouterPolicyUnauthorized creates DetailEdgeRouterPolicyUnauthorized with default headers values -func NewDetailEdgeRouterPolicyUnauthorized() *DetailEdgeRouterPolicyUnauthorized { - - return &DetailEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the detail edge router policy unauthorized response -func (o *DetailEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail edge router policy unauthorized response -func (o *DetailEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailEdgeRouterPolicyNotFoundCode is the HTTP code returned for type DetailEdgeRouterPolicyNotFound -const DetailEdgeRouterPolicyNotFoundCode int = 404 - -/*DetailEdgeRouterPolicyNotFound The requested resource does not exist - -swagger:response detailEdgeRouterPolicyNotFound -*/ -type DetailEdgeRouterPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailEdgeRouterPolicyNotFound creates DetailEdgeRouterPolicyNotFound with default headers values -func NewDetailEdgeRouterPolicyNotFound() *DetailEdgeRouterPolicyNotFound { - - return &DetailEdgeRouterPolicyNotFound{} -} - -// WithPayload adds the payload to the detail edge router policy not found response -func (o *DetailEdgeRouterPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailEdgeRouterPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail edge router policy not found response -func (o *DetailEdgeRouterPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEdgeRouterPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_urlbuilder.go deleted file mode 100644 index b9a90c7a3..000000000 --- a/rest_management_api_server/operations/edge_router_policy/detail_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailEdgeRouterPolicyURL generates an URL for the detail edge router policy operation -type DetailEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailEdgeRouterPolicyURL) WithBasePath(bp string) *DetailEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies.go deleted file mode 100644 index 0ac7a187b..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterPoliciesHandlerFunc turns a function with the right signature into a list edge router policies handler -type ListEdgeRouterPoliciesHandlerFunc func(ListEdgeRouterPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterPoliciesHandlerFunc) Handle(params ListEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterPoliciesHandler interface for that can handle valid list edge router policies params -type ListEdgeRouterPoliciesHandler interface { - Handle(ListEdgeRouterPoliciesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterPolicies creates a new http.Handler for the list edge router policies operation -func NewListEdgeRouterPolicies(ctx *middleware.Context, handler ListEdgeRouterPoliciesHandler) *ListEdgeRouterPolicies { - return &ListEdgeRouterPolicies{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterPolicies swagger:route GET /edge-router-policies Edge Router Policy listEdgeRouterPolicies - -List edge router policies - -Retrieves a list of edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouterPolicies struct { - Context *middleware.Context - Handler ListEdgeRouterPoliciesHandler -} - -func (o *ListEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_parameters.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_parameters.go deleted file mode 100644 index 19b72b541..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEdgeRouterPoliciesParams creates a new ListEdgeRouterPoliciesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterPoliciesParams() ListEdgeRouterPoliciesParams { - - return ListEdgeRouterPoliciesParams{} -} - -// ListEdgeRouterPoliciesParams contains all the bound params for the list edge router policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterPolicies -type ListEdgeRouterPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterPoliciesParams() beforehand. -func (o *ListEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListEdgeRouterPoliciesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListEdgeRouterPoliciesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListEdgeRouterPoliciesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_responses.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_responses.go deleted file mode 100644 index 5679775f9..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterPoliciesOKCode is the HTTP code returned for type ListEdgeRouterPoliciesOK -const ListEdgeRouterPoliciesOKCode int = 200 - -/*ListEdgeRouterPoliciesOK A list of edge router policies - -swagger:response listEdgeRouterPoliciesOK -*/ -type ListEdgeRouterPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRouterPoliciesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPoliciesOK creates ListEdgeRouterPoliciesOK with default headers values -func NewListEdgeRouterPoliciesOK() *ListEdgeRouterPoliciesOK { - - return &ListEdgeRouterPoliciesOK{} -} - -// WithPayload adds the payload to the list edge router policies o k response -func (o *ListEdgeRouterPoliciesOK) WithPayload(payload *rest_model.ListEdgeRouterPoliciesEnvelope) *ListEdgeRouterPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policies o k response -func (o *ListEdgeRouterPoliciesOK) SetPayload(payload *rest_model.ListEdgeRouterPoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterPoliciesBadRequestCode is the HTTP code returned for type ListEdgeRouterPoliciesBadRequest -const ListEdgeRouterPoliciesBadRequestCode int = 400 - -/*ListEdgeRouterPoliciesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listEdgeRouterPoliciesBadRequest -*/ -type ListEdgeRouterPoliciesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPoliciesBadRequest creates ListEdgeRouterPoliciesBadRequest with default headers values -func NewListEdgeRouterPoliciesBadRequest() *ListEdgeRouterPoliciesBadRequest { - - return &ListEdgeRouterPoliciesBadRequest{} -} - -// WithPayload adds the payload to the list edge router policies bad request response -func (o *ListEdgeRouterPoliciesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterPoliciesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policies bad request response -func (o *ListEdgeRouterPoliciesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPoliciesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterPoliciesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterPoliciesUnauthorized -const ListEdgeRouterPoliciesUnauthorizedCode int = 401 - -/*ListEdgeRouterPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterPoliciesUnauthorized -*/ -type ListEdgeRouterPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPoliciesUnauthorized creates ListEdgeRouterPoliciesUnauthorized with default headers values -func NewListEdgeRouterPoliciesUnauthorized() *ListEdgeRouterPoliciesUnauthorized { - - return &ListEdgeRouterPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router policies unauthorized response -func (o *ListEdgeRouterPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policies unauthorized response -func (o *ListEdgeRouterPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_urlbuilder.go deleted file mode 100644 index 5fc4866a5..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policies_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListEdgeRouterPoliciesURL generates an URL for the list edge router policies operation -type ListEdgeRouterPoliciesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterPoliciesURL) WithBasePath(bp string) *ListEdgeRouterPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers.go deleted file mode 100644 index fe8ee1605..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterPolicyEdgeRoutersHandlerFunc turns a function with the right signature into a list edge router policy edge routers handler -type ListEdgeRouterPolicyEdgeRoutersHandlerFunc func(ListEdgeRouterPolicyEdgeRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterPolicyEdgeRoutersHandlerFunc) Handle(params ListEdgeRouterPolicyEdgeRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterPolicyEdgeRoutersHandler interface for that can handle valid list edge router policy edge routers params -type ListEdgeRouterPolicyEdgeRoutersHandler interface { - Handle(ListEdgeRouterPolicyEdgeRoutersParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterPolicyEdgeRouters creates a new http.Handler for the list edge router policy edge routers operation -func NewListEdgeRouterPolicyEdgeRouters(ctx *middleware.Context, handler ListEdgeRouterPolicyEdgeRoutersHandler) *ListEdgeRouterPolicyEdgeRouters { - return &ListEdgeRouterPolicyEdgeRouters{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterPolicyEdgeRouters swagger:route GET /edge-router-policies/{id}/edge-routers Edge Router Policy listEdgeRouterPolicyEdgeRouters - -List edge routers a policy affects - -Retrieves a list of edge routers an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouterPolicyEdgeRouters struct { - Context *middleware.Context - Handler ListEdgeRouterPolicyEdgeRoutersHandler -} - -func (o *ListEdgeRouterPolicyEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterPolicyEdgeRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go deleted file mode 100644 index 894ab0312..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterPolicyEdgeRoutersParams creates a new ListEdgeRouterPolicyEdgeRoutersParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterPolicyEdgeRoutersParams() ListEdgeRouterPolicyEdgeRoutersParams { - - return ListEdgeRouterPolicyEdgeRoutersParams{} -} - -// ListEdgeRouterPolicyEdgeRoutersParams contains all the bound params for the list edge router policy edge routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterPolicyEdgeRouters -type ListEdgeRouterPolicyEdgeRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterPolicyEdgeRoutersParams() beforehand. -func (o *ListEdgeRouterPolicyEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListEdgeRouterPolicyEdgeRoutersParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_responses.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_responses.go deleted file mode 100644 index 9cef277ae..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterPolicyEdgeRoutersOKCode is the HTTP code returned for type ListEdgeRouterPolicyEdgeRoutersOK -const ListEdgeRouterPolicyEdgeRoutersOKCode int = 200 - -/*ListEdgeRouterPolicyEdgeRoutersOK A list of edge routers - -swagger:response listEdgeRouterPolicyEdgeRoutersOK -*/ -type ListEdgeRouterPolicyEdgeRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPolicyEdgeRoutersOK creates ListEdgeRouterPolicyEdgeRoutersOK with default headers values -func NewListEdgeRouterPolicyEdgeRoutersOK() *ListEdgeRouterPolicyEdgeRoutersOK { - - return &ListEdgeRouterPolicyEdgeRoutersOK{} -} - -// WithPayload adds the payload to the list edge router policy edge routers o k response -func (o *ListEdgeRouterPolicyEdgeRoutersOK) WithPayload(payload *rest_model.ListEdgeRoutersEnvelope) *ListEdgeRouterPolicyEdgeRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policy edge routers o k response -func (o *ListEdgeRouterPolicyEdgeRoutersOK) SetPayload(payload *rest_model.ListEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPolicyEdgeRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterPolicyEdgeRoutersUnauthorizedCode is the HTTP code returned for type ListEdgeRouterPolicyEdgeRoutersUnauthorized -const ListEdgeRouterPolicyEdgeRoutersUnauthorizedCode int = 401 - -/*ListEdgeRouterPolicyEdgeRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterPolicyEdgeRoutersUnauthorized -*/ -type ListEdgeRouterPolicyEdgeRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPolicyEdgeRoutersUnauthorized creates ListEdgeRouterPolicyEdgeRoutersUnauthorized with default headers values -func NewListEdgeRouterPolicyEdgeRoutersUnauthorized() *ListEdgeRouterPolicyEdgeRoutersUnauthorized { - - return &ListEdgeRouterPolicyEdgeRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list edge router policy edge routers unauthorized response -func (o *ListEdgeRouterPolicyEdgeRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterPolicyEdgeRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policy edge routers unauthorized response -func (o *ListEdgeRouterPolicyEdgeRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPolicyEdgeRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterPolicyEdgeRoutersNotFoundCode is the HTTP code returned for type ListEdgeRouterPolicyEdgeRoutersNotFound -const ListEdgeRouterPolicyEdgeRoutersNotFoundCode int = 404 - -/*ListEdgeRouterPolicyEdgeRoutersNotFound The requested resource does not exist - -swagger:response listEdgeRouterPolicyEdgeRoutersNotFound -*/ -type ListEdgeRouterPolicyEdgeRoutersNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPolicyEdgeRoutersNotFound creates ListEdgeRouterPolicyEdgeRoutersNotFound with default headers values -func NewListEdgeRouterPolicyEdgeRoutersNotFound() *ListEdgeRouterPolicyEdgeRoutersNotFound { - - return &ListEdgeRouterPolicyEdgeRoutersNotFound{} -} - -// WithPayload adds the payload to the list edge router policy edge routers not found response -func (o *ListEdgeRouterPolicyEdgeRoutersNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterPolicyEdgeRoutersNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policy edge routers not found response -func (o *ListEdgeRouterPolicyEdgeRoutersNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPolicyEdgeRoutersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_urlbuilder.go deleted file mode 100644 index 57466a78d..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_edge_routers_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListEdgeRouterPolicyEdgeRoutersURL generates an URL for the list edge router policy edge routers operation -type ListEdgeRouterPolicyEdgeRoutersURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterPolicyEdgeRoutersURL) WithBasePath(bp string) *ListEdgeRouterPolicyEdgeRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterPolicyEdgeRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterPolicyEdgeRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies/{id}/edge-routers" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListEdgeRouterPolicyEdgeRoutersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterPolicyEdgeRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterPolicyEdgeRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterPolicyEdgeRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterPolicyEdgeRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterPolicyEdgeRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterPolicyEdgeRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities.go deleted file mode 100644 index aaba9350c..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterPolicyIdentitiesHandlerFunc turns a function with the right signature into a list edge router policy identities handler -type ListEdgeRouterPolicyIdentitiesHandlerFunc func(ListEdgeRouterPolicyIdentitiesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterPolicyIdentitiesHandlerFunc) Handle(params ListEdgeRouterPolicyIdentitiesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterPolicyIdentitiesHandler interface for that can handle valid list edge router policy identities params -type ListEdgeRouterPolicyIdentitiesHandler interface { - Handle(ListEdgeRouterPolicyIdentitiesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterPolicyIdentities creates a new http.Handler for the list edge router policy identities operation -func NewListEdgeRouterPolicyIdentities(ctx *middleware.Context, handler ListEdgeRouterPolicyIdentitiesHandler) *ListEdgeRouterPolicyIdentities { - return &ListEdgeRouterPolicyIdentities{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterPolicyIdentities swagger:route GET /edge-router-policies/{id}/identities Edge Router Policy listEdgeRouterPolicyIdentities - -List identities an edge router policy affects - -Retrieves a list of identities an edge router policy resources affects; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouterPolicyIdentities struct { - Context *middleware.Context - Handler ListEdgeRouterPolicyIdentitiesHandler -} - -func (o *ListEdgeRouterPolicyIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterPolicyIdentitiesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_parameters.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_parameters.go deleted file mode 100644 index 7fc84878b..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListEdgeRouterPolicyIdentitiesParams creates a new ListEdgeRouterPolicyIdentitiesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterPolicyIdentitiesParams() ListEdgeRouterPolicyIdentitiesParams { - - return ListEdgeRouterPolicyIdentitiesParams{} -} - -// ListEdgeRouterPolicyIdentitiesParams contains all the bound params for the list edge router policy identities operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterPolicyIdentities -type ListEdgeRouterPolicyIdentitiesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterPolicyIdentitiesParams() beforehand. -func (o *ListEdgeRouterPolicyIdentitiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListEdgeRouterPolicyIdentitiesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_responses.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_responses.go deleted file mode 100644 index 05e028125..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterPolicyIdentitiesOKCode is the HTTP code returned for type ListEdgeRouterPolicyIdentitiesOK -const ListEdgeRouterPolicyIdentitiesOKCode int = 200 - -/*ListEdgeRouterPolicyIdentitiesOK A list of identities - -swagger:response listEdgeRouterPolicyIdentitiesOK -*/ -type ListEdgeRouterPolicyIdentitiesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListIdentitiesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPolicyIdentitiesOK creates ListEdgeRouterPolicyIdentitiesOK with default headers values -func NewListEdgeRouterPolicyIdentitiesOK() *ListEdgeRouterPolicyIdentitiesOK { - - return &ListEdgeRouterPolicyIdentitiesOK{} -} - -// WithPayload adds the payload to the list edge router policy identities o k response -func (o *ListEdgeRouterPolicyIdentitiesOK) WithPayload(payload *rest_model.ListIdentitiesEnvelope) *ListEdgeRouterPolicyIdentitiesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policy identities o k response -func (o *ListEdgeRouterPolicyIdentitiesOK) SetPayload(payload *rest_model.ListIdentitiesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPolicyIdentitiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterPolicyIdentitiesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterPolicyIdentitiesUnauthorized -const ListEdgeRouterPolicyIdentitiesUnauthorizedCode int = 401 - -/*ListEdgeRouterPolicyIdentitiesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterPolicyIdentitiesUnauthorized -*/ -type ListEdgeRouterPolicyIdentitiesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPolicyIdentitiesUnauthorized creates ListEdgeRouterPolicyIdentitiesUnauthorized with default headers values -func NewListEdgeRouterPolicyIdentitiesUnauthorized() *ListEdgeRouterPolicyIdentitiesUnauthorized { - - return &ListEdgeRouterPolicyIdentitiesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router policy identities unauthorized response -func (o *ListEdgeRouterPolicyIdentitiesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterPolicyIdentitiesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policy identities unauthorized response -func (o *ListEdgeRouterPolicyIdentitiesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPolicyIdentitiesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterPolicyIdentitiesNotFoundCode is the HTTP code returned for type ListEdgeRouterPolicyIdentitiesNotFound -const ListEdgeRouterPolicyIdentitiesNotFoundCode int = 404 - -/*ListEdgeRouterPolicyIdentitiesNotFound The requested resource does not exist - -swagger:response listEdgeRouterPolicyIdentitiesNotFound -*/ -type ListEdgeRouterPolicyIdentitiesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterPolicyIdentitiesNotFound creates ListEdgeRouterPolicyIdentitiesNotFound with default headers values -func NewListEdgeRouterPolicyIdentitiesNotFound() *ListEdgeRouterPolicyIdentitiesNotFound { - - return &ListEdgeRouterPolicyIdentitiesNotFound{} -} - -// WithPayload adds the payload to the list edge router policy identities not found response -func (o *ListEdgeRouterPolicyIdentitiesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterPolicyIdentitiesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router policy identities not found response -func (o *ListEdgeRouterPolicyIdentitiesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterPolicyIdentitiesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_urlbuilder.go deleted file mode 100644 index f76c36981..000000000 --- a/rest_management_api_server/operations/edge_router_policy/list_edge_router_policy_identities_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListEdgeRouterPolicyIdentitiesURL generates an URL for the list edge router policy identities operation -type ListEdgeRouterPolicyIdentitiesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterPolicyIdentitiesURL) WithBasePath(bp string) *ListEdgeRouterPolicyIdentitiesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterPolicyIdentitiesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterPolicyIdentitiesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies/{id}/identities" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListEdgeRouterPolicyIdentitiesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterPolicyIdentitiesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterPolicyIdentitiesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterPolicyIdentitiesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterPolicyIdentitiesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterPolicyIdentitiesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterPolicyIdentitiesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy.go deleted file mode 100644 index 1400e1251..000000000 --- a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchEdgeRouterPolicyHandlerFunc turns a function with the right signature into a patch edge router policy handler -type PatchEdgeRouterPolicyHandlerFunc func(PatchEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchEdgeRouterPolicyHandlerFunc) Handle(params PatchEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchEdgeRouterPolicyHandler interface for that can handle valid patch edge router policy params -type PatchEdgeRouterPolicyHandler interface { - Handle(PatchEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewPatchEdgeRouterPolicy creates a new http.Handler for the patch edge router policy operation -func NewPatchEdgeRouterPolicy(ctx *middleware.Context, handler PatchEdgeRouterPolicyHandler) *PatchEdgeRouterPolicy { - return &PatchEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* PatchEdgeRouterPolicy swagger:route PATCH /edge-router-policies/{id} Edge Router Policy patchEdgeRouterPolicy - -Update the supplied fields on an edge router policy - -Update the supplied fields on an edge router policy. Requires admin access. - -*/ -type PatchEdgeRouterPolicy struct { - Context *middleware.Context - Handler PatchEdgeRouterPolicyHandler -} - -func (o *PatchEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_parameters.go b/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_parameters.go deleted file mode 100644 index a48da7517..000000000 --- a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchEdgeRouterPolicyParams creates a new PatchEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewPatchEdgeRouterPolicyParams() PatchEdgeRouterPolicyParams { - - return PatchEdgeRouterPolicyParams{} -} - -// PatchEdgeRouterPolicyParams contains all the bound params for the patch edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchEdgeRouterPolicy -type PatchEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*An edge router policy patch object - Required: true - In: body - */ - Policy *rest_model.EdgeRouterPolicyPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchEdgeRouterPolicyParams() beforehand. -func (o *PatchEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EdgeRouterPolicyPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_responses.go b/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_responses.go deleted file mode 100644 index d9d4d7f63..000000000 --- a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchEdgeRouterPolicyOKCode is the HTTP code returned for type PatchEdgeRouterPolicyOK -const PatchEdgeRouterPolicyOKCode int = 200 - -/*PatchEdgeRouterPolicyOK The patch request was successful and the resource has been altered - -swagger:response patchEdgeRouterPolicyOK -*/ -type PatchEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchEdgeRouterPolicyOK creates PatchEdgeRouterPolicyOK with default headers values -func NewPatchEdgeRouterPolicyOK() *PatchEdgeRouterPolicyOK { - - return &PatchEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the patch edge router policy o k response -func (o *PatchEdgeRouterPolicyOK) WithPayload(payload *rest_model.Empty) *PatchEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router policy o k response -func (o *PatchEdgeRouterPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchEdgeRouterPolicyBadRequestCode is the HTTP code returned for type PatchEdgeRouterPolicyBadRequest -const PatchEdgeRouterPolicyBadRequestCode int = 400 - -/*PatchEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchEdgeRouterPolicyBadRequest -*/ -type PatchEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchEdgeRouterPolicyBadRequest creates PatchEdgeRouterPolicyBadRequest with default headers values -func NewPatchEdgeRouterPolicyBadRequest() *PatchEdgeRouterPolicyBadRequest { - - return &PatchEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the patch edge router policy bad request response -func (o *PatchEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router policy bad request response -func (o *PatchEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type PatchEdgeRouterPolicyUnauthorized -const PatchEdgeRouterPolicyUnauthorizedCode int = 401 - -/*PatchEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchEdgeRouterPolicyUnauthorized -*/ -type PatchEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchEdgeRouterPolicyUnauthorized creates PatchEdgeRouterPolicyUnauthorized with default headers values -func NewPatchEdgeRouterPolicyUnauthorized() *PatchEdgeRouterPolicyUnauthorized { - - return &PatchEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the patch edge router policy unauthorized response -func (o *PatchEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router policy unauthorized response -func (o *PatchEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchEdgeRouterPolicyNotFoundCode is the HTTP code returned for type PatchEdgeRouterPolicyNotFound -const PatchEdgeRouterPolicyNotFoundCode int = 404 - -/*PatchEdgeRouterPolicyNotFound The requested resource does not exist - -swagger:response patchEdgeRouterPolicyNotFound -*/ -type PatchEdgeRouterPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchEdgeRouterPolicyNotFound creates PatchEdgeRouterPolicyNotFound with default headers values -func NewPatchEdgeRouterPolicyNotFound() *PatchEdgeRouterPolicyNotFound { - - return &PatchEdgeRouterPolicyNotFound{} -} - -// WithPayload adds the payload to the patch edge router policy not found response -func (o *PatchEdgeRouterPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchEdgeRouterPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch edge router policy not found response -func (o *PatchEdgeRouterPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchEdgeRouterPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_urlbuilder.go deleted file mode 100644 index d99a3a847..000000000 --- a/rest_management_api_server/operations/edge_router_policy/patch_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchEdgeRouterPolicyURL generates an URL for the patch edge router policy operation -type PatchEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchEdgeRouterPolicyURL) WithBasePath(bp string) *PatchEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy.go b/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy.go deleted file mode 100644 index aa14ac30b..000000000 --- a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateEdgeRouterPolicyHandlerFunc turns a function with the right signature into a update edge router policy handler -type UpdateEdgeRouterPolicyHandlerFunc func(UpdateEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateEdgeRouterPolicyHandlerFunc) Handle(params UpdateEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateEdgeRouterPolicyHandler interface for that can handle valid update edge router policy params -type UpdateEdgeRouterPolicyHandler interface { - Handle(UpdateEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewUpdateEdgeRouterPolicy creates a new http.Handler for the update edge router policy operation -func NewUpdateEdgeRouterPolicy(ctx *middleware.Context, handler UpdateEdgeRouterPolicyHandler) *UpdateEdgeRouterPolicy { - return &UpdateEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* UpdateEdgeRouterPolicy swagger:route PUT /edge-router-policies/{id} Edge Router Policy updateEdgeRouterPolicy - -Update all fields on an edge router policy - -Update all fields on an edge router policy by id. Requires admin access. - -*/ -type UpdateEdgeRouterPolicy struct { - Context *middleware.Context - Handler UpdateEdgeRouterPolicyHandler -} - -func (o *UpdateEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_parameters.go b/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_parameters.go deleted file mode 100644 index 0921aa328..000000000 --- a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateEdgeRouterPolicyParams creates a new UpdateEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewUpdateEdgeRouterPolicyParams() UpdateEdgeRouterPolicyParams { - - return UpdateEdgeRouterPolicyParams{} -} - -// UpdateEdgeRouterPolicyParams contains all the bound params for the update edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateEdgeRouterPolicy -type UpdateEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*An edge router policy update object - Required: true - In: body - */ - Policy *rest_model.EdgeRouterPolicyUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateEdgeRouterPolicyParams() beforehand. -func (o *UpdateEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EdgeRouterPolicyUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_responses.go b/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_responses.go deleted file mode 100644 index 5292c8370..000000000 --- a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateEdgeRouterPolicyOKCode is the HTTP code returned for type UpdateEdgeRouterPolicyOK -const UpdateEdgeRouterPolicyOKCode int = 200 - -/*UpdateEdgeRouterPolicyOK The update request was successful and the resource has been altered - -swagger:response updateEdgeRouterPolicyOK -*/ -type UpdateEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterPolicyOK creates UpdateEdgeRouterPolicyOK with default headers values -func NewUpdateEdgeRouterPolicyOK() *UpdateEdgeRouterPolicyOK { - - return &UpdateEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the update edge router policy o k response -func (o *UpdateEdgeRouterPolicyOK) WithPayload(payload *rest_model.Empty) *UpdateEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router policy o k response -func (o *UpdateEdgeRouterPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateEdgeRouterPolicyBadRequestCode is the HTTP code returned for type UpdateEdgeRouterPolicyBadRequest -const UpdateEdgeRouterPolicyBadRequestCode int = 400 - -/*UpdateEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateEdgeRouterPolicyBadRequest -*/ -type UpdateEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterPolicyBadRequest creates UpdateEdgeRouterPolicyBadRequest with default headers values -func NewUpdateEdgeRouterPolicyBadRequest() *UpdateEdgeRouterPolicyBadRequest { - - return &UpdateEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the update edge router policy bad request response -func (o *UpdateEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router policy bad request response -func (o *UpdateEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type UpdateEdgeRouterPolicyUnauthorized -const UpdateEdgeRouterPolicyUnauthorizedCode int = 401 - -/*UpdateEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateEdgeRouterPolicyUnauthorized -*/ -type UpdateEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterPolicyUnauthorized creates UpdateEdgeRouterPolicyUnauthorized with default headers values -func NewUpdateEdgeRouterPolicyUnauthorized() *UpdateEdgeRouterPolicyUnauthorized { - - return &UpdateEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the update edge router policy unauthorized response -func (o *UpdateEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router policy unauthorized response -func (o *UpdateEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateEdgeRouterPolicyNotFoundCode is the HTTP code returned for type UpdateEdgeRouterPolicyNotFound -const UpdateEdgeRouterPolicyNotFoundCode int = 404 - -/*UpdateEdgeRouterPolicyNotFound The requested resource does not exist - -swagger:response updateEdgeRouterPolicyNotFound -*/ -type UpdateEdgeRouterPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateEdgeRouterPolicyNotFound creates UpdateEdgeRouterPolicyNotFound with default headers values -func NewUpdateEdgeRouterPolicyNotFound() *UpdateEdgeRouterPolicyNotFound { - - return &UpdateEdgeRouterPolicyNotFound{} -} - -// WithPayload adds the payload to the update edge router policy not found response -func (o *UpdateEdgeRouterPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateEdgeRouterPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update edge router policy not found response -func (o *UpdateEdgeRouterPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateEdgeRouterPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_urlbuilder.go deleted file mode 100644 index 7e4d8ee77..000000000 --- a/rest_management_api_server/operations/edge_router_policy/update_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateEdgeRouterPolicyURL generates an URL for the update edge router policy operation -type UpdateEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateEdgeRouterPolicyURL) WithBasePath(bp string) *UpdateEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/enrollment/create_enrollment.go b/rest_management_api_server/operations/enrollment/create_enrollment.go deleted file mode 100644 index f72f5c9c2..000000000 --- a/rest_management_api_server/operations/enrollment/create_enrollment.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateEnrollmentHandlerFunc turns a function with the right signature into a create enrollment handler -type CreateEnrollmentHandlerFunc func(CreateEnrollmentParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateEnrollmentHandlerFunc) Handle(params CreateEnrollmentParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateEnrollmentHandler interface for that can handle valid create enrollment params -type CreateEnrollmentHandler interface { - Handle(CreateEnrollmentParams, interface{}) middleware.Responder -} - -// NewCreateEnrollment creates a new http.Handler for the create enrollment operation -func NewCreateEnrollment(ctx *middleware.Context, handler CreateEnrollmentHandler) *CreateEnrollment { - return &CreateEnrollment{Context: ctx, Handler: handler} -} - -/* CreateEnrollment swagger:route POST /enrollments Enrollment createEnrollment - -Create an outstanding enrollment for an identity - -Creates a new OTT, OTTCA, or UPDB enrollment for a specific identity. If an enrollment of the same type is already outstanding the request will fail with a 409 conflict. If desired, an existing enrollment can be refreshed by `enrollments/:id/refresh` or deleted. - -*/ -type CreateEnrollment struct { - Context *middleware.Context - Handler CreateEnrollmentHandler -} - -func (o *CreateEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateEnrollmentParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/enrollment/create_enrollment_parameters.go b/rest_management_api_server/operations/enrollment/create_enrollment_parameters.go deleted file mode 100644 index 8b969cd0a..000000000 --- a/rest_management_api_server/operations/enrollment/create_enrollment_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateEnrollmentParams creates a new CreateEnrollmentParams object -// -// There are no default values defined in the spec. -func NewCreateEnrollmentParams() CreateEnrollmentParams { - - return CreateEnrollmentParams{} -} - -// CreateEnrollmentParams contains all the bound params for the create enrollment operation -// typically these are obtained from a http.Request -// -// swagger:parameters createEnrollment -type CreateEnrollmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An enrollment to create - Required: true - In: body - */ - Enrollment *rest_model.EnrollmentCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateEnrollmentParams() beforehand. -func (o *CreateEnrollmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EnrollmentCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("enrollment", "body", "")) - } else { - res = append(res, errors.NewParseError("enrollment", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Enrollment = &body - } - } - } else { - res = append(res, errors.Required("enrollment", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/enrollment/create_enrollment_responses.go b/rest_management_api_server/operations/enrollment/create_enrollment_responses.go deleted file mode 100644 index 8b16933a3..000000000 --- a/rest_management_api_server/operations/enrollment/create_enrollment_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateEnrollmentCreatedCode is the HTTP code returned for type CreateEnrollmentCreated -const CreateEnrollmentCreatedCode int = 201 - -/*CreateEnrollmentCreated The create request was successful and the resource has been added at the following location - -swagger:response createEnrollmentCreated -*/ -type CreateEnrollmentCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateEnrollmentCreated creates CreateEnrollmentCreated with default headers values -func NewCreateEnrollmentCreated() *CreateEnrollmentCreated { - - return &CreateEnrollmentCreated{} -} - -// WithPayload adds the payload to the create enrollment created response -func (o *CreateEnrollmentCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateEnrollmentCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create enrollment created response -func (o *CreateEnrollmentCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEnrollmentCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEnrollmentBadRequestCode is the HTTP code returned for type CreateEnrollmentBadRequest -const CreateEnrollmentBadRequestCode int = 400 - -/*CreateEnrollmentBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createEnrollmentBadRequest -*/ -type CreateEnrollmentBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEnrollmentBadRequest creates CreateEnrollmentBadRequest with default headers values -func NewCreateEnrollmentBadRequest() *CreateEnrollmentBadRequest { - - return &CreateEnrollmentBadRequest{} -} - -// WithPayload adds the payload to the create enrollment bad request response -func (o *CreateEnrollmentBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEnrollmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create enrollment bad request response -func (o *CreateEnrollmentBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEnrollmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEnrollmentUnauthorizedCode is the HTTP code returned for type CreateEnrollmentUnauthorized -const CreateEnrollmentUnauthorizedCode int = 401 - -/*CreateEnrollmentUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createEnrollmentUnauthorized -*/ -type CreateEnrollmentUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEnrollmentUnauthorized creates CreateEnrollmentUnauthorized with default headers values -func NewCreateEnrollmentUnauthorized() *CreateEnrollmentUnauthorized { - - return &CreateEnrollmentUnauthorized{} -} - -// WithPayload adds the payload to the create enrollment unauthorized response -func (o *CreateEnrollmentUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEnrollmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create enrollment unauthorized response -func (o *CreateEnrollmentUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEnrollmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEnrollmentConflictCode is the HTTP code returned for type CreateEnrollmentConflict -const CreateEnrollmentConflictCode int = 409 - -/*CreateEnrollmentConflict The request could not be completed due to a conflict of configuration or state - -swagger:response createEnrollmentConflict -*/ -type CreateEnrollmentConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateEnrollmentConflict creates CreateEnrollmentConflict with default headers values -func NewCreateEnrollmentConflict() *CreateEnrollmentConflict { - - return &CreateEnrollmentConflict{} -} - -// WithPayload adds the payload to the create enrollment conflict response -func (o *CreateEnrollmentConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateEnrollmentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create enrollment conflict response -func (o *CreateEnrollmentConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEnrollmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/enrollment/create_enrollment_urlbuilder.go b/rest_management_api_server/operations/enrollment/create_enrollment_urlbuilder.go deleted file mode 100644 index 591532b0a..000000000 --- a/rest_management_api_server/operations/enrollment/create_enrollment_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateEnrollmentURL generates an URL for the create enrollment operation -type CreateEnrollmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEnrollmentURL) WithBasePath(bp string) *CreateEnrollmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEnrollmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateEnrollmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enrollments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateEnrollmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateEnrollmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateEnrollmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateEnrollmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateEnrollmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateEnrollmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/enrollment/delete_enrollment.go b/rest_management_api_server/operations/enrollment/delete_enrollment.go deleted file mode 100644 index daed26b1a..000000000 --- a/rest_management_api_server/operations/enrollment/delete_enrollment.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteEnrollmentHandlerFunc turns a function with the right signature into a delete enrollment handler -type DeleteEnrollmentHandlerFunc func(DeleteEnrollmentParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteEnrollmentHandlerFunc) Handle(params DeleteEnrollmentParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteEnrollmentHandler interface for that can handle valid delete enrollment params -type DeleteEnrollmentHandler interface { - Handle(DeleteEnrollmentParams, interface{}) middleware.Responder -} - -// NewDeleteEnrollment creates a new http.Handler for the delete enrollment operation -func NewDeleteEnrollment(ctx *middleware.Context, handler DeleteEnrollmentHandler) *DeleteEnrollment { - return &DeleteEnrollment{Context: ctx, Handler: handler} -} - -/* DeleteEnrollment swagger:route DELETE /enrollments/{id} Enrollment deleteEnrollment - -Delete an outstanding enrollment - -Delete an outstanding enrollment by id. Requires admin access. - -*/ -type DeleteEnrollment struct { - Context *middleware.Context - Handler DeleteEnrollmentHandler -} - -func (o *DeleteEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteEnrollmentParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/enrollment/delete_enrollment_parameters.go b/rest_management_api_server/operations/enrollment/delete_enrollment_parameters.go deleted file mode 100644 index bb7277dad..000000000 --- a/rest_management_api_server/operations/enrollment/delete_enrollment_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteEnrollmentParams creates a new DeleteEnrollmentParams object -// -// There are no default values defined in the spec. -func NewDeleteEnrollmentParams() DeleteEnrollmentParams { - - return DeleteEnrollmentParams{} -} - -// DeleteEnrollmentParams contains all the bound params for the delete enrollment operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteEnrollment -type DeleteEnrollmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteEnrollmentParams() beforehand. -func (o *DeleteEnrollmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteEnrollmentParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/enrollment/delete_enrollment_responses.go b/rest_management_api_server/operations/enrollment/delete_enrollment_responses.go deleted file mode 100644 index 3772edfb9..000000000 --- a/rest_management_api_server/operations/enrollment/delete_enrollment_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteEnrollmentOKCode is the HTTP code returned for type DeleteEnrollmentOK -const DeleteEnrollmentOKCode int = 200 - -/*DeleteEnrollmentOK The delete request was successful and the resource has been removed - -swagger:response deleteEnrollmentOK -*/ -type DeleteEnrollmentOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteEnrollmentOK creates DeleteEnrollmentOK with default headers values -func NewDeleteEnrollmentOK() *DeleteEnrollmentOK { - - return &DeleteEnrollmentOK{} -} - -// WithPayload adds the payload to the delete enrollment o k response -func (o *DeleteEnrollmentOK) WithPayload(payload *rest_model.Empty) *DeleteEnrollmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete enrollment o k response -func (o *DeleteEnrollmentOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEnrollmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEnrollmentBadRequestCode is the HTTP code returned for type DeleteEnrollmentBadRequest -const DeleteEnrollmentBadRequestCode int = 400 - -/*DeleteEnrollmentBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteEnrollmentBadRequest -*/ -type DeleteEnrollmentBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEnrollmentBadRequest creates DeleteEnrollmentBadRequest with default headers values -func NewDeleteEnrollmentBadRequest() *DeleteEnrollmentBadRequest { - - return &DeleteEnrollmentBadRequest{} -} - -// WithPayload adds the payload to the delete enrollment bad request response -func (o *DeleteEnrollmentBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEnrollmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete enrollment bad request response -func (o *DeleteEnrollmentBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEnrollmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEnrollmentUnauthorizedCode is the HTTP code returned for type DeleteEnrollmentUnauthorized -const DeleteEnrollmentUnauthorizedCode int = 401 - -/*DeleteEnrollmentUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteEnrollmentUnauthorized -*/ -type DeleteEnrollmentUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteEnrollmentUnauthorized creates DeleteEnrollmentUnauthorized with default headers values -func NewDeleteEnrollmentUnauthorized() *DeleteEnrollmentUnauthorized { - - return &DeleteEnrollmentUnauthorized{} -} - -// WithPayload adds the payload to the delete enrollment unauthorized response -func (o *DeleteEnrollmentUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteEnrollmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete enrollment unauthorized response -func (o *DeleteEnrollmentUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEnrollmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/enrollment/delete_enrollment_urlbuilder.go b/rest_management_api_server/operations/enrollment/delete_enrollment_urlbuilder.go deleted file mode 100644 index 925b030b4..000000000 --- a/rest_management_api_server/operations/enrollment/delete_enrollment_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteEnrollmentURL generates an URL for the delete enrollment operation -type DeleteEnrollmentURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEnrollmentURL) WithBasePath(bp string) *DeleteEnrollmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEnrollmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteEnrollmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enrollments/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteEnrollmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteEnrollmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteEnrollmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteEnrollmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteEnrollmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteEnrollmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteEnrollmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/enrollment/detail_enrollment.go b/rest_management_api_server/operations/enrollment/detail_enrollment.go deleted file mode 100644 index 1e0211839..000000000 --- a/rest_management_api_server/operations/enrollment/detail_enrollment.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailEnrollmentHandlerFunc turns a function with the right signature into a detail enrollment handler -type DetailEnrollmentHandlerFunc func(DetailEnrollmentParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailEnrollmentHandlerFunc) Handle(params DetailEnrollmentParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailEnrollmentHandler interface for that can handle valid detail enrollment params -type DetailEnrollmentHandler interface { - Handle(DetailEnrollmentParams, interface{}) middleware.Responder -} - -// NewDetailEnrollment creates a new http.Handler for the detail enrollment operation -func NewDetailEnrollment(ctx *middleware.Context, handler DetailEnrollmentHandler) *DetailEnrollment { - return &DetailEnrollment{Context: ctx, Handler: handler} -} - -/* DetailEnrollment swagger:route GET /enrollments/{id} Enrollment detailEnrollment - -Retrieves an outstanding enrollment - -Retrieves a single outstanding enrollment by id. Requires admin access. - -*/ -type DetailEnrollment struct { - Context *middleware.Context - Handler DetailEnrollmentHandler -} - -func (o *DetailEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailEnrollmentParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/enrollment/detail_enrollment_parameters.go b/rest_management_api_server/operations/enrollment/detail_enrollment_parameters.go deleted file mode 100644 index 61a239c78..000000000 --- a/rest_management_api_server/operations/enrollment/detail_enrollment_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailEnrollmentParams creates a new DetailEnrollmentParams object -// -// There are no default values defined in the spec. -func NewDetailEnrollmentParams() DetailEnrollmentParams { - - return DetailEnrollmentParams{} -} - -// DetailEnrollmentParams contains all the bound params for the detail enrollment operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailEnrollment -type DetailEnrollmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailEnrollmentParams() beforehand. -func (o *DetailEnrollmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailEnrollmentParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/enrollment/detail_enrollment_responses.go b/rest_management_api_server/operations/enrollment/detail_enrollment_responses.go deleted file mode 100644 index c6cde6679..000000000 --- a/rest_management_api_server/operations/enrollment/detail_enrollment_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailEnrollmentOKCode is the HTTP code returned for type DetailEnrollmentOK -const DetailEnrollmentOKCode int = 200 - -/*DetailEnrollmentOK A singular enrollment resource - -swagger:response detailEnrollmentOK -*/ -type DetailEnrollmentOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailEnrollmentEnvelope `json:"body,omitempty"` -} - -// NewDetailEnrollmentOK creates DetailEnrollmentOK with default headers values -func NewDetailEnrollmentOK() *DetailEnrollmentOK { - - return &DetailEnrollmentOK{} -} - -// WithPayload adds the payload to the detail enrollment o k response -func (o *DetailEnrollmentOK) WithPayload(payload *rest_model.DetailEnrollmentEnvelope) *DetailEnrollmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail enrollment o k response -func (o *DetailEnrollmentOK) SetPayload(payload *rest_model.DetailEnrollmentEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEnrollmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailEnrollmentUnauthorizedCode is the HTTP code returned for type DetailEnrollmentUnauthorized -const DetailEnrollmentUnauthorizedCode int = 401 - -/*DetailEnrollmentUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailEnrollmentUnauthorized -*/ -type DetailEnrollmentUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailEnrollmentUnauthorized creates DetailEnrollmentUnauthorized with default headers values -func NewDetailEnrollmentUnauthorized() *DetailEnrollmentUnauthorized { - - return &DetailEnrollmentUnauthorized{} -} - -// WithPayload adds the payload to the detail enrollment unauthorized response -func (o *DetailEnrollmentUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailEnrollmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail enrollment unauthorized response -func (o *DetailEnrollmentUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEnrollmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailEnrollmentNotFoundCode is the HTTP code returned for type DetailEnrollmentNotFound -const DetailEnrollmentNotFoundCode int = 404 - -/*DetailEnrollmentNotFound The requested resource does not exist - -swagger:response detailEnrollmentNotFound -*/ -type DetailEnrollmentNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailEnrollmentNotFound creates DetailEnrollmentNotFound with default headers values -func NewDetailEnrollmentNotFound() *DetailEnrollmentNotFound { - - return &DetailEnrollmentNotFound{} -} - -// WithPayload adds the payload to the detail enrollment not found response -func (o *DetailEnrollmentNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailEnrollmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail enrollment not found response -func (o *DetailEnrollmentNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailEnrollmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/enrollment/detail_enrollment_urlbuilder.go b/rest_management_api_server/operations/enrollment/detail_enrollment_urlbuilder.go deleted file mode 100644 index b68ce2f72..000000000 --- a/rest_management_api_server/operations/enrollment/detail_enrollment_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailEnrollmentURL generates an URL for the detail enrollment operation -type DetailEnrollmentURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailEnrollmentURL) WithBasePath(bp string) *DetailEnrollmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailEnrollmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailEnrollmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enrollments/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailEnrollmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailEnrollmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailEnrollmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailEnrollmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailEnrollmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailEnrollmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailEnrollmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/enrollment/list_enrollments.go b/rest_management_api_server/operations/enrollment/list_enrollments.go deleted file mode 100644 index c5981fe78..000000000 --- a/rest_management_api_server/operations/enrollment/list_enrollments.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEnrollmentsHandlerFunc turns a function with the right signature into a list enrollments handler -type ListEnrollmentsHandlerFunc func(ListEnrollmentsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEnrollmentsHandlerFunc) Handle(params ListEnrollmentsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEnrollmentsHandler interface for that can handle valid list enrollments params -type ListEnrollmentsHandler interface { - Handle(ListEnrollmentsParams, interface{}) middleware.Responder -} - -// NewListEnrollments creates a new http.Handler for the list enrollments operation -func NewListEnrollments(ctx *middleware.Context, handler ListEnrollmentsHandler) *ListEnrollments { - return &ListEnrollments{Context: ctx, Handler: handler} -} - -/* ListEnrollments swagger:route GET /enrollments Enrollment listEnrollments - -List outstanding enrollments - -Retrieves a list of outstanding enrollments; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEnrollments struct { - Context *middleware.Context - Handler ListEnrollmentsHandler -} - -func (o *ListEnrollments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEnrollmentsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/enrollment/list_enrollments_parameters.go b/rest_management_api_server/operations/enrollment/list_enrollments_parameters.go deleted file mode 100644 index a73e0b0ed..000000000 --- a/rest_management_api_server/operations/enrollment/list_enrollments_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEnrollmentsParams creates a new ListEnrollmentsParams object -// -// There are no default values defined in the spec. -func NewListEnrollmentsParams() ListEnrollmentsParams { - - return ListEnrollmentsParams{} -} - -// ListEnrollmentsParams contains all the bound params for the list enrollments operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEnrollments -type ListEnrollmentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEnrollmentsParams() beforehand. -func (o *ListEnrollmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListEnrollmentsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListEnrollmentsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListEnrollmentsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/enrollment/list_enrollments_responses.go b/rest_management_api_server/operations/enrollment/list_enrollments_responses.go deleted file mode 100644 index 9527248d5..000000000 --- a/rest_management_api_server/operations/enrollment/list_enrollments_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEnrollmentsOKCode is the HTTP code returned for type ListEnrollmentsOK -const ListEnrollmentsOKCode int = 200 - -/*ListEnrollmentsOK A list of enrollments - -swagger:response listEnrollmentsOK -*/ -type ListEnrollmentsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEnrollmentsEnvelope `json:"body,omitempty"` -} - -// NewListEnrollmentsOK creates ListEnrollmentsOK with default headers values -func NewListEnrollmentsOK() *ListEnrollmentsOK { - - return &ListEnrollmentsOK{} -} - -// WithPayload adds the payload to the list enrollments o k response -func (o *ListEnrollmentsOK) WithPayload(payload *rest_model.ListEnrollmentsEnvelope) *ListEnrollmentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list enrollments o k response -func (o *ListEnrollmentsOK) SetPayload(payload *rest_model.ListEnrollmentsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEnrollmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEnrollmentsBadRequestCode is the HTTP code returned for type ListEnrollmentsBadRequest -const ListEnrollmentsBadRequestCode int = 400 - -/*ListEnrollmentsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listEnrollmentsBadRequest -*/ -type ListEnrollmentsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEnrollmentsBadRequest creates ListEnrollmentsBadRequest with default headers values -func NewListEnrollmentsBadRequest() *ListEnrollmentsBadRequest { - - return &ListEnrollmentsBadRequest{} -} - -// WithPayload adds the payload to the list enrollments bad request response -func (o *ListEnrollmentsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEnrollmentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list enrollments bad request response -func (o *ListEnrollmentsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEnrollmentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEnrollmentsUnauthorizedCode is the HTTP code returned for type ListEnrollmentsUnauthorized -const ListEnrollmentsUnauthorizedCode int = 401 - -/*ListEnrollmentsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEnrollmentsUnauthorized -*/ -type ListEnrollmentsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEnrollmentsUnauthorized creates ListEnrollmentsUnauthorized with default headers values -func NewListEnrollmentsUnauthorized() *ListEnrollmentsUnauthorized { - - return &ListEnrollmentsUnauthorized{} -} - -// WithPayload adds the payload to the list enrollments unauthorized response -func (o *ListEnrollmentsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEnrollmentsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list enrollments unauthorized response -func (o *ListEnrollmentsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEnrollmentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/enrollment/list_enrollments_urlbuilder.go b/rest_management_api_server/operations/enrollment/list_enrollments_urlbuilder.go deleted file mode 100644 index ac04550c6..000000000 --- a/rest_management_api_server/operations/enrollment/list_enrollments_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListEnrollmentsURL generates an URL for the list enrollments operation -type ListEnrollmentsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEnrollmentsURL) WithBasePath(bp string) *ListEnrollmentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEnrollmentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEnrollmentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enrollments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEnrollmentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEnrollmentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEnrollmentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEnrollmentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEnrollmentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEnrollmentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/enrollment/refresh_enrollment.go b/rest_management_api_server/operations/enrollment/refresh_enrollment.go deleted file mode 100644 index 1df8e91e3..000000000 --- a/rest_management_api_server/operations/enrollment/refresh_enrollment.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RefreshEnrollmentHandlerFunc turns a function with the right signature into a refresh enrollment handler -type RefreshEnrollmentHandlerFunc func(RefreshEnrollmentParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn RefreshEnrollmentHandlerFunc) Handle(params RefreshEnrollmentParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// RefreshEnrollmentHandler interface for that can handle valid refresh enrollment params -type RefreshEnrollmentHandler interface { - Handle(RefreshEnrollmentParams, interface{}) middleware.Responder -} - -// NewRefreshEnrollment creates a new http.Handler for the refresh enrollment operation -func NewRefreshEnrollment(ctx *middleware.Context, handler RefreshEnrollmentHandler) *RefreshEnrollment { - return &RefreshEnrollment{Context: ctx, Handler: handler} -} - -/* RefreshEnrollment swagger:route POST /enrollments/{id}/refresh Enrollment refreshEnrollment - -Refreshes an enrollment record's expiration window - -For expired or unexpired enrollments, reset the expiration window. A new JWT will be generated and must be used for the enrollment. - -*/ -type RefreshEnrollment struct { - Context *middleware.Context - Handler RefreshEnrollmentHandler -} - -func (o *RefreshEnrollment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRefreshEnrollmentParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/enrollment/refresh_enrollment_parameters.go b/rest_management_api_server/operations/enrollment/refresh_enrollment_parameters.go deleted file mode 100644 index 54c162382..000000000 --- a/rest_management_api_server/operations/enrollment/refresh_enrollment_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewRefreshEnrollmentParams creates a new RefreshEnrollmentParams object -// -// There are no default values defined in the spec. -func NewRefreshEnrollmentParams() RefreshEnrollmentParams { - - return RefreshEnrollmentParams{} -} - -// RefreshEnrollmentParams contains all the bound params for the refresh enrollment operation -// typically these are obtained from a http.Request -// -// swagger:parameters refreshEnrollment -type RefreshEnrollmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*An enrollment refresh request - Required: true - In: body - */ - Refresh *rest_model.EnrollmentRefresh -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRefreshEnrollmentParams() beforehand. -func (o *RefreshEnrollmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.EnrollmentRefresh - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("refresh", "body", "")) - } else { - res = append(res, errors.NewParseError("refresh", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Refresh = &body - } - } - } else { - res = append(res, errors.Required("refresh", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *RefreshEnrollmentParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/enrollment/refresh_enrollment_responses.go b/rest_management_api_server/operations/enrollment/refresh_enrollment_responses.go deleted file mode 100644 index 820df3b77..000000000 --- a/rest_management_api_server/operations/enrollment/refresh_enrollment_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// RefreshEnrollmentOKCode is the HTTP code returned for type RefreshEnrollmentOK -const RefreshEnrollmentOKCode int = 200 - -/*RefreshEnrollmentOK The create request was successful and the resource has been added at the following location - -swagger:response refreshEnrollmentOK -*/ -type RefreshEnrollmentOK struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewRefreshEnrollmentOK creates RefreshEnrollmentOK with default headers values -func NewRefreshEnrollmentOK() *RefreshEnrollmentOK { - - return &RefreshEnrollmentOK{} -} - -// WithPayload adds the payload to the refresh enrollment o k response -func (o *RefreshEnrollmentOK) WithPayload(payload *rest_model.CreateEnvelope) *RefreshEnrollmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the refresh enrollment o k response -func (o *RefreshEnrollmentOK) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RefreshEnrollmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RefreshEnrollmentBadRequestCode is the HTTP code returned for type RefreshEnrollmentBadRequest -const RefreshEnrollmentBadRequestCode int = 400 - -/*RefreshEnrollmentBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response refreshEnrollmentBadRequest -*/ -type RefreshEnrollmentBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewRefreshEnrollmentBadRequest creates RefreshEnrollmentBadRequest with default headers values -func NewRefreshEnrollmentBadRequest() *RefreshEnrollmentBadRequest { - - return &RefreshEnrollmentBadRequest{} -} - -// WithPayload adds the payload to the refresh enrollment bad request response -func (o *RefreshEnrollmentBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *RefreshEnrollmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the refresh enrollment bad request response -func (o *RefreshEnrollmentBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RefreshEnrollmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RefreshEnrollmentUnauthorizedCode is the HTTP code returned for type RefreshEnrollmentUnauthorized -const RefreshEnrollmentUnauthorizedCode int = 401 - -/*RefreshEnrollmentUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response refreshEnrollmentUnauthorized -*/ -type RefreshEnrollmentUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewRefreshEnrollmentUnauthorized creates RefreshEnrollmentUnauthorized with default headers values -func NewRefreshEnrollmentUnauthorized() *RefreshEnrollmentUnauthorized { - - return &RefreshEnrollmentUnauthorized{} -} - -// WithPayload adds the payload to the refresh enrollment unauthorized response -func (o *RefreshEnrollmentUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *RefreshEnrollmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the refresh enrollment unauthorized response -func (o *RefreshEnrollmentUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RefreshEnrollmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/enrollment/refresh_enrollment_urlbuilder.go b/rest_management_api_server/operations/enrollment/refresh_enrollment_urlbuilder.go deleted file mode 100644 index 1b4c8785f..000000000 --- a/rest_management_api_server/operations/enrollment/refresh_enrollment_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package enrollment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// RefreshEnrollmentURL generates an URL for the refresh enrollment operation -type RefreshEnrollmentURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RefreshEnrollmentURL) WithBasePath(bp string) *RefreshEnrollmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RefreshEnrollmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RefreshEnrollmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/enrollments/{id}/refresh" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on RefreshEnrollmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RefreshEnrollmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RefreshEnrollmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RefreshEnrollmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RefreshEnrollmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RefreshEnrollmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RefreshEnrollmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer.go b/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer.go deleted file mode 100644 index 93a1c5c04..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateExternalJWTSignerHandlerFunc turns a function with the right signature into a create external Jwt signer handler -type CreateExternalJWTSignerHandlerFunc func(CreateExternalJWTSignerParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateExternalJWTSignerHandlerFunc) Handle(params CreateExternalJWTSignerParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateExternalJWTSignerHandler interface for that can handle valid create external Jwt signer params -type CreateExternalJWTSignerHandler interface { - Handle(CreateExternalJWTSignerParams, interface{}) middleware.Responder -} - -// NewCreateExternalJWTSigner creates a new http.Handler for the create external Jwt signer operation -func NewCreateExternalJWTSigner(ctx *middleware.Context, handler CreateExternalJWTSignerHandler) *CreateExternalJWTSigner { - return &CreateExternalJWTSigner{Context: ctx, Handler: handler} -} - -/* CreateExternalJWTSigner swagger:route POST /external-jwt-signers External JWT Signer createExternalJwtSigner - -Creates an External JWT Signer - -Creates an External JWT Signer. Requires admin access. - -*/ -type CreateExternalJWTSigner struct { - Context *middleware.Context - Handler CreateExternalJWTSignerHandler -} - -func (o *CreateExternalJWTSigner) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateExternalJWTSignerParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_parameters.go b/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_parameters.go deleted file mode 100644 index ca246900e..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateExternalJWTSignerParams creates a new CreateExternalJWTSignerParams object -// -// There are no default values defined in the spec. -func NewCreateExternalJWTSignerParams() CreateExternalJWTSignerParams { - - return CreateExternalJWTSignerParams{} -} - -// CreateExternalJWTSignerParams contains all the bound params for the create external Jwt signer operation -// typically these are obtained from a http.Request -// -// swagger:parameters createExternalJwtSigner -type CreateExternalJWTSignerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An External JWT Signer to create - Required: true - In: body - */ - ExternalJWTSigner *rest_model.ExternalJWTSignerCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateExternalJWTSignerParams() beforehand. -func (o *CreateExternalJWTSignerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ExternalJWTSignerCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("externalJwtSigner", "body", "")) - } else { - res = append(res, errors.NewParseError("externalJwtSigner", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ExternalJWTSigner = &body - } - } - } else { - res = append(res, errors.Required("externalJwtSigner", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_responses.go b/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_responses.go deleted file mode 100644 index 69405281e..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateExternalJWTSignerCreatedCode is the HTTP code returned for type CreateExternalJWTSignerCreated -const CreateExternalJWTSignerCreatedCode int = 201 - -/*CreateExternalJWTSignerCreated The create request was successful and the resource has been added at the following location - -swagger:response createExternalJwtSignerCreated -*/ -type CreateExternalJWTSignerCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateExternalJWTSignerCreated creates CreateExternalJWTSignerCreated with default headers values -func NewCreateExternalJWTSignerCreated() *CreateExternalJWTSignerCreated { - - return &CreateExternalJWTSignerCreated{} -} - -// WithPayload adds the payload to the create external Jwt signer created response -func (o *CreateExternalJWTSignerCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateExternalJWTSignerCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create external Jwt signer created response -func (o *CreateExternalJWTSignerCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExternalJWTSignerCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExternalJWTSignerBadRequestCode is the HTTP code returned for type CreateExternalJWTSignerBadRequest -const CreateExternalJWTSignerBadRequestCode int = 400 - -/*CreateExternalJWTSignerBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createExternalJwtSignerBadRequest -*/ -type CreateExternalJWTSignerBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateExternalJWTSignerBadRequest creates CreateExternalJWTSignerBadRequest with default headers values -func NewCreateExternalJWTSignerBadRequest() *CreateExternalJWTSignerBadRequest { - - return &CreateExternalJWTSignerBadRequest{} -} - -// WithPayload adds the payload to the create external Jwt signer bad request response -func (o *CreateExternalJWTSignerBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateExternalJWTSignerBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create external Jwt signer bad request response -func (o *CreateExternalJWTSignerBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExternalJWTSignerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExternalJWTSignerUnauthorizedCode is the HTTP code returned for type CreateExternalJWTSignerUnauthorized -const CreateExternalJWTSignerUnauthorizedCode int = 401 - -/*CreateExternalJWTSignerUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createExternalJwtSignerUnauthorized -*/ -type CreateExternalJWTSignerUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateExternalJWTSignerUnauthorized creates CreateExternalJWTSignerUnauthorized with default headers values -func NewCreateExternalJWTSignerUnauthorized() *CreateExternalJWTSignerUnauthorized { - - return &CreateExternalJWTSignerUnauthorized{} -} - -// WithPayload adds the payload to the create external Jwt signer unauthorized response -func (o *CreateExternalJWTSignerUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateExternalJWTSignerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create external Jwt signer unauthorized response -func (o *CreateExternalJWTSignerUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExternalJWTSignerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_urlbuilder.go b/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_urlbuilder.go deleted file mode 100644 index e2a3e6cdd..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/create_external_jwt_signer_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateExternalJWTSignerURL generates an URL for the create external Jwt signer operation -type CreateExternalJWTSignerURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateExternalJWTSignerURL) WithBasePath(bp string) *CreateExternalJWTSignerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateExternalJWTSignerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateExternalJWTSignerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateExternalJWTSignerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateExternalJWTSignerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateExternalJWTSignerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateExternalJWTSignerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateExternalJWTSignerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateExternalJWTSignerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer.go b/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer.go deleted file mode 100644 index b81878b0f..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteExternalJWTSignerHandlerFunc turns a function with the right signature into a delete external Jwt signer handler -type DeleteExternalJWTSignerHandlerFunc func(DeleteExternalJWTSignerParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteExternalJWTSignerHandlerFunc) Handle(params DeleteExternalJWTSignerParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteExternalJWTSignerHandler interface for that can handle valid delete external Jwt signer params -type DeleteExternalJWTSignerHandler interface { - Handle(DeleteExternalJWTSignerParams, interface{}) middleware.Responder -} - -// NewDeleteExternalJWTSigner creates a new http.Handler for the delete external Jwt signer operation -func NewDeleteExternalJWTSigner(ctx *middleware.Context, handler DeleteExternalJWTSignerHandler) *DeleteExternalJWTSigner { - return &DeleteExternalJWTSigner{Context: ctx, Handler: handler} -} - -/* DeleteExternalJWTSigner swagger:route DELETE /external-jwt-signers/{id} External JWT Signer deleteExternalJwtSigner - -Delete an External JWT Signer - -Delete an External JWT Signer by id. Requires admin access. - - -*/ -type DeleteExternalJWTSigner struct { - Context *middleware.Context - Handler DeleteExternalJWTSignerHandler -} - -func (o *DeleteExternalJWTSigner) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteExternalJWTSignerParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_parameters.go b/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_parameters.go deleted file mode 100644 index b05cf783a..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteExternalJWTSignerParams creates a new DeleteExternalJWTSignerParams object -// -// There are no default values defined in the spec. -func NewDeleteExternalJWTSignerParams() DeleteExternalJWTSignerParams { - - return DeleteExternalJWTSignerParams{} -} - -// DeleteExternalJWTSignerParams contains all the bound params for the delete external Jwt signer operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteExternalJwtSigner -type DeleteExternalJWTSignerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteExternalJWTSignerParams() beforehand. -func (o *DeleteExternalJWTSignerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteExternalJWTSignerParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_responses.go b/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_responses.go deleted file mode 100644 index eb50b8b82..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteExternalJWTSignerOKCode is the HTTP code returned for type DeleteExternalJWTSignerOK -const DeleteExternalJWTSignerOKCode int = 200 - -/*DeleteExternalJWTSignerOK The delete request was successful and the resource has been removed - -swagger:response deleteExternalJwtSignerOK -*/ -type DeleteExternalJWTSignerOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteExternalJWTSignerOK creates DeleteExternalJWTSignerOK with default headers values -func NewDeleteExternalJWTSignerOK() *DeleteExternalJWTSignerOK { - - return &DeleteExternalJWTSignerOK{} -} - -// WithPayload adds the payload to the delete external Jwt signer o k response -func (o *DeleteExternalJWTSignerOK) WithPayload(payload *rest_model.Empty) *DeleteExternalJWTSignerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete external Jwt signer o k response -func (o *DeleteExternalJWTSignerOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteExternalJWTSignerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteExternalJWTSignerBadRequestCode is the HTTP code returned for type DeleteExternalJWTSignerBadRequest -const DeleteExternalJWTSignerBadRequestCode int = 400 - -/*DeleteExternalJWTSignerBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteExternalJwtSignerBadRequest -*/ -type DeleteExternalJWTSignerBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteExternalJWTSignerBadRequest creates DeleteExternalJWTSignerBadRequest with default headers values -func NewDeleteExternalJWTSignerBadRequest() *DeleteExternalJWTSignerBadRequest { - - return &DeleteExternalJWTSignerBadRequest{} -} - -// WithPayload adds the payload to the delete external Jwt signer bad request response -func (o *DeleteExternalJWTSignerBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteExternalJWTSignerBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete external Jwt signer bad request response -func (o *DeleteExternalJWTSignerBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteExternalJWTSignerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteExternalJWTSignerUnauthorizedCode is the HTTP code returned for type DeleteExternalJWTSignerUnauthorized -const DeleteExternalJWTSignerUnauthorizedCode int = 401 - -/*DeleteExternalJWTSignerUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteExternalJwtSignerUnauthorized -*/ -type DeleteExternalJWTSignerUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteExternalJWTSignerUnauthorized creates DeleteExternalJWTSignerUnauthorized with default headers values -func NewDeleteExternalJWTSignerUnauthorized() *DeleteExternalJWTSignerUnauthorized { - - return &DeleteExternalJWTSignerUnauthorized{} -} - -// WithPayload adds the payload to the delete external Jwt signer unauthorized response -func (o *DeleteExternalJWTSignerUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteExternalJWTSignerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete external Jwt signer unauthorized response -func (o *DeleteExternalJWTSignerUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteExternalJWTSignerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_urlbuilder.go b/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_urlbuilder.go deleted file mode 100644 index b9b0dcbbb..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/delete_external_jwt_signer_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteExternalJWTSignerURL generates an URL for the delete external Jwt signer operation -type DeleteExternalJWTSignerURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteExternalJWTSignerURL) WithBasePath(bp string) *DeleteExternalJWTSignerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteExternalJWTSignerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteExternalJWTSignerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteExternalJWTSignerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteExternalJWTSignerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteExternalJWTSignerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteExternalJWTSignerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteExternalJWTSignerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteExternalJWTSignerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteExternalJWTSignerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer.go b/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer.go deleted file mode 100644 index 51df1aa85..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailExternalJWTSignerHandlerFunc turns a function with the right signature into a detail external Jwt signer handler -type DetailExternalJWTSignerHandlerFunc func(DetailExternalJWTSignerParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailExternalJWTSignerHandlerFunc) Handle(params DetailExternalJWTSignerParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailExternalJWTSignerHandler interface for that can handle valid detail external Jwt signer params -type DetailExternalJWTSignerHandler interface { - Handle(DetailExternalJWTSignerParams, interface{}) middleware.Responder -} - -// NewDetailExternalJWTSigner creates a new http.Handler for the detail external Jwt signer operation -func NewDetailExternalJWTSigner(ctx *middleware.Context, handler DetailExternalJWTSignerHandler) *DetailExternalJWTSigner { - return &DetailExternalJWTSigner{Context: ctx, Handler: handler} -} - -/* DetailExternalJWTSigner swagger:route GET /external-jwt-signers/{id} External JWT Signer detailExternalJwtSigner - -Retrieves a single External JWT Signer - -Retrieves a single External JWT Signer by id. Requires admin access. - -*/ -type DetailExternalJWTSigner struct { - Context *middleware.Context - Handler DetailExternalJWTSignerHandler -} - -func (o *DetailExternalJWTSigner) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailExternalJWTSignerParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_parameters.go b/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_parameters.go deleted file mode 100644 index 5572a751d..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailExternalJWTSignerParams creates a new DetailExternalJWTSignerParams object -// -// There are no default values defined in the spec. -func NewDetailExternalJWTSignerParams() DetailExternalJWTSignerParams { - - return DetailExternalJWTSignerParams{} -} - -// DetailExternalJWTSignerParams contains all the bound params for the detail external Jwt signer operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailExternalJwtSigner -type DetailExternalJWTSignerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailExternalJWTSignerParams() beforehand. -func (o *DetailExternalJWTSignerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailExternalJWTSignerParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_responses.go b/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_responses.go deleted file mode 100644 index 634cddbfa..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailExternalJWTSignerOKCode is the HTTP code returned for type DetailExternalJWTSignerOK -const DetailExternalJWTSignerOKCode int = 200 - -/*DetailExternalJWTSignerOK A singular External JWT Signer resource - -swagger:response detailExternalJwtSignerOK -*/ -type DetailExternalJWTSignerOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailExternalJWTSignerEnvelope `json:"body,omitempty"` -} - -// NewDetailExternalJWTSignerOK creates DetailExternalJWTSignerOK with default headers values -func NewDetailExternalJWTSignerOK() *DetailExternalJWTSignerOK { - - return &DetailExternalJWTSignerOK{} -} - -// WithPayload adds the payload to the detail external Jwt signer o k response -func (o *DetailExternalJWTSignerOK) WithPayload(payload *rest_model.DetailExternalJWTSignerEnvelope) *DetailExternalJWTSignerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail external Jwt signer o k response -func (o *DetailExternalJWTSignerOK) SetPayload(payload *rest_model.DetailExternalJWTSignerEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailExternalJWTSignerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailExternalJWTSignerUnauthorizedCode is the HTTP code returned for type DetailExternalJWTSignerUnauthorized -const DetailExternalJWTSignerUnauthorizedCode int = 401 - -/*DetailExternalJWTSignerUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailExternalJwtSignerUnauthorized -*/ -type DetailExternalJWTSignerUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailExternalJWTSignerUnauthorized creates DetailExternalJWTSignerUnauthorized with default headers values -func NewDetailExternalJWTSignerUnauthorized() *DetailExternalJWTSignerUnauthorized { - - return &DetailExternalJWTSignerUnauthorized{} -} - -// WithPayload adds the payload to the detail external Jwt signer unauthorized response -func (o *DetailExternalJWTSignerUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailExternalJWTSignerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail external Jwt signer unauthorized response -func (o *DetailExternalJWTSignerUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailExternalJWTSignerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailExternalJWTSignerNotFoundCode is the HTTP code returned for type DetailExternalJWTSignerNotFound -const DetailExternalJWTSignerNotFoundCode int = 404 - -/*DetailExternalJWTSignerNotFound The requested resource does not exist - -swagger:response detailExternalJwtSignerNotFound -*/ -type DetailExternalJWTSignerNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailExternalJWTSignerNotFound creates DetailExternalJWTSignerNotFound with default headers values -func NewDetailExternalJWTSignerNotFound() *DetailExternalJWTSignerNotFound { - - return &DetailExternalJWTSignerNotFound{} -} - -// WithPayload adds the payload to the detail external Jwt signer not found response -func (o *DetailExternalJWTSignerNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailExternalJWTSignerNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail external Jwt signer not found response -func (o *DetailExternalJWTSignerNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailExternalJWTSignerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_urlbuilder.go b/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_urlbuilder.go deleted file mode 100644 index b4bf45c4b..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/detail_external_jwt_signer_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailExternalJWTSignerURL generates an URL for the detail external Jwt signer operation -type DetailExternalJWTSignerURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailExternalJWTSignerURL) WithBasePath(bp string) *DetailExternalJWTSignerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailExternalJWTSignerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailExternalJWTSignerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailExternalJWTSignerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailExternalJWTSignerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailExternalJWTSignerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailExternalJWTSignerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailExternalJWTSignerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailExternalJWTSignerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailExternalJWTSignerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers.go b/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers.go deleted file mode 100644 index fc1383cf9..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListExternalJWTSignersHandlerFunc turns a function with the right signature into a list external Jwt signers handler -type ListExternalJWTSignersHandlerFunc func(ListExternalJWTSignersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListExternalJWTSignersHandlerFunc) Handle(params ListExternalJWTSignersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListExternalJWTSignersHandler interface for that can handle valid list external Jwt signers params -type ListExternalJWTSignersHandler interface { - Handle(ListExternalJWTSignersParams, interface{}) middleware.Responder -} - -// NewListExternalJWTSigners creates a new http.Handler for the list external Jwt signers operation -func NewListExternalJWTSigners(ctx *middleware.Context, handler ListExternalJWTSignersHandler) *ListExternalJWTSigners { - return &ListExternalJWTSigners{Context: ctx, Handler: handler} -} - -/* ListExternalJWTSigners swagger:route GET /external-jwt-signers External JWT Signer listExternalJwtSigners - -List External JWT Signers - -Retrieves a list of external JWT signers for authentication - -*/ -type ListExternalJWTSigners struct { - Context *middleware.Context - Handler ListExternalJWTSignersHandler -} - -func (o *ListExternalJWTSigners) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListExternalJWTSignersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_parameters.go b/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_parameters.go deleted file mode 100644 index 3003c947f..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListExternalJWTSignersParams creates a new ListExternalJWTSignersParams object -// -// There are no default values defined in the spec. -func NewListExternalJWTSignersParams() ListExternalJWTSignersParams { - - return ListExternalJWTSignersParams{} -} - -// ListExternalJWTSignersParams contains all the bound params for the list external Jwt signers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listExternalJwtSigners -type ListExternalJWTSignersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListExternalJWTSignersParams() beforehand. -func (o *ListExternalJWTSignersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListExternalJWTSignersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListExternalJWTSignersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListExternalJWTSignersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_responses.go b/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_responses.go deleted file mode 100644 index 0cefc0a21..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListExternalJWTSignersOKCode is the HTTP code returned for type ListExternalJWTSignersOK -const ListExternalJWTSignersOKCode int = 200 - -/*ListExternalJWTSignersOK A list of External JWT Signers - -swagger:response listExternalJwtSignersOK -*/ -type ListExternalJWTSignersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListExternalJWTSignersEnvelope `json:"body,omitempty"` -} - -// NewListExternalJWTSignersOK creates ListExternalJWTSignersOK with default headers values -func NewListExternalJWTSignersOK() *ListExternalJWTSignersOK { - - return &ListExternalJWTSignersOK{} -} - -// WithPayload adds the payload to the list external Jwt signers o k response -func (o *ListExternalJWTSignersOK) WithPayload(payload *rest_model.ListExternalJWTSignersEnvelope) *ListExternalJWTSignersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list external Jwt signers o k response -func (o *ListExternalJWTSignersOK) SetPayload(payload *rest_model.ListExternalJWTSignersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListExternalJWTSignersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListExternalJWTSignersBadRequestCode is the HTTP code returned for type ListExternalJWTSignersBadRequest -const ListExternalJWTSignersBadRequestCode int = 400 - -/*ListExternalJWTSignersBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listExternalJwtSignersBadRequest -*/ -type ListExternalJWTSignersBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListExternalJWTSignersBadRequest creates ListExternalJWTSignersBadRequest with default headers values -func NewListExternalJWTSignersBadRequest() *ListExternalJWTSignersBadRequest { - - return &ListExternalJWTSignersBadRequest{} -} - -// WithPayload adds the payload to the list external Jwt signers bad request response -func (o *ListExternalJWTSignersBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListExternalJWTSignersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list external Jwt signers bad request response -func (o *ListExternalJWTSignersBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListExternalJWTSignersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListExternalJWTSignersUnauthorizedCode is the HTTP code returned for type ListExternalJWTSignersUnauthorized -const ListExternalJWTSignersUnauthorizedCode int = 401 - -/*ListExternalJWTSignersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listExternalJwtSignersUnauthorized -*/ -type ListExternalJWTSignersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListExternalJWTSignersUnauthorized creates ListExternalJWTSignersUnauthorized with default headers values -func NewListExternalJWTSignersUnauthorized() *ListExternalJWTSignersUnauthorized { - - return &ListExternalJWTSignersUnauthorized{} -} - -// WithPayload adds the payload to the list external Jwt signers unauthorized response -func (o *ListExternalJWTSignersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListExternalJWTSignersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list external Jwt signers unauthorized response -func (o *ListExternalJWTSignersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListExternalJWTSignersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_urlbuilder.go b/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_urlbuilder.go deleted file mode 100644 index f052bf51f..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/list_external_jwt_signers_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListExternalJWTSignersURL generates an URL for the list external Jwt signers operation -type ListExternalJWTSignersURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListExternalJWTSignersURL) WithBasePath(bp string) *ListExternalJWTSignersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListExternalJWTSignersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListExternalJWTSignersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListExternalJWTSignersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListExternalJWTSignersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListExternalJWTSignersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListExternalJWTSignersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListExternalJWTSignersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListExternalJWTSignersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer.go b/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer.go deleted file mode 100644 index 308900ef6..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchExternalJWTSignerHandlerFunc turns a function with the right signature into a patch external Jwt signer handler -type PatchExternalJWTSignerHandlerFunc func(PatchExternalJWTSignerParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchExternalJWTSignerHandlerFunc) Handle(params PatchExternalJWTSignerParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchExternalJWTSignerHandler interface for that can handle valid patch external Jwt signer params -type PatchExternalJWTSignerHandler interface { - Handle(PatchExternalJWTSignerParams, interface{}) middleware.Responder -} - -// NewPatchExternalJWTSigner creates a new http.Handler for the patch external Jwt signer operation -func NewPatchExternalJWTSigner(ctx *middleware.Context, handler PatchExternalJWTSignerHandler) *PatchExternalJWTSigner { - return &PatchExternalJWTSigner{Context: ctx, Handler: handler} -} - -/* PatchExternalJWTSigner swagger:route PATCH /external-jwt-signers/{id} External JWT Signer patchExternalJwtSigner - -Update the supplied fields on an External JWT Signer - -Update only the supplied fields on an External JWT Signer by id. Requires admin access. - -*/ -type PatchExternalJWTSigner struct { - Context *middleware.Context - Handler PatchExternalJWTSignerHandler -} - -func (o *PatchExternalJWTSigner) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchExternalJWTSignerParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_parameters.go b/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_parameters.go deleted file mode 100644 index 457532f62..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchExternalJWTSignerParams creates a new PatchExternalJWTSignerParams object -// -// There are no default values defined in the spec. -func NewPatchExternalJWTSignerParams() PatchExternalJWTSignerParams { - - return PatchExternalJWTSignerParams{} -} - -// PatchExternalJWTSignerParams contains all the bound params for the patch external Jwt signer operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchExternalJwtSigner -type PatchExternalJWTSignerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An External JWT Signer patch object - Required: true - In: body - */ - ExternalJWTSigner *rest_model.ExternalJWTSignerPatch - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchExternalJWTSignerParams() beforehand. -func (o *PatchExternalJWTSignerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ExternalJWTSignerPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("externalJwtSigner", "body", "")) - } else { - res = append(res, errors.NewParseError("externalJwtSigner", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ExternalJWTSigner = &body - } - } - } else { - res = append(res, errors.Required("externalJwtSigner", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchExternalJWTSignerParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_responses.go b/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_responses.go deleted file mode 100644 index 0b2f4ad8f..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchExternalJWTSignerOKCode is the HTTP code returned for type PatchExternalJWTSignerOK -const PatchExternalJWTSignerOKCode int = 200 - -/*PatchExternalJWTSignerOK The patch request was successful and the resource has been altered - -swagger:response patchExternalJwtSignerOK -*/ -type PatchExternalJWTSignerOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchExternalJWTSignerOK creates PatchExternalJWTSignerOK with default headers values -func NewPatchExternalJWTSignerOK() *PatchExternalJWTSignerOK { - - return &PatchExternalJWTSignerOK{} -} - -// WithPayload adds the payload to the patch external Jwt signer o k response -func (o *PatchExternalJWTSignerOK) WithPayload(payload *rest_model.Empty) *PatchExternalJWTSignerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch external Jwt signer o k response -func (o *PatchExternalJWTSignerOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchExternalJWTSignerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchExternalJWTSignerBadRequestCode is the HTTP code returned for type PatchExternalJWTSignerBadRequest -const PatchExternalJWTSignerBadRequestCode int = 400 - -/*PatchExternalJWTSignerBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchExternalJwtSignerBadRequest -*/ -type PatchExternalJWTSignerBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchExternalJWTSignerBadRequest creates PatchExternalJWTSignerBadRequest with default headers values -func NewPatchExternalJWTSignerBadRequest() *PatchExternalJWTSignerBadRequest { - - return &PatchExternalJWTSignerBadRequest{} -} - -// WithPayload adds the payload to the patch external Jwt signer bad request response -func (o *PatchExternalJWTSignerBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchExternalJWTSignerBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch external Jwt signer bad request response -func (o *PatchExternalJWTSignerBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchExternalJWTSignerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchExternalJWTSignerUnauthorizedCode is the HTTP code returned for type PatchExternalJWTSignerUnauthorized -const PatchExternalJWTSignerUnauthorizedCode int = 401 - -/*PatchExternalJWTSignerUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchExternalJwtSignerUnauthorized -*/ -type PatchExternalJWTSignerUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchExternalJWTSignerUnauthorized creates PatchExternalJWTSignerUnauthorized with default headers values -func NewPatchExternalJWTSignerUnauthorized() *PatchExternalJWTSignerUnauthorized { - - return &PatchExternalJWTSignerUnauthorized{} -} - -// WithPayload adds the payload to the patch external Jwt signer unauthorized response -func (o *PatchExternalJWTSignerUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchExternalJWTSignerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch external Jwt signer unauthorized response -func (o *PatchExternalJWTSignerUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchExternalJWTSignerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchExternalJWTSignerNotFoundCode is the HTTP code returned for type PatchExternalJWTSignerNotFound -const PatchExternalJWTSignerNotFoundCode int = 404 - -/*PatchExternalJWTSignerNotFound The requested resource does not exist - -swagger:response patchExternalJwtSignerNotFound -*/ -type PatchExternalJWTSignerNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchExternalJWTSignerNotFound creates PatchExternalJWTSignerNotFound with default headers values -func NewPatchExternalJWTSignerNotFound() *PatchExternalJWTSignerNotFound { - - return &PatchExternalJWTSignerNotFound{} -} - -// WithPayload adds the payload to the patch external Jwt signer not found response -func (o *PatchExternalJWTSignerNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchExternalJWTSignerNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch external Jwt signer not found response -func (o *PatchExternalJWTSignerNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchExternalJWTSignerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_urlbuilder.go b/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_urlbuilder.go deleted file mode 100644 index e10e7e949..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/patch_external_jwt_signer_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchExternalJWTSignerURL generates an URL for the patch external Jwt signer operation -type PatchExternalJWTSignerURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchExternalJWTSignerURL) WithBasePath(bp string) *PatchExternalJWTSignerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchExternalJWTSignerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchExternalJWTSignerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchExternalJWTSignerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchExternalJWTSignerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchExternalJWTSignerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchExternalJWTSignerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchExternalJWTSignerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchExternalJWTSignerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchExternalJWTSignerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer.go b/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer.go deleted file mode 100644 index 0dc251b43..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateExternalJWTSignerHandlerFunc turns a function with the right signature into a update external Jwt signer handler -type UpdateExternalJWTSignerHandlerFunc func(UpdateExternalJWTSignerParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateExternalJWTSignerHandlerFunc) Handle(params UpdateExternalJWTSignerParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateExternalJWTSignerHandler interface for that can handle valid update external Jwt signer params -type UpdateExternalJWTSignerHandler interface { - Handle(UpdateExternalJWTSignerParams, interface{}) middleware.Responder -} - -// NewUpdateExternalJWTSigner creates a new http.Handler for the update external Jwt signer operation -func NewUpdateExternalJWTSigner(ctx *middleware.Context, handler UpdateExternalJWTSignerHandler) *UpdateExternalJWTSigner { - return &UpdateExternalJWTSigner{Context: ctx, Handler: handler} -} - -/* UpdateExternalJWTSigner swagger:route PUT /external-jwt-signers/{id} External JWT Signer updateExternalJwtSigner - -Update all fields on an External JWT Signer - -Update all fields on an External JWT Signer by id. Requires admin access. - -*/ -type UpdateExternalJWTSigner struct { - Context *middleware.Context - Handler UpdateExternalJWTSignerHandler -} - -func (o *UpdateExternalJWTSigner) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateExternalJWTSignerParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_parameters.go b/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_parameters.go deleted file mode 100644 index ff90592da..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateExternalJWTSignerParams creates a new UpdateExternalJWTSignerParams object -// -// There are no default values defined in the spec. -func NewUpdateExternalJWTSignerParams() UpdateExternalJWTSignerParams { - - return UpdateExternalJWTSignerParams{} -} - -// UpdateExternalJWTSignerParams contains all the bound params for the update external Jwt signer operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateExternalJwtSigner -type UpdateExternalJWTSignerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An External JWT Signer update object - Required: true - In: body - */ - ExternalJWTSigner *rest_model.ExternalJWTSignerUpdate - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateExternalJWTSignerParams() beforehand. -func (o *UpdateExternalJWTSignerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ExternalJWTSignerUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("externalJwtSigner", "body", "")) - } else { - res = append(res, errors.NewParseError("externalJwtSigner", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ExternalJWTSigner = &body - } - } - } else { - res = append(res, errors.Required("externalJwtSigner", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateExternalJWTSignerParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_responses.go b/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_responses.go deleted file mode 100644 index 56f27cf92..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateExternalJWTSignerOKCode is the HTTP code returned for type UpdateExternalJWTSignerOK -const UpdateExternalJWTSignerOKCode int = 200 - -/*UpdateExternalJWTSignerOK The update request was successful and the resource has been altered - -swagger:response updateExternalJwtSignerOK -*/ -type UpdateExternalJWTSignerOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateExternalJWTSignerOK creates UpdateExternalJWTSignerOK with default headers values -func NewUpdateExternalJWTSignerOK() *UpdateExternalJWTSignerOK { - - return &UpdateExternalJWTSignerOK{} -} - -// WithPayload adds the payload to the update external Jwt signer o k response -func (o *UpdateExternalJWTSignerOK) WithPayload(payload *rest_model.Empty) *UpdateExternalJWTSignerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update external Jwt signer o k response -func (o *UpdateExternalJWTSignerOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateExternalJWTSignerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateExternalJWTSignerBadRequestCode is the HTTP code returned for type UpdateExternalJWTSignerBadRequest -const UpdateExternalJWTSignerBadRequestCode int = 400 - -/*UpdateExternalJWTSignerBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateExternalJwtSignerBadRequest -*/ -type UpdateExternalJWTSignerBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateExternalJWTSignerBadRequest creates UpdateExternalJWTSignerBadRequest with default headers values -func NewUpdateExternalJWTSignerBadRequest() *UpdateExternalJWTSignerBadRequest { - - return &UpdateExternalJWTSignerBadRequest{} -} - -// WithPayload adds the payload to the update external Jwt signer bad request response -func (o *UpdateExternalJWTSignerBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateExternalJWTSignerBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update external Jwt signer bad request response -func (o *UpdateExternalJWTSignerBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateExternalJWTSignerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateExternalJWTSignerUnauthorizedCode is the HTTP code returned for type UpdateExternalJWTSignerUnauthorized -const UpdateExternalJWTSignerUnauthorizedCode int = 401 - -/*UpdateExternalJWTSignerUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateExternalJwtSignerUnauthorized -*/ -type UpdateExternalJWTSignerUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateExternalJWTSignerUnauthorized creates UpdateExternalJWTSignerUnauthorized with default headers values -func NewUpdateExternalJWTSignerUnauthorized() *UpdateExternalJWTSignerUnauthorized { - - return &UpdateExternalJWTSignerUnauthorized{} -} - -// WithPayload adds the payload to the update external Jwt signer unauthorized response -func (o *UpdateExternalJWTSignerUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateExternalJWTSignerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update external Jwt signer unauthorized response -func (o *UpdateExternalJWTSignerUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateExternalJWTSignerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateExternalJWTSignerNotFoundCode is the HTTP code returned for type UpdateExternalJWTSignerNotFound -const UpdateExternalJWTSignerNotFoundCode int = 404 - -/*UpdateExternalJWTSignerNotFound The requested resource does not exist - -swagger:response updateExternalJwtSignerNotFound -*/ -type UpdateExternalJWTSignerNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateExternalJWTSignerNotFound creates UpdateExternalJWTSignerNotFound with default headers values -func NewUpdateExternalJWTSignerNotFound() *UpdateExternalJWTSignerNotFound { - - return &UpdateExternalJWTSignerNotFound{} -} - -// WithPayload adds the payload to the update external Jwt signer not found response -func (o *UpdateExternalJWTSignerNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateExternalJWTSignerNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update external Jwt signer not found response -func (o *UpdateExternalJWTSignerNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateExternalJWTSignerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_urlbuilder.go b/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_urlbuilder.go deleted file mode 100644 index d85a71fea..000000000 --- a/rest_management_api_server/operations/external_jwt_signer/update_external_jwt_signer_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package external_jwt_signer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateExternalJWTSignerURL generates an URL for the update external Jwt signer operation -type UpdateExternalJWTSignerURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateExternalJWTSignerURL) WithBasePath(bp string) *UpdateExternalJWTSignerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateExternalJWTSignerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateExternalJWTSignerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/external-jwt-signers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateExternalJWTSignerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateExternalJWTSignerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateExternalJWTSignerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateExternalJWTSignerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateExternalJWTSignerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateExternalJWTSignerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateExternalJWTSignerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/associate_identitys_service_configs.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs.go deleted file mode 100644 index 27f5e0230..000000000 --- a/rest_management_api_server/operations/identity/associate_identitys_service_configs.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AssociateIdentitysServiceConfigsHandlerFunc turns a function with the right signature into a associate identitys service configs handler -type AssociateIdentitysServiceConfigsHandlerFunc func(AssociateIdentitysServiceConfigsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn AssociateIdentitysServiceConfigsHandlerFunc) Handle(params AssociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// AssociateIdentitysServiceConfigsHandler interface for that can handle valid associate identitys service configs params -type AssociateIdentitysServiceConfigsHandler interface { - Handle(AssociateIdentitysServiceConfigsParams, interface{}) middleware.Responder -} - -// NewAssociateIdentitysServiceConfigs creates a new http.Handler for the associate identitys service configs operation -func NewAssociateIdentitysServiceConfigs(ctx *middleware.Context, handler AssociateIdentitysServiceConfigsHandler) *AssociateIdentitysServiceConfigs { - return &AssociateIdentitysServiceConfigs{Context: ctx, Handler: handler} -} - -/* AssociateIdentitysServiceConfigs swagger:route POST /identities/{id}/service-configs Identity associateIdentitysServiceConfigs - -Associate service configs for a specific identity - -Associate service configs to a specific identity - -*/ -type AssociateIdentitysServiceConfigs struct { - Context *middleware.Context - Handler AssociateIdentitysServiceConfigsHandler -} - -func (o *AssociateIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAssociateIdentitysServiceConfigsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/associate_identitys_service_configs_parameters.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs_parameters.go deleted file mode 100644 index d6fa0fba2..000000000 --- a/rest_management_api_server/operations/identity/associate_identitys_service_configs_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewAssociateIdentitysServiceConfigsParams creates a new AssociateIdentitysServiceConfigsParams object -// -// There are no default values defined in the spec. -func NewAssociateIdentitysServiceConfigsParams() AssociateIdentitysServiceConfigsParams { - - return AssociateIdentitysServiceConfigsParams{} -} - -// AssociateIdentitysServiceConfigsParams contains all the bound params for the associate identitys service configs operation -// typically these are obtained from a http.Request -// -// swagger:parameters associateIdentitysServiceConfigs -type AssociateIdentitysServiceConfigsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service config patch object - Required: true - In: body - */ - ServiceConfigs rest_model.ServiceConfigsAssignList -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAssociateIdentitysServiceConfigsParams() beforehand. -func (o *AssociateIdentitysServiceConfigsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceConfigsAssignList - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("serviceConfigs", "body", "")) - } else { - res = append(res, errors.NewParseError("serviceConfigs", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ServiceConfigs = body - } - } - } else { - res = append(res, errors.Required("serviceConfigs", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *AssociateIdentitysServiceConfigsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/associate_identitys_service_configs_responses.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs_responses.go deleted file mode 100644 index e25f7dd53..000000000 --- a/rest_management_api_server/operations/identity/associate_identitys_service_configs_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// AssociateIdentitysServiceConfigsOKCode is the HTTP code returned for type AssociateIdentitysServiceConfigsOK -const AssociateIdentitysServiceConfigsOKCode int = 200 - -/*AssociateIdentitysServiceConfigsOK Base empty response - -swagger:response associateIdentitysServiceConfigsOK -*/ -type AssociateIdentitysServiceConfigsOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewAssociateIdentitysServiceConfigsOK creates AssociateIdentitysServiceConfigsOK with default headers values -func NewAssociateIdentitysServiceConfigsOK() *AssociateIdentitysServiceConfigsOK { - - return &AssociateIdentitysServiceConfigsOK{} -} - -// WithPayload adds the payload to the associate identitys service configs o k response -func (o *AssociateIdentitysServiceConfigsOK) WithPayload(payload *rest_model.Empty) *AssociateIdentitysServiceConfigsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate identitys service configs o k response -func (o *AssociateIdentitysServiceConfigsOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateIdentitysServiceConfigsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateIdentitysServiceConfigsBadRequestCode is the HTTP code returned for type AssociateIdentitysServiceConfigsBadRequest -const AssociateIdentitysServiceConfigsBadRequestCode int = 400 - -/*AssociateIdentitysServiceConfigsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response associateIdentitysServiceConfigsBadRequest -*/ -type AssociateIdentitysServiceConfigsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAssociateIdentitysServiceConfigsBadRequest creates AssociateIdentitysServiceConfigsBadRequest with default headers values -func NewAssociateIdentitysServiceConfigsBadRequest() *AssociateIdentitysServiceConfigsBadRequest { - - return &AssociateIdentitysServiceConfigsBadRequest{} -} - -// WithPayload adds the payload to the associate identitys service configs bad request response -func (o *AssociateIdentitysServiceConfigsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *AssociateIdentitysServiceConfigsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate identitys service configs bad request response -func (o *AssociateIdentitysServiceConfigsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateIdentitysServiceConfigsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateIdentitysServiceConfigsUnauthorizedCode is the HTTP code returned for type AssociateIdentitysServiceConfigsUnauthorized -const AssociateIdentitysServiceConfigsUnauthorizedCode int = 401 - -/*AssociateIdentitysServiceConfigsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response associateIdentitysServiceConfigsUnauthorized -*/ -type AssociateIdentitysServiceConfigsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAssociateIdentitysServiceConfigsUnauthorized creates AssociateIdentitysServiceConfigsUnauthorized with default headers values -func NewAssociateIdentitysServiceConfigsUnauthorized() *AssociateIdentitysServiceConfigsUnauthorized { - - return &AssociateIdentitysServiceConfigsUnauthorized{} -} - -// WithPayload adds the payload to the associate identitys service configs unauthorized response -func (o *AssociateIdentitysServiceConfigsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *AssociateIdentitysServiceConfigsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate identitys service configs unauthorized response -func (o *AssociateIdentitysServiceConfigsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateIdentitysServiceConfigsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateIdentitysServiceConfigsNotFoundCode is the HTTP code returned for type AssociateIdentitysServiceConfigsNotFound -const AssociateIdentitysServiceConfigsNotFoundCode int = 404 - -/*AssociateIdentitysServiceConfigsNotFound The requested resource does not exist - -swagger:response associateIdentitysServiceConfigsNotFound -*/ -type AssociateIdentitysServiceConfigsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewAssociateIdentitysServiceConfigsNotFound creates AssociateIdentitysServiceConfigsNotFound with default headers values -func NewAssociateIdentitysServiceConfigsNotFound() *AssociateIdentitysServiceConfigsNotFound { - - return &AssociateIdentitysServiceConfigsNotFound{} -} - -// WithPayload adds the payload to the associate identitys service configs not found response -func (o *AssociateIdentitysServiceConfigsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *AssociateIdentitysServiceConfigsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate identitys service configs not found response -func (o *AssociateIdentitysServiceConfigsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateIdentitysServiceConfigsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/associate_identitys_service_configs_urlbuilder.go b/rest_management_api_server/operations/identity/associate_identitys_service_configs_urlbuilder.go deleted file mode 100644 index 4bd4839db..000000000 --- a/rest_management_api_server/operations/identity/associate_identitys_service_configs_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// AssociateIdentitysServiceConfigsURL generates an URL for the associate identitys service configs operation -type AssociateIdentitysServiceConfigsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AssociateIdentitysServiceConfigsURL) WithBasePath(bp string) *AssociateIdentitysServiceConfigsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AssociateIdentitysServiceConfigsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AssociateIdentitysServiceConfigsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/service-configs" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on AssociateIdentitysServiceConfigsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AssociateIdentitysServiceConfigsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AssociateIdentitysServiceConfigsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AssociateIdentitysServiceConfigsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AssociateIdentitysServiceConfigsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AssociateIdentitysServiceConfigsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AssociateIdentitysServiceConfigsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/create_identity.go b/rest_management_api_server/operations/identity/create_identity.go deleted file mode 100644 index 030df234c..000000000 --- a/rest_management_api_server/operations/identity/create_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateIdentityHandlerFunc turns a function with the right signature into a create identity handler -type CreateIdentityHandlerFunc func(CreateIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateIdentityHandlerFunc) Handle(params CreateIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateIdentityHandler interface for that can handle valid create identity params -type CreateIdentityHandler interface { - Handle(CreateIdentityParams, interface{}) middleware.Responder -} - -// NewCreateIdentity creates a new http.Handler for the create identity operation -func NewCreateIdentity(ctx *middleware.Context, handler CreateIdentityHandler) *CreateIdentity { - return &CreateIdentity{Context: ctx, Handler: handler} -} - -/* CreateIdentity swagger:route POST /identities Identity createIdentity - -Create an identity resource - -Create an identity resource. Requires admin access. - -*/ -type CreateIdentity struct { - Context *middleware.Context - Handler CreateIdentityHandler -} - -func (o *CreateIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/create_identity_parameters.go b/rest_management_api_server/operations/identity/create_identity_parameters.go deleted file mode 100644 index 08bb6c00b..000000000 --- a/rest_management_api_server/operations/identity/create_identity_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateIdentityParams creates a new CreateIdentityParams object -// -// There are no default values defined in the spec. -func NewCreateIdentityParams() CreateIdentityParams { - - return CreateIdentityParams{} -} - -// CreateIdentityParams contains all the bound params for the create identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters createIdentity -type CreateIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*An identity to create - Required: true - In: body - */ - Identity *rest_model.IdentityCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateIdentityParams() beforehand. -func (o *CreateIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("identity", "body", "")) - } else { - res = append(res, errors.NewParseError("identity", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Identity = &body - } - } - } else { - res = append(res, errors.Required("identity", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/identity/create_identity_responses.go b/rest_management_api_server/operations/identity/create_identity_responses.go deleted file mode 100644 index d946ddd74..000000000 --- a/rest_management_api_server/operations/identity/create_identity_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateIdentityCreatedCode is the HTTP code returned for type CreateIdentityCreated -const CreateIdentityCreatedCode int = 201 - -/*CreateIdentityCreated The create request was successful and the resource has been added at the following location - -swagger:response createIdentityCreated -*/ -type CreateIdentityCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateIdentityCreated creates CreateIdentityCreated with default headers values -func NewCreateIdentityCreated() *CreateIdentityCreated { - - return &CreateIdentityCreated{} -} - -// WithPayload adds the payload to the create identity created response -func (o *CreateIdentityCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateIdentityCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create identity created response -func (o *CreateIdentityCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateIdentityCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateIdentityBadRequestCode is the HTTP code returned for type CreateIdentityBadRequest -const CreateIdentityBadRequestCode int = 400 - -/*CreateIdentityBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createIdentityBadRequest -*/ -type CreateIdentityBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateIdentityBadRequest creates CreateIdentityBadRequest with default headers values -func NewCreateIdentityBadRequest() *CreateIdentityBadRequest { - - return &CreateIdentityBadRequest{} -} - -// WithPayload adds the payload to the create identity bad request response -func (o *CreateIdentityBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateIdentityBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create identity bad request response -func (o *CreateIdentityBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateIdentityBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateIdentityUnauthorizedCode is the HTTP code returned for type CreateIdentityUnauthorized -const CreateIdentityUnauthorizedCode int = 401 - -/*CreateIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createIdentityUnauthorized -*/ -type CreateIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateIdentityUnauthorized creates CreateIdentityUnauthorized with default headers values -func NewCreateIdentityUnauthorized() *CreateIdentityUnauthorized { - - return &CreateIdentityUnauthorized{} -} - -// WithPayload adds the payload to the create identity unauthorized response -func (o *CreateIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create identity unauthorized response -func (o *CreateIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/create_identity_urlbuilder.go b/rest_management_api_server/operations/identity/create_identity_urlbuilder.go deleted file mode 100644 index 28e13412b..000000000 --- a/rest_management_api_server/operations/identity/create_identity_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateIdentityURL generates an URL for the create identity operation -type CreateIdentityURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateIdentityURL) WithBasePath(bp string) *CreateIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/delete_identity.go b/rest_management_api_server/operations/identity/delete_identity.go deleted file mode 100644 index 044a4033d..000000000 --- a/rest_management_api_server/operations/identity/delete_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteIdentityHandlerFunc turns a function with the right signature into a delete identity handler -type DeleteIdentityHandlerFunc func(DeleteIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteIdentityHandlerFunc) Handle(params DeleteIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteIdentityHandler interface for that can handle valid delete identity params -type DeleteIdentityHandler interface { - Handle(DeleteIdentityParams, interface{}) middleware.Responder -} - -// NewDeleteIdentity creates a new http.Handler for the delete identity operation -func NewDeleteIdentity(ctx *middleware.Context, handler DeleteIdentityHandler) *DeleteIdentity { - return &DeleteIdentity{Context: ctx, Handler: handler} -} - -/* DeleteIdentity swagger:route DELETE /identities/{id} Identity deleteIdentity - -Delete an identity - -Delete an identity by id. Requires admin access. - -*/ -type DeleteIdentity struct { - Context *middleware.Context - Handler DeleteIdentityHandler -} - -func (o *DeleteIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/delete_identity_parameters.go b/rest_management_api_server/operations/identity/delete_identity_parameters.go deleted file mode 100644 index 0b7f1d03d..000000000 --- a/rest_management_api_server/operations/identity/delete_identity_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteIdentityParams creates a new DeleteIdentityParams object -// -// There are no default values defined in the spec. -func NewDeleteIdentityParams() DeleteIdentityParams { - - return DeleteIdentityParams{} -} - -// DeleteIdentityParams contains all the bound params for the delete identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteIdentity -type DeleteIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteIdentityParams() beforehand. -func (o *DeleteIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteIdentityParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/delete_identity_responses.go b/rest_management_api_server/operations/identity/delete_identity_responses.go deleted file mode 100644 index 77e2f4c42..000000000 --- a/rest_management_api_server/operations/identity/delete_identity_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteIdentityOKCode is the HTTP code returned for type DeleteIdentityOK -const DeleteIdentityOKCode int = 200 - -/*DeleteIdentityOK The delete request was successful and the resource has been removed - -swagger:response deleteIdentityOK -*/ -type DeleteIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteIdentityOK creates DeleteIdentityOK with default headers values -func NewDeleteIdentityOK() *DeleteIdentityOK { - - return &DeleteIdentityOK{} -} - -// WithPayload adds the payload to the delete identity o k response -func (o *DeleteIdentityOK) WithPayload(payload *rest_model.Empty) *DeleteIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete identity o k response -func (o *DeleteIdentityOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteIdentityBadRequestCode is the HTTP code returned for type DeleteIdentityBadRequest -const DeleteIdentityBadRequestCode int = 400 - -/*DeleteIdentityBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteIdentityBadRequest -*/ -type DeleteIdentityBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteIdentityBadRequest creates DeleteIdentityBadRequest with default headers values -func NewDeleteIdentityBadRequest() *DeleteIdentityBadRequest { - - return &DeleteIdentityBadRequest{} -} - -// WithPayload adds the payload to the delete identity bad request response -func (o *DeleteIdentityBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteIdentityBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete identity bad request response -func (o *DeleteIdentityBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteIdentityBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteIdentityUnauthorizedCode is the HTTP code returned for type DeleteIdentityUnauthorized -const DeleteIdentityUnauthorizedCode int = 401 - -/*DeleteIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteIdentityUnauthorized -*/ -type DeleteIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteIdentityUnauthorized creates DeleteIdentityUnauthorized with default headers values -func NewDeleteIdentityUnauthorized() *DeleteIdentityUnauthorized { - - return &DeleteIdentityUnauthorized{} -} - -// WithPayload adds the payload to the delete identity unauthorized response -func (o *DeleteIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete identity unauthorized response -func (o *DeleteIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteIdentityConflictCode is the HTTP code returned for type DeleteIdentityConflict -const DeleteIdentityConflictCode int = 409 - -/*DeleteIdentityConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteIdentityConflict -*/ -type DeleteIdentityConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteIdentityConflict creates DeleteIdentityConflict with default headers values -func NewDeleteIdentityConflict() *DeleteIdentityConflict { - - return &DeleteIdentityConflict{} -} - -// WithPayload adds the payload to the delete identity conflict response -func (o *DeleteIdentityConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteIdentityConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete identity conflict response -func (o *DeleteIdentityConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteIdentityConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/delete_identity_urlbuilder.go b/rest_management_api_server/operations/identity/delete_identity_urlbuilder.go deleted file mode 100644 index 36ec3e3a9..000000000 --- a/rest_management_api_server/operations/identity/delete_identity_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteIdentityURL generates an URL for the delete identity operation -type DeleteIdentityURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteIdentityURL) WithBasePath(bp string) *DeleteIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteIdentityURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/detail_identity.go b/rest_management_api_server/operations/identity/detail_identity.go deleted file mode 100644 index 67e05c5a3..000000000 --- a/rest_management_api_server/operations/identity/detail_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailIdentityHandlerFunc turns a function with the right signature into a detail identity handler -type DetailIdentityHandlerFunc func(DetailIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailIdentityHandlerFunc) Handle(params DetailIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailIdentityHandler interface for that can handle valid detail identity params -type DetailIdentityHandler interface { - Handle(DetailIdentityParams, interface{}) middleware.Responder -} - -// NewDetailIdentity creates a new http.Handler for the detail identity operation -func NewDetailIdentity(ctx *middleware.Context, handler DetailIdentityHandler) *DetailIdentity { - return &DetailIdentity{Context: ctx, Handler: handler} -} - -/* DetailIdentity swagger:route GET /identities/{id} Identity detailIdentity - -Retrieves a single identity - -Retrieves a single identity by id. Requires admin access. - -*/ -type DetailIdentity struct { - Context *middleware.Context - Handler DetailIdentityHandler -} - -func (o *DetailIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/detail_identity_parameters.go b/rest_management_api_server/operations/identity/detail_identity_parameters.go deleted file mode 100644 index 5308340cd..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailIdentityParams creates a new DetailIdentityParams object -// -// There are no default values defined in the spec. -func NewDetailIdentityParams() DetailIdentityParams { - - return DetailIdentityParams{} -} - -// DetailIdentityParams contains all the bound params for the detail identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailIdentity -type DetailIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailIdentityParams() beforehand. -func (o *DetailIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailIdentityParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/detail_identity_responses.go b/rest_management_api_server/operations/identity/detail_identity_responses.go deleted file mode 100644 index a03f758ea..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailIdentityOKCode is the HTTP code returned for type DetailIdentityOK -const DetailIdentityOKCode int = 200 - -/*DetailIdentityOK A single identity - -swagger:response detailIdentityOK -*/ -type DetailIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailIdentityEnvelope `json:"body,omitempty"` -} - -// NewDetailIdentityOK creates DetailIdentityOK with default headers values -func NewDetailIdentityOK() *DetailIdentityOK { - - return &DetailIdentityOK{} -} - -// WithPayload adds the payload to the detail identity o k response -func (o *DetailIdentityOK) WithPayload(payload *rest_model.DetailIdentityEnvelope) *DetailIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail identity o k response -func (o *DetailIdentityOK) SetPayload(payload *rest_model.DetailIdentityEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailIdentityUnauthorizedCode is the HTTP code returned for type DetailIdentityUnauthorized -const DetailIdentityUnauthorizedCode int = 401 - -/*DetailIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailIdentityUnauthorized -*/ -type DetailIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailIdentityUnauthorized creates DetailIdentityUnauthorized with default headers values -func NewDetailIdentityUnauthorized() *DetailIdentityUnauthorized { - - return &DetailIdentityUnauthorized{} -} - -// WithPayload adds the payload to the detail identity unauthorized response -func (o *DetailIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail identity unauthorized response -func (o *DetailIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailIdentityNotFoundCode is the HTTP code returned for type DetailIdentityNotFound -const DetailIdentityNotFoundCode int = 404 - -/*DetailIdentityNotFound The requested resource does not exist - -swagger:response detailIdentityNotFound -*/ -type DetailIdentityNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailIdentityNotFound creates DetailIdentityNotFound with default headers values -func NewDetailIdentityNotFound() *DetailIdentityNotFound { - - return &DetailIdentityNotFound{} -} - -// WithPayload adds the payload to the detail identity not found response -func (o *DetailIdentityNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailIdentityNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail identity not found response -func (o *DetailIdentityNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/detail_identity_type.go b/rest_management_api_server/operations/identity/detail_identity_type.go deleted file mode 100644 index 7fe022ed7..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailIdentityTypeHandlerFunc turns a function with the right signature into a detail identity type handler -type DetailIdentityTypeHandlerFunc func(DetailIdentityTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailIdentityTypeHandlerFunc) Handle(params DetailIdentityTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailIdentityTypeHandler interface for that can handle valid detail identity type params -type DetailIdentityTypeHandler interface { - Handle(DetailIdentityTypeParams, interface{}) middleware.Responder -} - -// NewDetailIdentityType creates a new http.Handler for the detail identity type operation -func NewDetailIdentityType(ctx *middleware.Context, handler DetailIdentityTypeHandler) *DetailIdentityType { - return &DetailIdentityType{Context: ctx, Handler: handler} -} - -/* DetailIdentityType swagger:route GET /identity-types/{id} Identity detailIdentityType - -Retrieves a identity type - -Retrieves a single identity type by id. Requires admin access. - -*/ -type DetailIdentityType struct { - Context *middleware.Context - Handler DetailIdentityTypeHandler -} - -func (o *DetailIdentityType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailIdentityTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/detail_identity_type_parameters.go b/rest_management_api_server/operations/identity/detail_identity_type_parameters.go deleted file mode 100644 index 10230cb9f..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_type_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailIdentityTypeParams creates a new DetailIdentityTypeParams object -// -// There are no default values defined in the spec. -func NewDetailIdentityTypeParams() DetailIdentityTypeParams { - - return DetailIdentityTypeParams{} -} - -// DetailIdentityTypeParams contains all the bound params for the detail identity type operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailIdentityType -type DetailIdentityTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailIdentityTypeParams() beforehand. -func (o *DetailIdentityTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailIdentityTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/detail_identity_type_responses.go b/rest_management_api_server/operations/identity/detail_identity_type_responses.go deleted file mode 100644 index d3b66bf98..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_type_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailIdentityTypeOKCode is the HTTP code returned for type DetailIdentityTypeOK -const DetailIdentityTypeOKCode int = 200 - -/*DetailIdentityTypeOK A single identity type - -swagger:response detailIdentityTypeOK -*/ -type DetailIdentityTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailIdentityTypeEnvelope `json:"body,omitempty"` -} - -// NewDetailIdentityTypeOK creates DetailIdentityTypeOK with default headers values -func NewDetailIdentityTypeOK() *DetailIdentityTypeOK { - - return &DetailIdentityTypeOK{} -} - -// WithPayload adds the payload to the detail identity type o k response -func (o *DetailIdentityTypeOK) WithPayload(payload *rest_model.DetailIdentityTypeEnvelope) *DetailIdentityTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail identity type o k response -func (o *DetailIdentityTypeOK) SetPayload(payload *rest_model.DetailIdentityTypeEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailIdentityTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailIdentityTypeUnauthorizedCode is the HTTP code returned for type DetailIdentityTypeUnauthorized -const DetailIdentityTypeUnauthorizedCode int = 401 - -/*DetailIdentityTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailIdentityTypeUnauthorized -*/ -type DetailIdentityTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailIdentityTypeUnauthorized creates DetailIdentityTypeUnauthorized with default headers values -func NewDetailIdentityTypeUnauthorized() *DetailIdentityTypeUnauthorized { - - return &DetailIdentityTypeUnauthorized{} -} - -// WithPayload adds the payload to the detail identity type unauthorized response -func (o *DetailIdentityTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailIdentityTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail identity type unauthorized response -func (o *DetailIdentityTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailIdentityTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailIdentityTypeNotFoundCode is the HTTP code returned for type DetailIdentityTypeNotFound -const DetailIdentityTypeNotFoundCode int = 404 - -/*DetailIdentityTypeNotFound The requested resource does not exist - -swagger:response detailIdentityTypeNotFound -*/ -type DetailIdentityTypeNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailIdentityTypeNotFound creates DetailIdentityTypeNotFound with default headers values -func NewDetailIdentityTypeNotFound() *DetailIdentityTypeNotFound { - - return &DetailIdentityTypeNotFound{} -} - -// WithPayload adds the payload to the detail identity type not found response -func (o *DetailIdentityTypeNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailIdentityTypeNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail identity type not found response -func (o *DetailIdentityTypeNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailIdentityTypeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/detail_identity_type_urlbuilder.go b/rest_management_api_server/operations/identity/detail_identity_type_urlbuilder.go deleted file mode 100644 index 4503029d2..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailIdentityTypeURL generates an URL for the detail identity type operation -type DetailIdentityTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailIdentityTypeURL) WithBasePath(bp string) *DetailIdentityTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailIdentityTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailIdentityTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identity-types/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailIdentityTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailIdentityTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailIdentityTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailIdentityTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailIdentityTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailIdentityTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailIdentityTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/detail_identity_urlbuilder.go b/rest_management_api_server/operations/identity/detail_identity_urlbuilder.go deleted file mode 100644 index 85733f1e4..000000000 --- a/rest_management_api_server/operations/identity/detail_identity_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailIdentityURL generates an URL for the detail identity operation -type DetailIdentityURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailIdentityURL) WithBasePath(bp string) *DetailIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailIdentityURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/disable_identity.go b/rest_management_api_server/operations/identity/disable_identity.go deleted file mode 100644 index 14ade5b3b..000000000 --- a/rest_management_api_server/operations/identity/disable_identity.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DisableIdentityHandlerFunc turns a function with the right signature into a disable identity handler -type DisableIdentityHandlerFunc func(DisableIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DisableIdentityHandlerFunc) Handle(params DisableIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DisableIdentityHandler interface for that can handle valid disable identity params -type DisableIdentityHandler interface { - Handle(DisableIdentityParams, interface{}) middleware.Responder -} - -// NewDisableIdentity creates a new http.Handler for the disable identity operation -func NewDisableIdentity(ctx *middleware.Context, handler DisableIdentityHandler) *DisableIdentity { - return &DisableIdentity{Context: ctx, Handler: handler} -} - -/* DisableIdentity swagger:route POST /identities/{id}/disable Identity disableIdentity - -Set an identity as disabled - -Allows an admin disable an identity for a set amount of time or indefinitely. - - -*/ -type DisableIdentity struct { - Context *middleware.Context - Handler DisableIdentityHandler -} - -func (o *DisableIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDisableIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/disable_identity_parameters.go b/rest_management_api_server/operations/identity/disable_identity_parameters.go deleted file mode 100644 index 2ef589b36..000000000 --- a/rest_management_api_server/operations/identity/disable_identity_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewDisableIdentityParams creates a new DisableIdentityParams object -// -// There are no default values defined in the spec. -func NewDisableIdentityParams() DisableIdentityParams { - - return DisableIdentityParams{} -} - -// DisableIdentityParams contains all the bound params for the disable identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters disableIdentity -type DisableIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Disable parameters - Required: true - In: body - */ - Disable *rest_model.DisableParams - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDisableIdentityParams() beforehand. -func (o *DisableIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.DisableParams - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("disable", "body", "")) - } else { - res = append(res, errors.NewParseError("disable", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Disable = &body - } - } - } else { - res = append(res, errors.Required("disable", "body", "")) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DisableIdentityParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/disable_identity_responses.go b/rest_management_api_server/operations/identity/disable_identity_responses.go deleted file mode 100644 index fdd1c307b..000000000 --- a/rest_management_api_server/operations/identity/disable_identity_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DisableIdentityOKCode is the HTTP code returned for type DisableIdentityOK -const DisableIdentityOKCode int = 200 - -/*DisableIdentityOK Base empty response - -swagger:response disableIdentityOK -*/ -type DisableIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDisableIdentityOK creates DisableIdentityOK with default headers values -func NewDisableIdentityOK() *DisableIdentityOK { - - return &DisableIdentityOK{} -} - -// WithPayload adds the payload to the disable identity o k response -func (o *DisableIdentityOK) WithPayload(payload *rest_model.Empty) *DisableIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disable identity o k response -func (o *DisableIdentityOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisableIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DisableIdentityUnauthorizedCode is the HTTP code returned for type DisableIdentityUnauthorized -const DisableIdentityUnauthorizedCode int = 401 - -/*DisableIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response disableIdentityUnauthorized -*/ -type DisableIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDisableIdentityUnauthorized creates DisableIdentityUnauthorized with default headers values -func NewDisableIdentityUnauthorized() *DisableIdentityUnauthorized { - - return &DisableIdentityUnauthorized{} -} - -// WithPayload adds the payload to the disable identity unauthorized response -func (o *DisableIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DisableIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disable identity unauthorized response -func (o *DisableIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisableIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DisableIdentityNotFoundCode is the HTTP code returned for type DisableIdentityNotFound -const DisableIdentityNotFoundCode int = 404 - -/*DisableIdentityNotFound The requested resource does not exist - -swagger:response disableIdentityNotFound -*/ -type DisableIdentityNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDisableIdentityNotFound creates DisableIdentityNotFound with default headers values -func NewDisableIdentityNotFound() *DisableIdentityNotFound { - - return &DisableIdentityNotFound{} -} - -// WithPayload adds the payload to the disable identity not found response -func (o *DisableIdentityNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DisableIdentityNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disable identity not found response -func (o *DisableIdentityNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisableIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/disable_identity_urlbuilder.go b/rest_management_api_server/operations/identity/disable_identity_urlbuilder.go deleted file mode 100644 index 6315cfa17..000000000 --- a/rest_management_api_server/operations/identity/disable_identity_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DisableIdentityURL generates an URL for the disable identity operation -type DisableIdentityURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DisableIdentityURL) WithBasePath(bp string) *DisableIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DisableIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DisableIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/disable" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DisableIdentityURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DisableIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DisableIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DisableIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DisableIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DisableIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DisableIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs.go deleted file mode 100644 index c83949bb7..000000000 --- a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DisassociateIdentitysServiceConfigsHandlerFunc turns a function with the right signature into a disassociate identitys service configs handler -type DisassociateIdentitysServiceConfigsHandlerFunc func(DisassociateIdentitysServiceConfigsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DisassociateIdentitysServiceConfigsHandlerFunc) Handle(params DisassociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DisassociateIdentitysServiceConfigsHandler interface for that can handle valid disassociate identitys service configs params -type DisassociateIdentitysServiceConfigsHandler interface { - Handle(DisassociateIdentitysServiceConfigsParams, interface{}) middleware.Responder -} - -// NewDisassociateIdentitysServiceConfigs creates a new http.Handler for the disassociate identitys service configs operation -func NewDisassociateIdentitysServiceConfigs(ctx *middleware.Context, handler DisassociateIdentitysServiceConfigsHandler) *DisassociateIdentitysServiceConfigs { - return &DisassociateIdentitysServiceConfigs{Context: ctx, Handler: handler} -} - -/* DisassociateIdentitysServiceConfigs swagger:route DELETE /identities/{id}/service-configs Identity disassociateIdentitysServiceConfigs - -Remove associated service configs from a specific identity - -Remove service configs from a specific identity - -*/ -type DisassociateIdentitysServiceConfigs struct { - Context *middleware.Context - Handler DisassociateIdentitysServiceConfigsHandler -} - -func (o *DisassociateIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDisassociateIdentitysServiceConfigsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_parameters.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_parameters.go deleted file mode 100644 index 9bf95ca34..000000000 --- a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewDisassociateIdentitysServiceConfigsParams creates a new DisassociateIdentitysServiceConfigsParams object -// -// There are no default values defined in the spec. -func NewDisassociateIdentitysServiceConfigsParams() DisassociateIdentitysServiceConfigsParams { - - return DisassociateIdentitysServiceConfigsParams{} -} - -// DisassociateIdentitysServiceConfigsParams contains all the bound params for the disassociate identitys service configs operation -// typically these are obtained from a http.Request -// -// swagger:parameters disassociateIdentitysServiceConfigs -type DisassociateIdentitysServiceConfigsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*An array of service and config id pairs to remove - In: body - */ - ServiceConfigIDPairs rest_model.ServiceConfigsAssignList -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDisassociateIdentitysServiceConfigsParams() beforehand. -func (o *DisassociateIdentitysServiceConfigsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceConfigsAssignList - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("serviceConfigIdPairs", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ServiceConfigIDPairs = body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DisassociateIdentitysServiceConfigsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_responses.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_responses.go deleted file mode 100644 index 2d3cdf9b1..000000000 --- a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DisassociateIdentitysServiceConfigsOKCode is the HTTP code returned for type DisassociateIdentitysServiceConfigsOK -const DisassociateIdentitysServiceConfigsOKCode int = 200 - -/*DisassociateIdentitysServiceConfigsOK Base empty response - -swagger:response disassociateIdentitysServiceConfigsOK -*/ -type DisassociateIdentitysServiceConfigsOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDisassociateIdentitysServiceConfigsOK creates DisassociateIdentitysServiceConfigsOK with default headers values -func NewDisassociateIdentitysServiceConfigsOK() *DisassociateIdentitysServiceConfigsOK { - - return &DisassociateIdentitysServiceConfigsOK{} -} - -// WithPayload adds the payload to the disassociate identitys service configs o k response -func (o *DisassociateIdentitysServiceConfigsOK) WithPayload(payload *rest_model.Empty) *DisassociateIdentitysServiceConfigsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disassociate identitys service configs o k response -func (o *DisassociateIdentitysServiceConfigsOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisassociateIdentitysServiceConfigsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DisassociateIdentitysServiceConfigsBadRequestCode is the HTTP code returned for type DisassociateIdentitysServiceConfigsBadRequest -const DisassociateIdentitysServiceConfigsBadRequestCode int = 400 - -/*DisassociateIdentitysServiceConfigsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response disassociateIdentitysServiceConfigsBadRequest -*/ -type DisassociateIdentitysServiceConfigsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDisassociateIdentitysServiceConfigsBadRequest creates DisassociateIdentitysServiceConfigsBadRequest with default headers values -func NewDisassociateIdentitysServiceConfigsBadRequest() *DisassociateIdentitysServiceConfigsBadRequest { - - return &DisassociateIdentitysServiceConfigsBadRequest{} -} - -// WithPayload adds the payload to the disassociate identitys service configs bad request response -func (o *DisassociateIdentitysServiceConfigsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DisassociateIdentitysServiceConfigsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disassociate identitys service configs bad request response -func (o *DisassociateIdentitysServiceConfigsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisassociateIdentitysServiceConfigsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DisassociateIdentitysServiceConfigsUnauthorizedCode is the HTTP code returned for type DisassociateIdentitysServiceConfigsUnauthorized -const DisassociateIdentitysServiceConfigsUnauthorizedCode int = 401 - -/*DisassociateIdentitysServiceConfigsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response disassociateIdentitysServiceConfigsUnauthorized -*/ -type DisassociateIdentitysServiceConfigsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDisassociateIdentitysServiceConfigsUnauthorized creates DisassociateIdentitysServiceConfigsUnauthorized with default headers values -func NewDisassociateIdentitysServiceConfigsUnauthorized() *DisassociateIdentitysServiceConfigsUnauthorized { - - return &DisassociateIdentitysServiceConfigsUnauthorized{} -} - -// WithPayload adds the payload to the disassociate identitys service configs unauthorized response -func (o *DisassociateIdentitysServiceConfigsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DisassociateIdentitysServiceConfigsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disassociate identitys service configs unauthorized response -func (o *DisassociateIdentitysServiceConfigsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisassociateIdentitysServiceConfigsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DisassociateIdentitysServiceConfigsNotFoundCode is the HTTP code returned for type DisassociateIdentitysServiceConfigsNotFound -const DisassociateIdentitysServiceConfigsNotFoundCode int = 404 - -/*DisassociateIdentitysServiceConfigsNotFound The requested resource does not exist - -swagger:response disassociateIdentitysServiceConfigsNotFound -*/ -type DisassociateIdentitysServiceConfigsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDisassociateIdentitysServiceConfigsNotFound creates DisassociateIdentitysServiceConfigsNotFound with default headers values -func NewDisassociateIdentitysServiceConfigsNotFound() *DisassociateIdentitysServiceConfigsNotFound { - - return &DisassociateIdentitysServiceConfigsNotFound{} -} - -// WithPayload adds the payload to the disassociate identitys service configs not found response -func (o *DisassociateIdentitysServiceConfigsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DisassociateIdentitysServiceConfigsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the disassociate identitys service configs not found response -func (o *DisassociateIdentitysServiceConfigsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DisassociateIdentitysServiceConfigsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go b/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go deleted file mode 100644 index 6ae058b5d..000000000 --- a/rest_management_api_server/operations/identity/disassociate_identitys_service_configs_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DisassociateIdentitysServiceConfigsURL generates an URL for the disassociate identitys service configs operation -type DisassociateIdentitysServiceConfigsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DisassociateIdentitysServiceConfigsURL) WithBasePath(bp string) *DisassociateIdentitysServiceConfigsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DisassociateIdentitysServiceConfigsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DisassociateIdentitysServiceConfigsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/service-configs" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DisassociateIdentitysServiceConfigsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DisassociateIdentitysServiceConfigsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DisassociateIdentitysServiceConfigsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DisassociateIdentitysServiceConfigsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DisassociateIdentitysServiceConfigsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DisassociateIdentitysServiceConfigsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DisassociateIdentitysServiceConfigsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/enable_identity.go b/rest_management_api_server/operations/identity/enable_identity.go deleted file mode 100644 index b6d6c83f7..000000000 --- a/rest_management_api_server/operations/identity/enable_identity.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// EnableIdentityHandlerFunc turns a function with the right signature into a enable identity handler -type EnableIdentityHandlerFunc func(EnableIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn EnableIdentityHandlerFunc) Handle(params EnableIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// EnableIdentityHandler interface for that can handle valid enable identity params -type EnableIdentityHandler interface { - Handle(EnableIdentityParams, interface{}) middleware.Responder -} - -// NewEnableIdentity creates a new http.Handler for the enable identity operation -func NewEnableIdentity(ctx *middleware.Context, handler EnableIdentityHandler) *EnableIdentity { - return &EnableIdentity{Context: ctx, Handler: handler} -} - -/* EnableIdentity swagger:route POST /identities/{id}/enable Identity enableIdentity - -Clears all disabled state from an identity - -Allows an admin to remove disabled statuses from an identity. - - -*/ -type EnableIdentity struct { - Context *middleware.Context - Handler EnableIdentityHandler -} - -func (o *EnableIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewEnableIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/enable_identity_parameters.go b/rest_management_api_server/operations/identity/enable_identity_parameters.go deleted file mode 100644 index b6f030ce9..000000000 --- a/rest_management_api_server/operations/identity/enable_identity_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewEnableIdentityParams creates a new EnableIdentityParams object -// -// There are no default values defined in the spec. -func NewEnableIdentityParams() EnableIdentityParams { - - return EnableIdentityParams{} -} - -// EnableIdentityParams contains all the bound params for the enable identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters enableIdentity -type EnableIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewEnableIdentityParams() beforehand. -func (o *EnableIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *EnableIdentityParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/enable_identity_responses.go b/rest_management_api_server/operations/identity/enable_identity_responses.go deleted file mode 100644 index 5efdbdbc9..000000000 --- a/rest_management_api_server/operations/identity/enable_identity_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// EnableIdentityOKCode is the HTTP code returned for type EnableIdentityOK -const EnableIdentityOKCode int = 200 - -/*EnableIdentityOK Base empty response - -swagger:response enableIdentityOK -*/ -type EnableIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewEnableIdentityOK creates EnableIdentityOK with default headers values -func NewEnableIdentityOK() *EnableIdentityOK { - - return &EnableIdentityOK{} -} - -// WithPayload adds the payload to the enable identity o k response -func (o *EnableIdentityOK) WithPayload(payload *rest_model.Empty) *EnableIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enable identity o k response -func (o *EnableIdentityOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnableIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnableIdentityUnauthorizedCode is the HTTP code returned for type EnableIdentityUnauthorized -const EnableIdentityUnauthorizedCode int = 401 - -/*EnableIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response enableIdentityUnauthorized -*/ -type EnableIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnableIdentityUnauthorized creates EnableIdentityUnauthorized with default headers values -func NewEnableIdentityUnauthorized() *EnableIdentityUnauthorized { - - return &EnableIdentityUnauthorized{} -} - -// WithPayload adds the payload to the enable identity unauthorized response -func (o *EnableIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *EnableIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enable identity unauthorized response -func (o *EnableIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnableIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// EnableIdentityNotFoundCode is the HTTP code returned for type EnableIdentityNotFound -const EnableIdentityNotFoundCode int = 404 - -/*EnableIdentityNotFound The requested resource does not exist - -swagger:response enableIdentityNotFound -*/ -type EnableIdentityNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewEnableIdentityNotFound creates EnableIdentityNotFound with default headers values -func NewEnableIdentityNotFound() *EnableIdentityNotFound { - - return &EnableIdentityNotFound{} -} - -// WithPayload adds the payload to the enable identity not found response -func (o *EnableIdentityNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *EnableIdentityNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the enable identity not found response -func (o *EnableIdentityNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *EnableIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/enable_identity_urlbuilder.go b/rest_management_api_server/operations/identity/enable_identity_urlbuilder.go deleted file mode 100644 index 17161d099..000000000 --- a/rest_management_api_server/operations/identity/enable_identity_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// EnableIdentityURL generates an URL for the enable identity operation -type EnableIdentityURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnableIdentityURL) WithBasePath(bp string) *EnableIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *EnableIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *EnableIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/enable" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on EnableIdentityURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *EnableIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *EnableIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *EnableIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on EnableIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on EnableIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *EnableIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/get_identity_authenticators.go b/rest_management_api_server/operations/identity/get_identity_authenticators.go deleted file mode 100644 index 9558570e4..000000000 --- a/rest_management_api_server/operations/identity/get_identity_authenticators.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetIdentityAuthenticatorsHandlerFunc turns a function with the right signature into a get identity authenticators handler -type GetIdentityAuthenticatorsHandlerFunc func(GetIdentityAuthenticatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetIdentityAuthenticatorsHandlerFunc) Handle(params GetIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetIdentityAuthenticatorsHandler interface for that can handle valid get identity authenticators params -type GetIdentityAuthenticatorsHandler interface { - Handle(GetIdentityAuthenticatorsParams, interface{}) middleware.Responder -} - -// NewGetIdentityAuthenticators creates a new http.Handler for the get identity authenticators operation -func NewGetIdentityAuthenticators(ctx *middleware.Context, handler GetIdentityAuthenticatorsHandler) *GetIdentityAuthenticators { - return &GetIdentityAuthenticators{Context: ctx, Handler: handler} -} - -/* GetIdentityAuthenticators swagger:route GET /identities/{id}/authenticators Identity getIdentityAuthenticators - -Retrieve the current authenticators of a specific identity - -Returns a list of authenticators associated to the identity specified - - -*/ -type GetIdentityAuthenticators struct { - Context *middleware.Context - Handler GetIdentityAuthenticatorsHandler -} - -func (o *GetIdentityAuthenticators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetIdentityAuthenticatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/get_identity_authenticators_parameters.go b/rest_management_api_server/operations/identity/get_identity_authenticators_parameters.go deleted file mode 100644 index 685e2806a..000000000 --- a/rest_management_api_server/operations/identity/get_identity_authenticators_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityAuthenticatorsParams creates a new GetIdentityAuthenticatorsParams object -// -// There are no default values defined in the spec. -func NewGetIdentityAuthenticatorsParams() GetIdentityAuthenticatorsParams { - - return GetIdentityAuthenticatorsParams{} -} - -// GetIdentityAuthenticatorsParams contains all the bound params for the get identity authenticators operation -// typically these are obtained from a http.Request -// -// swagger:parameters getIdentityAuthenticators -type GetIdentityAuthenticatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetIdentityAuthenticatorsParams() beforehand. -func (o *GetIdentityAuthenticatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetIdentityAuthenticatorsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/get_identity_authenticators_responses.go b/rest_management_api_server/operations/identity/get_identity_authenticators_responses.go deleted file mode 100644 index 147324b1f..000000000 --- a/rest_management_api_server/operations/identity/get_identity_authenticators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityAuthenticatorsOKCode is the HTTP code returned for type GetIdentityAuthenticatorsOK -const GetIdentityAuthenticatorsOKCode int = 200 - -/*GetIdentityAuthenticatorsOK A list of authenticators - -swagger:response getIdentityAuthenticatorsOK -*/ -type GetIdentityAuthenticatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListAuthenticatorsEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityAuthenticatorsOK creates GetIdentityAuthenticatorsOK with default headers values -func NewGetIdentityAuthenticatorsOK() *GetIdentityAuthenticatorsOK { - - return &GetIdentityAuthenticatorsOK{} -} - -// WithPayload adds the payload to the get identity authenticators o k response -func (o *GetIdentityAuthenticatorsOK) WithPayload(payload *rest_model.ListAuthenticatorsEnvelope) *GetIdentityAuthenticatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity authenticators o k response -func (o *GetIdentityAuthenticatorsOK) SetPayload(payload *rest_model.ListAuthenticatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityAuthenticatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityAuthenticatorsUnauthorizedCode is the HTTP code returned for type GetIdentityAuthenticatorsUnauthorized -const GetIdentityAuthenticatorsUnauthorizedCode int = 401 - -/*GetIdentityAuthenticatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getIdentityAuthenticatorsUnauthorized -*/ -type GetIdentityAuthenticatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityAuthenticatorsUnauthorized creates GetIdentityAuthenticatorsUnauthorized with default headers values -func NewGetIdentityAuthenticatorsUnauthorized() *GetIdentityAuthenticatorsUnauthorized { - - return &GetIdentityAuthenticatorsUnauthorized{} -} - -// WithPayload adds the payload to the get identity authenticators unauthorized response -func (o *GetIdentityAuthenticatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityAuthenticatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity authenticators unauthorized response -func (o *GetIdentityAuthenticatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityAuthenticatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityAuthenticatorsNotFoundCode is the HTTP code returned for type GetIdentityAuthenticatorsNotFound -const GetIdentityAuthenticatorsNotFoundCode int = 404 - -/*GetIdentityAuthenticatorsNotFound The requested resource does not exist - -swagger:response getIdentityAuthenticatorsNotFound -*/ -type GetIdentityAuthenticatorsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityAuthenticatorsNotFound creates GetIdentityAuthenticatorsNotFound with default headers values -func NewGetIdentityAuthenticatorsNotFound() *GetIdentityAuthenticatorsNotFound { - - return &GetIdentityAuthenticatorsNotFound{} -} - -// WithPayload adds the payload to the get identity authenticators not found response -func (o *GetIdentityAuthenticatorsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityAuthenticatorsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity authenticators not found response -func (o *GetIdentityAuthenticatorsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityAuthenticatorsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/get_identity_authenticators_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_authenticators_urlbuilder.go deleted file mode 100644 index 667550abb..000000000 --- a/rest_management_api_server/operations/identity/get_identity_authenticators_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetIdentityAuthenticatorsURL generates an URL for the get identity authenticators operation -type GetIdentityAuthenticatorsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityAuthenticatorsURL) WithBasePath(bp string) *GetIdentityAuthenticatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityAuthenticatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetIdentityAuthenticatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/authenticators" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetIdentityAuthenticatorsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetIdentityAuthenticatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetIdentityAuthenticatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetIdentityAuthenticatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetIdentityAuthenticatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetIdentityAuthenticatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetIdentityAuthenticatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/get_identity_enrollments.go b/rest_management_api_server/operations/identity/get_identity_enrollments.go deleted file mode 100644 index 9315ea865..000000000 --- a/rest_management_api_server/operations/identity/get_identity_enrollments.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetIdentityEnrollmentsHandlerFunc turns a function with the right signature into a get identity enrollments handler -type GetIdentityEnrollmentsHandlerFunc func(GetIdentityEnrollmentsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetIdentityEnrollmentsHandlerFunc) Handle(params GetIdentityEnrollmentsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetIdentityEnrollmentsHandler interface for that can handle valid get identity enrollments params -type GetIdentityEnrollmentsHandler interface { - Handle(GetIdentityEnrollmentsParams, interface{}) middleware.Responder -} - -// NewGetIdentityEnrollments creates a new http.Handler for the get identity enrollments operation -func NewGetIdentityEnrollments(ctx *middleware.Context, handler GetIdentityEnrollmentsHandler) *GetIdentityEnrollments { - return &GetIdentityEnrollments{Context: ctx, Handler: handler} -} - -/* GetIdentityEnrollments swagger:route GET /identities/{id}/enrollments Identity getIdentityEnrollments - -Retrieve the current enrollments of a specific identity - -Returns a list of enrollments associated to the identity specified - - -*/ -type GetIdentityEnrollments struct { - Context *middleware.Context - Handler GetIdentityEnrollmentsHandler -} - -func (o *GetIdentityEnrollments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetIdentityEnrollmentsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/get_identity_enrollments_parameters.go b/rest_management_api_server/operations/identity/get_identity_enrollments_parameters.go deleted file mode 100644 index 23e98dd07..000000000 --- a/rest_management_api_server/operations/identity/get_identity_enrollments_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityEnrollmentsParams creates a new GetIdentityEnrollmentsParams object -// -// There are no default values defined in the spec. -func NewGetIdentityEnrollmentsParams() GetIdentityEnrollmentsParams { - - return GetIdentityEnrollmentsParams{} -} - -// GetIdentityEnrollmentsParams contains all the bound params for the get identity enrollments operation -// typically these are obtained from a http.Request -// -// swagger:parameters getIdentityEnrollments -type GetIdentityEnrollmentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetIdentityEnrollmentsParams() beforehand. -func (o *GetIdentityEnrollmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetIdentityEnrollmentsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/get_identity_enrollments_responses.go b/rest_management_api_server/operations/identity/get_identity_enrollments_responses.go deleted file mode 100644 index d7f2b44d1..000000000 --- a/rest_management_api_server/operations/identity/get_identity_enrollments_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityEnrollmentsOKCode is the HTTP code returned for type GetIdentityEnrollmentsOK -const GetIdentityEnrollmentsOKCode int = 200 - -/*GetIdentityEnrollmentsOK A list of enrollments - -swagger:response getIdentityEnrollmentsOK -*/ -type GetIdentityEnrollmentsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEnrollmentsEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityEnrollmentsOK creates GetIdentityEnrollmentsOK with default headers values -func NewGetIdentityEnrollmentsOK() *GetIdentityEnrollmentsOK { - - return &GetIdentityEnrollmentsOK{} -} - -// WithPayload adds the payload to the get identity enrollments o k response -func (o *GetIdentityEnrollmentsOK) WithPayload(payload *rest_model.ListEnrollmentsEnvelope) *GetIdentityEnrollmentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity enrollments o k response -func (o *GetIdentityEnrollmentsOK) SetPayload(payload *rest_model.ListEnrollmentsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityEnrollmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityEnrollmentsUnauthorizedCode is the HTTP code returned for type GetIdentityEnrollmentsUnauthorized -const GetIdentityEnrollmentsUnauthorizedCode int = 401 - -/*GetIdentityEnrollmentsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getIdentityEnrollmentsUnauthorized -*/ -type GetIdentityEnrollmentsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityEnrollmentsUnauthorized creates GetIdentityEnrollmentsUnauthorized with default headers values -func NewGetIdentityEnrollmentsUnauthorized() *GetIdentityEnrollmentsUnauthorized { - - return &GetIdentityEnrollmentsUnauthorized{} -} - -// WithPayload adds the payload to the get identity enrollments unauthorized response -func (o *GetIdentityEnrollmentsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityEnrollmentsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity enrollments unauthorized response -func (o *GetIdentityEnrollmentsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityEnrollmentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityEnrollmentsNotFoundCode is the HTTP code returned for type GetIdentityEnrollmentsNotFound -const GetIdentityEnrollmentsNotFoundCode int = 404 - -/*GetIdentityEnrollmentsNotFound The requested resource does not exist - -swagger:response getIdentityEnrollmentsNotFound -*/ -type GetIdentityEnrollmentsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityEnrollmentsNotFound creates GetIdentityEnrollmentsNotFound with default headers values -func NewGetIdentityEnrollmentsNotFound() *GetIdentityEnrollmentsNotFound { - - return &GetIdentityEnrollmentsNotFound{} -} - -// WithPayload adds the payload to the get identity enrollments not found response -func (o *GetIdentityEnrollmentsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityEnrollmentsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity enrollments not found response -func (o *GetIdentityEnrollmentsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityEnrollmentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/get_identity_enrollments_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_enrollments_urlbuilder.go deleted file mode 100644 index 20691bc94..000000000 --- a/rest_management_api_server/operations/identity/get_identity_enrollments_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetIdentityEnrollmentsURL generates an URL for the get identity enrollments operation -type GetIdentityEnrollmentsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityEnrollmentsURL) WithBasePath(bp string) *GetIdentityEnrollmentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityEnrollmentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetIdentityEnrollmentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/enrollments" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetIdentityEnrollmentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetIdentityEnrollmentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetIdentityEnrollmentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetIdentityEnrollmentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetIdentityEnrollmentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetIdentityEnrollmentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetIdentityEnrollmentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/get_identity_failed_service_requests.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests.go deleted file mode 100644 index d63bf9feb..000000000 --- a/rest_management_api_server/operations/identity/get_identity_failed_service_requests.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetIdentityFailedServiceRequestsHandlerFunc turns a function with the right signature into a get identity failed service requests handler -type GetIdentityFailedServiceRequestsHandlerFunc func(GetIdentityFailedServiceRequestsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetIdentityFailedServiceRequestsHandlerFunc) Handle(params GetIdentityFailedServiceRequestsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetIdentityFailedServiceRequestsHandler interface for that can handle valid get identity failed service requests params -type GetIdentityFailedServiceRequestsHandler interface { - Handle(GetIdentityFailedServiceRequestsParams, interface{}) middleware.Responder -} - -// NewGetIdentityFailedServiceRequests creates a new http.Handler for the get identity failed service requests operation -func NewGetIdentityFailedServiceRequests(ctx *middleware.Context, handler GetIdentityFailedServiceRequestsHandler) *GetIdentityFailedServiceRequests { - return &GetIdentityFailedServiceRequests{Context: ctx, Handler: handler} -} - -/* GetIdentityFailedServiceRequests swagger:route GET /identities/{id}/failed-service-requests Identity getIdentityFailedServiceRequests - -Retrieve a list of the most recent service failure requests due to posture checks - -Returns a list of service session requests that failed due to posture checks. The entries will contain -every policy that was verified against and every failed check in each policy. Each check will include -the historical posture data and posture check configuration. - - -*/ -type GetIdentityFailedServiceRequests struct { - Context *middleware.Context - Handler GetIdentityFailedServiceRequestsHandler -} - -func (o *GetIdentityFailedServiceRequests) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetIdentityFailedServiceRequestsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/get_identity_failed_service_requests_parameters.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_parameters.go deleted file mode 100644 index 921153648..000000000 --- a/rest_management_api_server/operations/identity/get_identity_failed_service_requests_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityFailedServiceRequestsParams creates a new GetIdentityFailedServiceRequestsParams object -// -// There are no default values defined in the spec. -func NewGetIdentityFailedServiceRequestsParams() GetIdentityFailedServiceRequestsParams { - - return GetIdentityFailedServiceRequestsParams{} -} - -// GetIdentityFailedServiceRequestsParams contains all the bound params for the get identity failed service requests operation -// typically these are obtained from a http.Request -// -// swagger:parameters getIdentityFailedServiceRequests -type GetIdentityFailedServiceRequestsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetIdentityFailedServiceRequestsParams() beforehand. -func (o *GetIdentityFailedServiceRequestsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetIdentityFailedServiceRequestsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/get_identity_failed_service_requests_responses.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_responses.go deleted file mode 100644 index f14965bd7..000000000 --- a/rest_management_api_server/operations/identity/get_identity_failed_service_requests_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityFailedServiceRequestsOKCode is the HTTP code returned for type GetIdentityFailedServiceRequestsOK -const GetIdentityFailedServiceRequestsOKCode int = 200 - -/*GetIdentityFailedServiceRequestsOK Returns a list of service request failures - -swagger:response getIdentityFailedServiceRequestsOK -*/ -type GetIdentityFailedServiceRequestsOK struct { - - /* - In: Body - */ - Payload *rest_model.FailedServiceRequestEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityFailedServiceRequestsOK creates GetIdentityFailedServiceRequestsOK with default headers values -func NewGetIdentityFailedServiceRequestsOK() *GetIdentityFailedServiceRequestsOK { - - return &GetIdentityFailedServiceRequestsOK{} -} - -// WithPayload adds the payload to the get identity failed service requests o k response -func (o *GetIdentityFailedServiceRequestsOK) WithPayload(payload *rest_model.FailedServiceRequestEnvelope) *GetIdentityFailedServiceRequestsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity failed service requests o k response -func (o *GetIdentityFailedServiceRequestsOK) SetPayload(payload *rest_model.FailedServiceRequestEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityFailedServiceRequestsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityFailedServiceRequestsUnauthorizedCode is the HTTP code returned for type GetIdentityFailedServiceRequestsUnauthorized -const GetIdentityFailedServiceRequestsUnauthorizedCode int = 401 - -/*GetIdentityFailedServiceRequestsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getIdentityFailedServiceRequestsUnauthorized -*/ -type GetIdentityFailedServiceRequestsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityFailedServiceRequestsUnauthorized creates GetIdentityFailedServiceRequestsUnauthorized with default headers values -func NewGetIdentityFailedServiceRequestsUnauthorized() *GetIdentityFailedServiceRequestsUnauthorized { - - return &GetIdentityFailedServiceRequestsUnauthorized{} -} - -// WithPayload adds the payload to the get identity failed service requests unauthorized response -func (o *GetIdentityFailedServiceRequestsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityFailedServiceRequestsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity failed service requests unauthorized response -func (o *GetIdentityFailedServiceRequestsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityFailedServiceRequestsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityFailedServiceRequestsNotFoundCode is the HTTP code returned for type GetIdentityFailedServiceRequestsNotFound -const GetIdentityFailedServiceRequestsNotFoundCode int = 404 - -/*GetIdentityFailedServiceRequestsNotFound The requested resource does not exist - -swagger:response getIdentityFailedServiceRequestsNotFound -*/ -type GetIdentityFailedServiceRequestsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityFailedServiceRequestsNotFound creates GetIdentityFailedServiceRequestsNotFound with default headers values -func NewGetIdentityFailedServiceRequestsNotFound() *GetIdentityFailedServiceRequestsNotFound { - - return &GetIdentityFailedServiceRequestsNotFound{} -} - -// WithPayload adds the payload to the get identity failed service requests not found response -func (o *GetIdentityFailedServiceRequestsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityFailedServiceRequestsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity failed service requests not found response -func (o *GetIdentityFailedServiceRequestsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityFailedServiceRequestsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go deleted file mode 100644 index f44e06bac..000000000 --- a/rest_management_api_server/operations/identity/get_identity_failed_service_requests_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetIdentityFailedServiceRequestsURL generates an URL for the get identity failed service requests operation -type GetIdentityFailedServiceRequestsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityFailedServiceRequestsURL) WithBasePath(bp string) *GetIdentityFailedServiceRequestsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityFailedServiceRequestsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetIdentityFailedServiceRequestsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/failed-service-requests" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetIdentityFailedServiceRequestsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetIdentityFailedServiceRequestsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetIdentityFailedServiceRequestsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetIdentityFailedServiceRequestsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetIdentityFailedServiceRequestsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetIdentityFailedServiceRequestsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetIdentityFailedServiceRequestsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/get_identity_policy_advice.go b/rest_management_api_server/operations/identity/get_identity_policy_advice.go deleted file mode 100644 index 6acb53ba4..000000000 --- a/rest_management_api_server/operations/identity/get_identity_policy_advice.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetIdentityPolicyAdviceHandlerFunc turns a function with the right signature into a get identity policy advice handler -type GetIdentityPolicyAdviceHandlerFunc func(GetIdentityPolicyAdviceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetIdentityPolicyAdviceHandlerFunc) Handle(params GetIdentityPolicyAdviceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetIdentityPolicyAdviceHandler interface for that can handle valid get identity policy advice params -type GetIdentityPolicyAdviceHandler interface { - Handle(GetIdentityPolicyAdviceParams, interface{}) middleware.Responder -} - -// NewGetIdentityPolicyAdvice creates a new http.Handler for the get identity policy advice operation -func NewGetIdentityPolicyAdvice(ctx *middleware.Context, handler GetIdentityPolicyAdviceHandler) *GetIdentityPolicyAdvice { - return &GetIdentityPolicyAdvice{Context: ctx, Handler: handler} -} - -/* GetIdentityPolicyAdvice swagger:route GET /identities/{id}/policy-advice/{serviceId} Identity getIdentityPolicyAdvice - -Analyze policies relating the given identity and service - -Analyzes policies to see if the given identity should be able to dial or bind the given service. | -Will check services policies to see if the identity can access the service. Will check edge router policies | -to check if the identity and service have access to common edge routers so that a connnection can be made. | -Will also check if at least one edge router is on-line. Requires admin access. - - -*/ -type GetIdentityPolicyAdvice struct { - Context *middleware.Context - Handler GetIdentityPolicyAdviceHandler -} - -func (o *GetIdentityPolicyAdvice) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetIdentityPolicyAdviceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/get_identity_policy_advice_parameters.go b/rest_management_api_server/operations/identity/get_identity_policy_advice_parameters.go deleted file mode 100644 index f44a05dbd..000000000 --- a/rest_management_api_server/operations/identity/get_identity_policy_advice_parameters.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityPolicyAdviceParams creates a new GetIdentityPolicyAdviceParams object -// -// There are no default values defined in the spec. -func NewGetIdentityPolicyAdviceParams() GetIdentityPolicyAdviceParams { - - return GetIdentityPolicyAdviceParams{} -} - -// GetIdentityPolicyAdviceParams contains all the bound params for the get identity policy advice operation -// typically these are obtained from a http.Request -// -// swagger:parameters getIdentityPolicyAdvice -type GetIdentityPolicyAdviceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*The id of a service - Required: true - In: path - */ - ServiceID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetIdentityPolicyAdviceParams() beforehand. -func (o *GetIdentityPolicyAdviceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - rServiceID, rhkServiceID, _ := route.Params.GetOK("serviceId") - if err := o.bindServiceID(rServiceID, rhkServiceID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetIdentityPolicyAdviceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindServiceID binds and validates parameter ServiceID from path. -func (o *GetIdentityPolicyAdviceParams) bindServiceID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ServiceID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/get_identity_policy_advice_responses.go b/rest_management_api_server/operations/identity/get_identity_policy_advice_responses.go deleted file mode 100644 index d24c74327..000000000 --- a/rest_management_api_server/operations/identity/get_identity_policy_advice_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityPolicyAdviceOKCode is the HTTP code returned for type GetIdentityPolicyAdviceOK -const GetIdentityPolicyAdviceOKCode int = 200 - -/*GetIdentityPolicyAdviceOK Returns the document that represents the policy advice - -swagger:response getIdentityPolicyAdviceOK -*/ -type GetIdentityPolicyAdviceOK struct { - - /* - In: Body - */ - Payload *rest_model.GetIdentityPolicyAdviceEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityPolicyAdviceOK creates GetIdentityPolicyAdviceOK with default headers values -func NewGetIdentityPolicyAdviceOK() *GetIdentityPolicyAdviceOK { - - return &GetIdentityPolicyAdviceOK{} -} - -// WithPayload adds the payload to the get identity policy advice o k response -func (o *GetIdentityPolicyAdviceOK) WithPayload(payload *rest_model.GetIdentityPolicyAdviceEnvelope) *GetIdentityPolicyAdviceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity policy advice o k response -func (o *GetIdentityPolicyAdviceOK) SetPayload(payload *rest_model.GetIdentityPolicyAdviceEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityPolicyAdviceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityPolicyAdviceUnauthorizedCode is the HTTP code returned for type GetIdentityPolicyAdviceUnauthorized -const GetIdentityPolicyAdviceUnauthorizedCode int = 401 - -/*GetIdentityPolicyAdviceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getIdentityPolicyAdviceUnauthorized -*/ -type GetIdentityPolicyAdviceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityPolicyAdviceUnauthorized creates GetIdentityPolicyAdviceUnauthorized with default headers values -func NewGetIdentityPolicyAdviceUnauthorized() *GetIdentityPolicyAdviceUnauthorized { - - return &GetIdentityPolicyAdviceUnauthorized{} -} - -// WithPayload adds the payload to the get identity policy advice unauthorized response -func (o *GetIdentityPolicyAdviceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityPolicyAdviceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity policy advice unauthorized response -func (o *GetIdentityPolicyAdviceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityPolicyAdviceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityPolicyAdviceNotFoundCode is the HTTP code returned for type GetIdentityPolicyAdviceNotFound -const GetIdentityPolicyAdviceNotFoundCode int = 404 - -/*GetIdentityPolicyAdviceNotFound The requested resource does not exist - -swagger:response getIdentityPolicyAdviceNotFound -*/ -type GetIdentityPolicyAdviceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityPolicyAdviceNotFound creates GetIdentityPolicyAdviceNotFound with default headers values -func NewGetIdentityPolicyAdviceNotFound() *GetIdentityPolicyAdviceNotFound { - - return &GetIdentityPolicyAdviceNotFound{} -} - -// WithPayload adds the payload to the get identity policy advice not found response -func (o *GetIdentityPolicyAdviceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityPolicyAdviceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity policy advice not found response -func (o *GetIdentityPolicyAdviceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityPolicyAdviceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/get_identity_policy_advice_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_policy_advice_urlbuilder.go deleted file mode 100644 index d2bf6eaed..000000000 --- a/rest_management_api_server/operations/identity/get_identity_policy_advice_urlbuilder.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetIdentityPolicyAdviceURL generates an URL for the get identity policy advice operation -type GetIdentityPolicyAdviceURL struct { - ID string - ServiceID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityPolicyAdviceURL) WithBasePath(bp string) *GetIdentityPolicyAdviceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityPolicyAdviceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetIdentityPolicyAdviceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/policy-advice/{serviceId}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetIdentityPolicyAdviceURL") - } - - serviceID := o.ServiceID - if serviceID != "" { - _path = strings.Replace(_path, "{serviceId}", serviceID, -1) - } else { - return nil, errors.New("serviceId is required on GetIdentityPolicyAdviceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetIdentityPolicyAdviceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetIdentityPolicyAdviceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetIdentityPolicyAdviceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetIdentityPolicyAdviceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetIdentityPolicyAdviceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetIdentityPolicyAdviceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/get_identity_posture_data.go b/rest_management_api_server/operations/identity/get_identity_posture_data.go deleted file mode 100644 index 1a097d8b4..000000000 --- a/rest_management_api_server/operations/identity/get_identity_posture_data.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetIdentityPostureDataHandlerFunc turns a function with the right signature into a get identity posture data handler -type GetIdentityPostureDataHandlerFunc func(GetIdentityPostureDataParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetIdentityPostureDataHandlerFunc) Handle(params GetIdentityPostureDataParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// GetIdentityPostureDataHandler interface for that can handle valid get identity posture data params -type GetIdentityPostureDataHandler interface { - Handle(GetIdentityPostureDataParams, interface{}) middleware.Responder -} - -// NewGetIdentityPostureData creates a new http.Handler for the get identity posture data operation -func NewGetIdentityPostureData(ctx *middleware.Context, handler GetIdentityPostureDataHandler) *GetIdentityPostureData { - return &GetIdentityPostureData{Context: ctx, Handler: handler} -} - -/* GetIdentityPostureData swagger:route GET /identities/{id}/posture-data Identity getIdentityPostureData - -Retrieve the curent posture data for a specific identity. - -Returns a nested map data represeting the posture data of the identity. -This data should be considered volatile. - - -*/ -type GetIdentityPostureData struct { - Context *middleware.Context - Handler GetIdentityPostureDataHandler -} - -func (o *GetIdentityPostureData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetIdentityPostureDataParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/get_identity_posture_data_parameters.go b/rest_management_api_server/operations/identity/get_identity_posture_data_parameters.go deleted file mode 100644 index 592269f08..000000000 --- a/rest_management_api_server/operations/identity/get_identity_posture_data_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetIdentityPostureDataParams creates a new GetIdentityPostureDataParams object -// -// There are no default values defined in the spec. -func NewGetIdentityPostureDataParams() GetIdentityPostureDataParams { - - return GetIdentityPostureDataParams{} -} - -// GetIdentityPostureDataParams contains all the bound params for the get identity posture data operation -// typically these are obtained from a http.Request -// -// swagger:parameters getIdentityPostureData -type GetIdentityPostureDataParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetIdentityPostureDataParams() beforehand. -func (o *GetIdentityPostureDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *GetIdentityPostureDataParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/get_identity_posture_data_responses.go b/rest_management_api_server/operations/identity/get_identity_posture_data_responses.go deleted file mode 100644 index a03701ce0..000000000 --- a/rest_management_api_server/operations/identity/get_identity_posture_data_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// GetIdentityPostureDataOKCode is the HTTP code returned for type GetIdentityPostureDataOK -const GetIdentityPostureDataOKCode int = 200 - -/*GetIdentityPostureDataOK Returns the document that represents posture data - -swagger:response getIdentityPostureDataOK -*/ -type GetIdentityPostureDataOK struct { - - /* - In: Body - */ - Payload *rest_model.PostureDataEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityPostureDataOK creates GetIdentityPostureDataOK with default headers values -func NewGetIdentityPostureDataOK() *GetIdentityPostureDataOK { - - return &GetIdentityPostureDataOK{} -} - -// WithPayload adds the payload to the get identity posture data o k response -func (o *GetIdentityPostureDataOK) WithPayload(payload *rest_model.PostureDataEnvelope) *GetIdentityPostureDataOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity posture data o k response -func (o *GetIdentityPostureDataOK) SetPayload(payload *rest_model.PostureDataEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityPostureDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityPostureDataUnauthorizedCode is the HTTP code returned for type GetIdentityPostureDataUnauthorized -const GetIdentityPostureDataUnauthorizedCode int = 401 - -/*GetIdentityPostureDataUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response getIdentityPostureDataUnauthorized -*/ -type GetIdentityPostureDataUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityPostureDataUnauthorized creates GetIdentityPostureDataUnauthorized with default headers values -func NewGetIdentityPostureDataUnauthorized() *GetIdentityPostureDataUnauthorized { - - return &GetIdentityPostureDataUnauthorized{} -} - -// WithPayload adds the payload to the get identity posture data unauthorized response -func (o *GetIdentityPostureDataUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityPostureDataUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity posture data unauthorized response -func (o *GetIdentityPostureDataUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityPostureDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetIdentityPostureDataNotFoundCode is the HTTP code returned for type GetIdentityPostureDataNotFound -const GetIdentityPostureDataNotFoundCode int = 404 - -/*GetIdentityPostureDataNotFound The requested resource does not exist - -swagger:response getIdentityPostureDataNotFound -*/ -type GetIdentityPostureDataNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewGetIdentityPostureDataNotFound creates GetIdentityPostureDataNotFound with default headers values -func NewGetIdentityPostureDataNotFound() *GetIdentityPostureDataNotFound { - - return &GetIdentityPostureDataNotFound{} -} - -// WithPayload adds the payload to the get identity posture data not found response -func (o *GetIdentityPostureDataNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *GetIdentityPostureDataNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get identity posture data not found response -func (o *GetIdentityPostureDataNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetIdentityPostureDataNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/get_identity_posture_data_urlbuilder.go b/rest_management_api_server/operations/identity/get_identity_posture_data_urlbuilder.go deleted file mode 100644 index 4de35f448..000000000 --- a/rest_management_api_server/operations/identity/get_identity_posture_data_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetIdentityPostureDataURL generates an URL for the get identity posture data operation -type GetIdentityPostureDataURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityPostureDataURL) WithBasePath(bp string) *GetIdentityPostureDataURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetIdentityPostureDataURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetIdentityPostureDataURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/posture-data" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on GetIdentityPostureDataURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetIdentityPostureDataURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetIdentityPostureDataURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetIdentityPostureDataURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetIdentityPostureDataURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetIdentityPostureDataURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetIdentityPostureDataURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identities.go b/rest_management_api_server/operations/identity/list_identities.go deleted file mode 100644 index 4a123d738..000000000 --- a/rest_management_api_server/operations/identity/list_identities.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentitiesHandlerFunc turns a function with the right signature into a list identities handler -type ListIdentitiesHandlerFunc func(ListIdentitiesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentitiesHandlerFunc) Handle(params ListIdentitiesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentitiesHandler interface for that can handle valid list identities params -type ListIdentitiesHandler interface { - Handle(ListIdentitiesParams, interface{}) middleware.Responder -} - -// NewListIdentities creates a new http.Handler for the list identities operation -func NewListIdentities(ctx *middleware.Context, handler ListIdentitiesHandler) *ListIdentities { - return &ListIdentities{Context: ctx, Handler: handler} -} - -/* ListIdentities swagger:route GET /identities Identity listIdentities - -List identities - -Retrieves a list of identity resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListIdentities struct { - Context *middleware.Context - Handler ListIdentitiesHandler -} - -func (o *ListIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentitiesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identities_parameters.go b/rest_management_api_server/operations/identity/list_identities_parameters.go deleted file mode 100644 index 76b25b47e..000000000 --- a/rest_management_api_server/operations/identity/list_identities_parameters.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListIdentitiesParams creates a new ListIdentitiesParams object -// -// There are no default values defined in the spec. -func NewListIdentitiesParams() ListIdentitiesParams { - - return ListIdentitiesParams{} -} - -// ListIdentitiesParams contains all the bound params for the list identities operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentities -type ListIdentitiesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /* - In: query - Collection Format: multi - */ - RoleFilter []string - /* - In: query - */ - RoleSemantic *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentitiesParams() beforehand. -func (o *ListIdentitiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qRoleFilter, qhkRoleFilter, _ := qs.GetOK("roleFilter") - if err := o.bindRoleFilter(qRoleFilter, qhkRoleFilter, route.Formats); err != nil { - res = append(res, err) - } - - qRoleSemantic, qhkRoleSemantic, _ := qs.GetOK("roleSemantic") - if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListIdentitiesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListIdentitiesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListIdentitiesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindRoleFilter binds and validates array parameter RoleFilter from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *ListIdentitiesParams) bindRoleFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - roleFilterIC := rawData - if len(roleFilterIC) == 0 { - return nil - } - - var roleFilterIR []string - for _, roleFilterIV := range roleFilterIC { - roleFilterI := roleFilterIV - - roleFilterIR = append(roleFilterIR, roleFilterI) - } - - o.RoleFilter = roleFilterIR - - return nil -} - -// bindRoleSemantic binds and validates parameter RoleSemantic from query. -func (o *ListIdentitiesParams) bindRoleSemantic(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RoleSemantic = &raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identities_responses.go b/rest_management_api_server/operations/identity/list_identities_responses.go deleted file mode 100644 index 287ea7eb3..000000000 --- a/rest_management_api_server/operations/identity/list_identities_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentitiesOKCode is the HTTP code returned for type ListIdentitiesOK -const ListIdentitiesOKCode int = 200 - -/*ListIdentitiesOK A list of identities - -swagger:response listIdentitiesOK -*/ -type ListIdentitiesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListIdentitiesEnvelope `json:"body,omitempty"` -} - -// NewListIdentitiesOK creates ListIdentitiesOK with default headers values -func NewListIdentitiesOK() *ListIdentitiesOK { - - return &ListIdentitiesOK{} -} - -// WithPayload adds the payload to the list identities o k response -func (o *ListIdentitiesOK) WithPayload(payload *rest_model.ListIdentitiesEnvelope) *ListIdentitiesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identities o k response -func (o *ListIdentitiesOK) SetPayload(payload *rest_model.ListIdentitiesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentitiesBadRequestCode is the HTTP code returned for type ListIdentitiesBadRequest -const ListIdentitiesBadRequestCode int = 400 - -/*ListIdentitiesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listIdentitiesBadRequest -*/ -type ListIdentitiesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentitiesBadRequest creates ListIdentitiesBadRequest with default headers values -func NewListIdentitiesBadRequest() *ListIdentitiesBadRequest { - - return &ListIdentitiesBadRequest{} -} - -// WithPayload adds the payload to the list identities bad request response -func (o *ListIdentitiesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentitiesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identities bad request response -func (o *ListIdentitiesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentitiesUnauthorizedCode is the HTTP code returned for type ListIdentitiesUnauthorized -const ListIdentitiesUnauthorizedCode int = 401 - -/*ListIdentitiesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentitiesUnauthorized -*/ -type ListIdentitiesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentitiesUnauthorized creates ListIdentitiesUnauthorized with default headers values -func NewListIdentitiesUnauthorized() *ListIdentitiesUnauthorized { - - return &ListIdentitiesUnauthorized{} -} - -// WithPayload adds the payload to the list identities unauthorized response -func (o *ListIdentitiesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentitiesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identities unauthorized response -func (o *ListIdentitiesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitiesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identities_urlbuilder.go b/rest_management_api_server/operations/identity/list_identities_urlbuilder.go deleted file mode 100644 index 7a987f026..000000000 --- a/rest_management_api_server/operations/identity/list_identities_urlbuilder.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListIdentitiesURL generates an URL for the list identities operation -type ListIdentitiesURL struct { - Filter *string - Limit *int64 - Offset *int64 - RoleFilter []string - RoleSemantic *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentitiesURL) WithBasePath(bp string) *ListIdentitiesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentitiesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentitiesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var roleFilterIR []string - for _, roleFilterI := range o.RoleFilter { - roleFilterIS := roleFilterI - if roleFilterIS != "" { - roleFilterIR = append(roleFilterIR, roleFilterIS) - } - } - - roleFilter := swag.JoinByFormat(roleFilterIR, "multi") - - for _, qsv := range roleFilter { - qs.Add("roleFilter", qsv) - } - - var roleSemanticQ string - if o.RoleSemantic != nil { - roleSemanticQ = *o.RoleSemantic - } - if roleSemanticQ != "" { - qs.Set("roleSemantic", roleSemanticQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentitiesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentitiesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentitiesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentitiesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentitiesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentitiesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identity_edge_routers.go b/rest_management_api_server/operations/identity/list_identity_edge_routers.go deleted file mode 100644 index 0bb7ef48b..000000000 --- a/rest_management_api_server/operations/identity/list_identity_edge_routers.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentityEdgeRoutersHandlerFunc turns a function with the right signature into a list identity edge routers handler -type ListIdentityEdgeRoutersHandlerFunc func(ListIdentityEdgeRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentityEdgeRoutersHandlerFunc) Handle(params ListIdentityEdgeRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentityEdgeRoutersHandler interface for that can handle valid list identity edge routers params -type ListIdentityEdgeRoutersHandler interface { - Handle(ListIdentityEdgeRoutersParams, interface{}) middleware.Responder -} - -// NewListIdentityEdgeRouters creates a new http.Handler for the list identity edge routers operation -func NewListIdentityEdgeRouters(ctx *middleware.Context, handler ListIdentityEdgeRoutersHandler) *ListIdentityEdgeRouters { - return &ListIdentityEdgeRouters{Context: ctx, Handler: handler} -} - -/* ListIdentityEdgeRouters swagger:route GET /identities/{id}/edge-routers Identity listIdentityEdgeRouters - -List accessible edge-routers - -Retrieves a list of edge-routers that the given identity may use to access services. Supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListIdentityEdgeRouters struct { - Context *middleware.Context - Handler ListIdentityEdgeRoutersHandler -} - -func (o *ListIdentityEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentityEdgeRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identity_edge_routers_parameters.go b/rest_management_api_server/operations/identity/list_identity_edge_routers_parameters.go deleted file mode 100644 index 95315c97e..000000000 --- a/rest_management_api_server/operations/identity/list_identity_edge_routers_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListIdentityEdgeRoutersParams creates a new ListIdentityEdgeRoutersParams object -// -// There are no default values defined in the spec. -func NewListIdentityEdgeRoutersParams() ListIdentityEdgeRoutersParams { - - return ListIdentityEdgeRoutersParams{} -} - -// ListIdentityEdgeRoutersParams contains all the bound params for the list identity edge routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentityEdgeRouters -type ListIdentityEdgeRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentityEdgeRoutersParams() beforehand. -func (o *ListIdentityEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListIdentityEdgeRoutersParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identity_edge_routers_responses.go b/rest_management_api_server/operations/identity/list_identity_edge_routers_responses.go deleted file mode 100644 index cb78d3952..000000000 --- a/rest_management_api_server/operations/identity/list_identity_edge_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityEdgeRoutersOKCode is the HTTP code returned for type ListIdentityEdgeRoutersOK -const ListIdentityEdgeRoutersOKCode int = 200 - -/*ListIdentityEdgeRoutersOK A list of edge routers - -swagger:response listIdentityEdgeRoutersOK -*/ -type ListIdentityEdgeRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewListIdentityEdgeRoutersOK creates ListIdentityEdgeRoutersOK with default headers values -func NewListIdentityEdgeRoutersOK() *ListIdentityEdgeRoutersOK { - - return &ListIdentityEdgeRoutersOK{} -} - -// WithPayload adds the payload to the list identity edge routers o k response -func (o *ListIdentityEdgeRoutersOK) WithPayload(payload *rest_model.ListEdgeRoutersEnvelope) *ListIdentityEdgeRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity edge routers o k response -func (o *ListIdentityEdgeRoutersOK) SetPayload(payload *rest_model.ListEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityEdgeRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityEdgeRoutersUnauthorizedCode is the HTTP code returned for type ListIdentityEdgeRoutersUnauthorized -const ListIdentityEdgeRoutersUnauthorizedCode int = 401 - -/*ListIdentityEdgeRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentityEdgeRoutersUnauthorized -*/ -type ListIdentityEdgeRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityEdgeRoutersUnauthorized creates ListIdentityEdgeRoutersUnauthorized with default headers values -func NewListIdentityEdgeRoutersUnauthorized() *ListIdentityEdgeRoutersUnauthorized { - - return &ListIdentityEdgeRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list identity edge routers unauthorized response -func (o *ListIdentityEdgeRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityEdgeRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity edge routers unauthorized response -func (o *ListIdentityEdgeRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityEdgeRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityEdgeRoutersNotFoundCode is the HTTP code returned for type ListIdentityEdgeRoutersNotFound -const ListIdentityEdgeRoutersNotFoundCode int = 404 - -/*ListIdentityEdgeRoutersNotFound The requested resource does not exist - -swagger:response listIdentityEdgeRoutersNotFound -*/ -type ListIdentityEdgeRoutersNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityEdgeRoutersNotFound creates ListIdentityEdgeRoutersNotFound with default headers values -func NewListIdentityEdgeRoutersNotFound() *ListIdentityEdgeRoutersNotFound { - - return &ListIdentityEdgeRoutersNotFound{} -} - -// WithPayload adds the payload to the list identity edge routers not found response -func (o *ListIdentityEdgeRoutersNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityEdgeRoutersNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity edge routers not found response -func (o *ListIdentityEdgeRoutersNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityEdgeRoutersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identity_edge_routers_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_edge_routers_urlbuilder.go deleted file mode 100644 index 84cfb7a2c..000000000 --- a/rest_management_api_server/operations/identity/list_identity_edge_routers_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListIdentityEdgeRoutersURL generates an URL for the list identity edge routers operation -type ListIdentityEdgeRoutersURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityEdgeRoutersURL) WithBasePath(bp string) *ListIdentityEdgeRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityEdgeRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentityEdgeRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/edge-routers" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListIdentityEdgeRoutersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentityEdgeRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentityEdgeRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentityEdgeRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentityEdgeRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentityEdgeRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentityEdgeRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identity_service_policies.go b/rest_management_api_server/operations/identity/list_identity_service_policies.go deleted file mode 100644 index 39aff9258..000000000 --- a/rest_management_api_server/operations/identity/list_identity_service_policies.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentityServicePoliciesHandlerFunc turns a function with the right signature into a list identity service policies handler -type ListIdentityServicePoliciesHandlerFunc func(ListIdentityServicePoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentityServicePoliciesHandlerFunc) Handle(params ListIdentityServicePoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentityServicePoliciesHandler interface for that can handle valid list identity service policies params -type ListIdentityServicePoliciesHandler interface { - Handle(ListIdentityServicePoliciesParams, interface{}) middleware.Responder -} - -// NewListIdentityServicePolicies creates a new http.Handler for the list identity service policies operation -func NewListIdentityServicePolicies(ctx *middleware.Context, handler ListIdentityServicePoliciesHandler) *ListIdentityServicePolicies { - return &ListIdentityServicePolicies{Context: ctx, Handler: handler} -} - -/* ListIdentityServicePolicies swagger:route GET /identities/{id}/service-policies Identity listIdentityServicePolicies - -List the service policies that affect an identity - -Retrieves a list of service policies that apply to the specified identity. - -*/ -type ListIdentityServicePolicies struct { - Context *middleware.Context - Handler ListIdentityServicePoliciesHandler -} - -func (o *ListIdentityServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentityServicePoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identity_service_policies_parameters.go b/rest_management_api_server/operations/identity/list_identity_service_policies_parameters.go deleted file mode 100644 index 6345350b6..000000000 --- a/rest_management_api_server/operations/identity/list_identity_service_policies_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListIdentityServicePoliciesParams creates a new ListIdentityServicePoliciesParams object -// -// There are no default values defined in the spec. -func NewListIdentityServicePoliciesParams() ListIdentityServicePoliciesParams { - - return ListIdentityServicePoliciesParams{} -} - -// ListIdentityServicePoliciesParams contains all the bound params for the list identity service policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentityServicePolicies -type ListIdentityServicePoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentityServicePoliciesParams() beforehand. -func (o *ListIdentityServicePoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListIdentityServicePoliciesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identity_service_policies_responses.go b/rest_management_api_server/operations/identity/list_identity_service_policies_responses.go deleted file mode 100644 index e886be33a..000000000 --- a/rest_management_api_server/operations/identity/list_identity_service_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityServicePoliciesOKCode is the HTTP code returned for type ListIdentityServicePoliciesOK -const ListIdentityServicePoliciesOKCode int = 200 - -/*ListIdentityServicePoliciesOK A list of service policies - -swagger:response listIdentityServicePoliciesOK -*/ -type ListIdentityServicePoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicePoliciesEnvelope `json:"body,omitempty"` -} - -// NewListIdentityServicePoliciesOK creates ListIdentityServicePoliciesOK with default headers values -func NewListIdentityServicePoliciesOK() *ListIdentityServicePoliciesOK { - - return &ListIdentityServicePoliciesOK{} -} - -// WithPayload adds the payload to the list identity service policies o k response -func (o *ListIdentityServicePoliciesOK) WithPayload(payload *rest_model.ListServicePoliciesEnvelope) *ListIdentityServicePoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity service policies o k response -func (o *ListIdentityServicePoliciesOK) SetPayload(payload *rest_model.ListServicePoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityServicePoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityServicePoliciesUnauthorizedCode is the HTTP code returned for type ListIdentityServicePoliciesUnauthorized -const ListIdentityServicePoliciesUnauthorizedCode int = 401 - -/*ListIdentityServicePoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentityServicePoliciesUnauthorized -*/ -type ListIdentityServicePoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityServicePoliciesUnauthorized creates ListIdentityServicePoliciesUnauthorized with default headers values -func NewListIdentityServicePoliciesUnauthorized() *ListIdentityServicePoliciesUnauthorized { - - return &ListIdentityServicePoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list identity service policies unauthorized response -func (o *ListIdentityServicePoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityServicePoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity service policies unauthorized response -func (o *ListIdentityServicePoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityServicePoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityServicePoliciesNotFoundCode is the HTTP code returned for type ListIdentityServicePoliciesNotFound -const ListIdentityServicePoliciesNotFoundCode int = 404 - -/*ListIdentityServicePoliciesNotFound The requested resource does not exist - -swagger:response listIdentityServicePoliciesNotFound -*/ -type ListIdentityServicePoliciesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityServicePoliciesNotFound creates ListIdentityServicePoliciesNotFound with default headers values -func NewListIdentityServicePoliciesNotFound() *ListIdentityServicePoliciesNotFound { - - return &ListIdentityServicePoliciesNotFound{} -} - -// WithPayload adds the payload to the list identity service policies not found response -func (o *ListIdentityServicePoliciesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityServicePoliciesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity service policies not found response -func (o *ListIdentityServicePoliciesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityServicePoliciesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identity_service_policies_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_service_policies_urlbuilder.go deleted file mode 100644 index 49b4ad818..000000000 --- a/rest_management_api_server/operations/identity/list_identity_service_policies_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListIdentityServicePoliciesURL generates an URL for the list identity service policies operation -type ListIdentityServicePoliciesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityServicePoliciesURL) WithBasePath(bp string) *ListIdentityServicePoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityServicePoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentityServicePoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/service-policies" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListIdentityServicePoliciesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentityServicePoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentityServicePoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentityServicePoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentityServicePoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentityServicePoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentityServicePoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identity_services.go b/rest_management_api_server/operations/identity/list_identity_services.go deleted file mode 100644 index 716763aeb..000000000 --- a/rest_management_api_server/operations/identity/list_identity_services.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentityServicesHandlerFunc turns a function with the right signature into a list identity services handler -type ListIdentityServicesHandlerFunc func(ListIdentityServicesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentityServicesHandlerFunc) Handle(params ListIdentityServicesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentityServicesHandler interface for that can handle valid list identity services params -type ListIdentityServicesHandler interface { - Handle(ListIdentityServicesParams, interface{}) middleware.Responder -} - -// NewListIdentityServices creates a new http.Handler for the list identity services operation -func NewListIdentityServices(ctx *middleware.Context, handler ListIdentityServicesHandler) *ListIdentityServices { - return &ListIdentityServices{Context: ctx, Handler: handler} -} - -/* ListIdentityServices swagger:route GET /identities/{id}/services Identity listIdentityServices - -List accessible services - -Retrieves a list of services that the given identity has access to. Supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListIdentityServices struct { - Context *middleware.Context - Handler ListIdentityServicesHandler -} - -func (o *ListIdentityServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentityServicesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identity_services_parameters.go b/rest_management_api_server/operations/identity/list_identity_services_parameters.go deleted file mode 100644 index 6f969b2db..000000000 --- a/rest_management_api_server/operations/identity/list_identity_services_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListIdentityServicesParams creates a new ListIdentityServicesParams object -// -// There are no default values defined in the spec. -func NewListIdentityServicesParams() ListIdentityServicesParams { - - return ListIdentityServicesParams{} -} - -// ListIdentityServicesParams contains all the bound params for the list identity services operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentityServices -type ListIdentityServicesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentityServicesParams() beforehand. -func (o *ListIdentityServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListIdentityServicesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identity_services_responses.go b/rest_management_api_server/operations/identity/list_identity_services_responses.go deleted file mode 100644 index 687ed7d7b..000000000 --- a/rest_management_api_server/operations/identity/list_identity_services_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityServicesOKCode is the HTTP code returned for type ListIdentityServicesOK -const ListIdentityServicesOKCode int = 200 - -/*ListIdentityServicesOK A list of edge routers - -swagger:response listIdentityServicesOK -*/ -type ListIdentityServicesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewListIdentityServicesOK creates ListIdentityServicesOK with default headers values -func NewListIdentityServicesOK() *ListIdentityServicesOK { - - return &ListIdentityServicesOK{} -} - -// WithPayload adds the payload to the list identity services o k response -func (o *ListIdentityServicesOK) WithPayload(payload *rest_model.ListEdgeRoutersEnvelope) *ListIdentityServicesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity services o k response -func (o *ListIdentityServicesOK) SetPayload(payload *rest_model.ListEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityServicesUnauthorizedCode is the HTTP code returned for type ListIdentityServicesUnauthorized -const ListIdentityServicesUnauthorizedCode int = 401 - -/*ListIdentityServicesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentityServicesUnauthorized -*/ -type ListIdentityServicesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityServicesUnauthorized creates ListIdentityServicesUnauthorized with default headers values -func NewListIdentityServicesUnauthorized() *ListIdentityServicesUnauthorized { - - return &ListIdentityServicesUnauthorized{} -} - -// WithPayload adds the payload to the list identity services unauthorized response -func (o *ListIdentityServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityServicesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity services unauthorized response -func (o *ListIdentityServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityServicesNotFoundCode is the HTTP code returned for type ListIdentityServicesNotFound -const ListIdentityServicesNotFoundCode int = 404 - -/*ListIdentityServicesNotFound The requested resource does not exist - -swagger:response listIdentityServicesNotFound -*/ -type ListIdentityServicesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityServicesNotFound creates ListIdentityServicesNotFound with default headers values -func NewListIdentityServicesNotFound() *ListIdentityServicesNotFound { - - return &ListIdentityServicesNotFound{} -} - -// WithPayload adds the payload to the list identity services not found response -func (o *ListIdentityServicesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityServicesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity services not found response -func (o *ListIdentityServicesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityServicesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identity_services_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_services_urlbuilder.go deleted file mode 100644 index f0693e7d6..000000000 --- a/rest_management_api_server/operations/identity/list_identity_services_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListIdentityServicesURL generates an URL for the list identity services operation -type ListIdentityServicesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityServicesURL) WithBasePath(bp string) *ListIdentityServicesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityServicesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentityServicesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/services" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListIdentityServicesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentityServicesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentityServicesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentityServicesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentityServicesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentityServicesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentityServicesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identity_types.go b/rest_management_api_server/operations/identity/list_identity_types.go deleted file mode 100644 index ca1ba1604..000000000 --- a/rest_management_api_server/operations/identity/list_identity_types.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentityTypesHandlerFunc turns a function with the right signature into a list identity types handler -type ListIdentityTypesHandlerFunc func(ListIdentityTypesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentityTypesHandlerFunc) Handle(params ListIdentityTypesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentityTypesHandler interface for that can handle valid list identity types params -type ListIdentityTypesHandler interface { - Handle(ListIdentityTypesParams, interface{}) middleware.Responder -} - -// NewListIdentityTypes creates a new http.Handler for the list identity types operation -func NewListIdentityTypes(ctx *middleware.Context, handler ListIdentityTypesHandler) *ListIdentityTypes { - return &ListIdentityTypes{Context: ctx, Handler: handler} -} - -/* ListIdentityTypes swagger:route GET /identity-types Identity listIdentityTypes - -List available identity types - -Retrieves a list of identity types; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListIdentityTypes struct { - Context *middleware.Context - Handler ListIdentityTypesHandler -} - -func (o *ListIdentityTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentityTypesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identity_types_parameters.go b/rest_management_api_server/operations/identity/list_identity_types_parameters.go deleted file mode 100644 index 4fffa9acc..000000000 --- a/rest_management_api_server/operations/identity/list_identity_types_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListIdentityTypesParams creates a new ListIdentityTypesParams object -// -// There are no default values defined in the spec. -func NewListIdentityTypesParams() ListIdentityTypesParams { - - return ListIdentityTypesParams{} -} - -// ListIdentityTypesParams contains all the bound params for the list identity types operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentityTypes -type ListIdentityTypesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentityTypesParams() beforehand. -func (o *ListIdentityTypesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListIdentityTypesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListIdentityTypesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListIdentityTypesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identity_types_responses.go b/rest_management_api_server/operations/identity/list_identity_types_responses.go deleted file mode 100644 index 9748ba15a..000000000 --- a/rest_management_api_server/operations/identity/list_identity_types_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityTypesOKCode is the HTTP code returned for type ListIdentityTypesOK -const ListIdentityTypesOKCode int = 200 - -/*ListIdentityTypesOK A list of identity types - -swagger:response listIdentityTypesOK -*/ -type ListIdentityTypesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListIdentityTypesEnvelope `json:"body,omitempty"` -} - -// NewListIdentityTypesOK creates ListIdentityTypesOK with default headers values -func NewListIdentityTypesOK() *ListIdentityTypesOK { - - return &ListIdentityTypesOK{} -} - -// WithPayload adds the payload to the list identity types o k response -func (o *ListIdentityTypesOK) WithPayload(payload *rest_model.ListIdentityTypesEnvelope) *ListIdentityTypesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity types o k response -func (o *ListIdentityTypesOK) SetPayload(payload *rest_model.ListIdentityTypesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityTypesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityTypesBadRequestCode is the HTTP code returned for type ListIdentityTypesBadRequest -const ListIdentityTypesBadRequestCode int = 400 - -/*ListIdentityTypesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listIdentityTypesBadRequest -*/ -type ListIdentityTypesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityTypesBadRequest creates ListIdentityTypesBadRequest with default headers values -func NewListIdentityTypesBadRequest() *ListIdentityTypesBadRequest { - - return &ListIdentityTypesBadRequest{} -} - -// WithPayload adds the payload to the list identity types bad request response -func (o *ListIdentityTypesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityTypesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity types bad request response -func (o *ListIdentityTypesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityTypesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityTypesUnauthorizedCode is the HTTP code returned for type ListIdentityTypesUnauthorized -const ListIdentityTypesUnauthorizedCode int = 401 - -/*ListIdentityTypesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentityTypesUnauthorized -*/ -type ListIdentityTypesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityTypesUnauthorized creates ListIdentityTypesUnauthorized with default headers values -func NewListIdentityTypesUnauthorized() *ListIdentityTypesUnauthorized { - - return &ListIdentityTypesUnauthorized{} -} - -// WithPayload adds the payload to the list identity types unauthorized response -func (o *ListIdentityTypesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityTypesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity types unauthorized response -func (o *ListIdentityTypesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityTypesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identity_types_urlbuilder.go b/rest_management_api_server/operations/identity/list_identity_types_urlbuilder.go deleted file mode 100644 index 178c0e815..000000000 --- a/rest_management_api_server/operations/identity/list_identity_types_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListIdentityTypesURL generates an URL for the list identity types operation -type ListIdentityTypesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityTypesURL) WithBasePath(bp string) *ListIdentityTypesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityTypesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentityTypesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identity-types" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentityTypesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentityTypesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentityTypesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentityTypesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentityTypesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentityTypesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies.go deleted file mode 100644 index d9f67f124..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentitysEdgeRouterPoliciesHandlerFunc turns a function with the right signature into a list identitys edge router policies handler -type ListIdentitysEdgeRouterPoliciesHandlerFunc func(ListIdentitysEdgeRouterPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentitysEdgeRouterPoliciesHandlerFunc) Handle(params ListIdentitysEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentitysEdgeRouterPoliciesHandler interface for that can handle valid list identitys edge router policies params -type ListIdentitysEdgeRouterPoliciesHandler interface { - Handle(ListIdentitysEdgeRouterPoliciesParams, interface{}) middleware.Responder -} - -// NewListIdentitysEdgeRouterPolicies creates a new http.Handler for the list identitys edge router policies operation -func NewListIdentitysEdgeRouterPolicies(ctx *middleware.Context, handler ListIdentitysEdgeRouterPoliciesHandler) *ListIdentitysEdgeRouterPolicies { - return &ListIdentitysEdgeRouterPolicies{Context: ctx, Handler: handler} -} - -/* ListIdentitysEdgeRouterPolicies swagger:route GET /identities/{id}/edge-router-policies Identity listIdentitysEdgeRouterPolicies - -List the edge router policies that affect an identity - -Retrieves a list of edge router policies that apply to the specified identity. - -*/ -type ListIdentitysEdgeRouterPolicies struct { - Context *middleware.Context - Handler ListIdentitysEdgeRouterPoliciesHandler -} - -func (o *ListIdentitysEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentitysEdgeRouterPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_parameters.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_parameters.go deleted file mode 100644 index a3d9af6a7..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListIdentitysEdgeRouterPoliciesParams creates a new ListIdentitysEdgeRouterPoliciesParams object -// -// There are no default values defined in the spec. -func NewListIdentitysEdgeRouterPoliciesParams() ListIdentitysEdgeRouterPoliciesParams { - - return ListIdentitysEdgeRouterPoliciesParams{} -} - -// ListIdentitysEdgeRouterPoliciesParams contains all the bound params for the list identitys edge router policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentitysEdgeRouterPolicies -type ListIdentitysEdgeRouterPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentitysEdgeRouterPoliciesParams() beforehand. -func (o *ListIdentitysEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListIdentitysEdgeRouterPoliciesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_responses.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_responses.go deleted file mode 100644 index 46b62e243..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentitysEdgeRouterPoliciesOKCode is the HTTP code returned for type ListIdentitysEdgeRouterPoliciesOK -const ListIdentitysEdgeRouterPoliciesOKCode int = 200 - -/*ListIdentitysEdgeRouterPoliciesOK A list of edge router policies - -swagger:response listIdentitysEdgeRouterPoliciesOK -*/ -type ListIdentitysEdgeRouterPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRouterPoliciesEnvelope `json:"body,omitempty"` -} - -// NewListIdentitysEdgeRouterPoliciesOK creates ListIdentitysEdgeRouterPoliciesOK with default headers values -func NewListIdentitysEdgeRouterPoliciesOK() *ListIdentitysEdgeRouterPoliciesOK { - - return &ListIdentitysEdgeRouterPoliciesOK{} -} - -// WithPayload adds the payload to the list identitys edge router policies o k response -func (o *ListIdentitysEdgeRouterPoliciesOK) WithPayload(payload *rest_model.ListEdgeRouterPoliciesEnvelope) *ListIdentitysEdgeRouterPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identitys edge router policies o k response -func (o *ListIdentitysEdgeRouterPoliciesOK) SetPayload(payload *rest_model.ListEdgeRouterPoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitysEdgeRouterPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentitysEdgeRouterPoliciesUnauthorizedCode is the HTTP code returned for type ListIdentitysEdgeRouterPoliciesUnauthorized -const ListIdentitysEdgeRouterPoliciesUnauthorizedCode int = 401 - -/*ListIdentitysEdgeRouterPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentitysEdgeRouterPoliciesUnauthorized -*/ -type ListIdentitysEdgeRouterPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentitysEdgeRouterPoliciesUnauthorized creates ListIdentitysEdgeRouterPoliciesUnauthorized with default headers values -func NewListIdentitysEdgeRouterPoliciesUnauthorized() *ListIdentitysEdgeRouterPoliciesUnauthorized { - - return &ListIdentitysEdgeRouterPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list identitys edge router policies unauthorized response -func (o *ListIdentitysEdgeRouterPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentitysEdgeRouterPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identitys edge router policies unauthorized response -func (o *ListIdentitysEdgeRouterPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitysEdgeRouterPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentitysEdgeRouterPoliciesNotFoundCode is the HTTP code returned for type ListIdentitysEdgeRouterPoliciesNotFound -const ListIdentitysEdgeRouterPoliciesNotFoundCode int = 404 - -/*ListIdentitysEdgeRouterPoliciesNotFound The requested resource does not exist - -swagger:response listIdentitysEdgeRouterPoliciesNotFound -*/ -type ListIdentitysEdgeRouterPoliciesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentitysEdgeRouterPoliciesNotFound creates ListIdentitysEdgeRouterPoliciesNotFound with default headers values -func NewListIdentitysEdgeRouterPoliciesNotFound() *ListIdentitysEdgeRouterPoliciesNotFound { - - return &ListIdentitysEdgeRouterPoliciesNotFound{} -} - -// WithPayload adds the payload to the list identitys edge router policies not found response -func (o *ListIdentitysEdgeRouterPoliciesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentitysEdgeRouterPoliciesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identitys edge router policies not found response -func (o *ListIdentitysEdgeRouterPoliciesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitysEdgeRouterPoliciesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go deleted file mode 100644 index 3acd68e13..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_edge_router_policies_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListIdentitysEdgeRouterPoliciesURL generates an URL for the list identitys edge router policies operation -type ListIdentitysEdgeRouterPoliciesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentitysEdgeRouterPoliciesURL) WithBasePath(bp string) *ListIdentitysEdgeRouterPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentitysEdgeRouterPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentitysEdgeRouterPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/edge-router-policies" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListIdentitysEdgeRouterPoliciesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentitysEdgeRouterPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentitysEdgeRouterPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentitysEdgeRouterPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentitysEdgeRouterPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentitysEdgeRouterPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentitysEdgeRouterPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/list_identitys_service_configs.go b/rest_management_api_server/operations/identity/list_identitys_service_configs.go deleted file mode 100644 index 1122c6d29..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_service_configs.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentitysServiceConfigsHandlerFunc turns a function with the right signature into a list identitys service configs handler -type ListIdentitysServiceConfigsHandlerFunc func(ListIdentitysServiceConfigsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentitysServiceConfigsHandlerFunc) Handle(params ListIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentitysServiceConfigsHandler interface for that can handle valid list identitys service configs params -type ListIdentitysServiceConfigsHandler interface { - Handle(ListIdentitysServiceConfigsParams, interface{}) middleware.Responder -} - -// NewListIdentitysServiceConfigs creates a new http.Handler for the list identitys service configs operation -func NewListIdentitysServiceConfigs(ctx *middleware.Context, handler ListIdentitysServiceConfigsHandler) *ListIdentitysServiceConfigs { - return &ListIdentitysServiceConfigs{Context: ctx, Handler: handler} -} - -/* ListIdentitysServiceConfigs swagger:route GET /identities/{id}/service-configs Identity listIdentitysServiceConfigs - -List the service configs associated a specific identity - -Retrieves a list of service configs associated to a specific identity - -*/ -type ListIdentitysServiceConfigs struct { - Context *middleware.Context - Handler ListIdentitysServiceConfigsHandler -} - -func (o *ListIdentitysServiceConfigs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentitysServiceConfigsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/list_identitys_service_configs_parameters.go b/rest_management_api_server/operations/identity/list_identitys_service_configs_parameters.go deleted file mode 100644 index 5f4a54ef0..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_service_configs_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListIdentitysServiceConfigsParams creates a new ListIdentitysServiceConfigsParams object -// -// There are no default values defined in the spec. -func NewListIdentitysServiceConfigsParams() ListIdentitysServiceConfigsParams { - - return ListIdentitysServiceConfigsParams{} -} - -// ListIdentitysServiceConfigsParams contains all the bound params for the list identitys service configs operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentitysServiceConfigs -type ListIdentitysServiceConfigsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentitysServiceConfigsParams() beforehand. -func (o *ListIdentitysServiceConfigsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListIdentitysServiceConfigsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/list_identitys_service_configs_responses.go b/rest_management_api_server/operations/identity/list_identitys_service_configs_responses.go deleted file mode 100644 index be38d2afc..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_service_configs_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentitysServiceConfigsOKCode is the HTTP code returned for type ListIdentitysServiceConfigsOK -const ListIdentitysServiceConfigsOKCode int = 200 - -/*ListIdentitysServiceConfigsOK A list of service configs - -swagger:response listIdentitysServiceConfigsOK -*/ -type ListIdentitysServiceConfigsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServiceConfigsEnvelope `json:"body,omitempty"` -} - -// NewListIdentitysServiceConfigsOK creates ListIdentitysServiceConfigsOK with default headers values -func NewListIdentitysServiceConfigsOK() *ListIdentitysServiceConfigsOK { - - return &ListIdentitysServiceConfigsOK{} -} - -// WithPayload adds the payload to the list identitys service configs o k response -func (o *ListIdentitysServiceConfigsOK) WithPayload(payload *rest_model.ListServiceConfigsEnvelope) *ListIdentitysServiceConfigsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identitys service configs o k response -func (o *ListIdentitysServiceConfigsOK) SetPayload(payload *rest_model.ListServiceConfigsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitysServiceConfigsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentitysServiceConfigsUnauthorizedCode is the HTTP code returned for type ListIdentitysServiceConfigsUnauthorized -const ListIdentitysServiceConfigsUnauthorizedCode int = 401 - -/*ListIdentitysServiceConfigsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentitysServiceConfigsUnauthorized -*/ -type ListIdentitysServiceConfigsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentitysServiceConfigsUnauthorized creates ListIdentitysServiceConfigsUnauthorized with default headers values -func NewListIdentitysServiceConfigsUnauthorized() *ListIdentitysServiceConfigsUnauthorized { - - return &ListIdentitysServiceConfigsUnauthorized{} -} - -// WithPayload adds the payload to the list identitys service configs unauthorized response -func (o *ListIdentitysServiceConfigsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentitysServiceConfigsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identitys service configs unauthorized response -func (o *ListIdentitysServiceConfigsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitysServiceConfigsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentitysServiceConfigsNotFoundCode is the HTTP code returned for type ListIdentitysServiceConfigsNotFound -const ListIdentitysServiceConfigsNotFoundCode int = 404 - -/*ListIdentitysServiceConfigsNotFound The requested resource does not exist - -swagger:response listIdentitysServiceConfigsNotFound -*/ -type ListIdentitysServiceConfigsNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentitysServiceConfigsNotFound creates ListIdentitysServiceConfigsNotFound with default headers values -func NewListIdentitysServiceConfigsNotFound() *ListIdentitysServiceConfigsNotFound { - - return &ListIdentitysServiceConfigsNotFound{} -} - -// WithPayload adds the payload to the list identitys service configs not found response -func (o *ListIdentitysServiceConfigsNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentitysServiceConfigsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identitys service configs not found response -func (o *ListIdentitysServiceConfigsNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentitysServiceConfigsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/list_identitys_service_configs_urlbuilder.go b/rest_management_api_server/operations/identity/list_identitys_service_configs_urlbuilder.go deleted file mode 100644 index 96165ca3e..000000000 --- a/rest_management_api_server/operations/identity/list_identitys_service_configs_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListIdentitysServiceConfigsURL generates an URL for the list identitys service configs operation -type ListIdentitysServiceConfigsURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentitysServiceConfigsURL) WithBasePath(bp string) *ListIdentitysServiceConfigsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentitysServiceConfigsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentitysServiceConfigsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/service-configs" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListIdentitysServiceConfigsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentitysServiceConfigsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentitysServiceConfigsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentitysServiceConfigsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentitysServiceConfigsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentitysServiceConfigsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentitysServiceConfigsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/patch_identity.go b/rest_management_api_server/operations/identity/patch_identity.go deleted file mode 100644 index 2ee63c8a8..000000000 --- a/rest_management_api_server/operations/identity/patch_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchIdentityHandlerFunc turns a function with the right signature into a patch identity handler -type PatchIdentityHandlerFunc func(PatchIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchIdentityHandlerFunc) Handle(params PatchIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchIdentityHandler interface for that can handle valid patch identity params -type PatchIdentityHandler interface { - Handle(PatchIdentityParams, interface{}) middleware.Responder -} - -// NewPatchIdentity creates a new http.Handler for the patch identity operation -func NewPatchIdentity(ctx *middleware.Context, handler PatchIdentityHandler) *PatchIdentity { - return &PatchIdentity{Context: ctx, Handler: handler} -} - -/* PatchIdentity swagger:route PATCH /identities/{id} Identity patchIdentity - -Update the supplied fields on an identity - -Update the supplied fields on an identity. Requires admin access. - -*/ -type PatchIdentity struct { - Context *middleware.Context - Handler PatchIdentityHandler -} - -func (o *PatchIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/patch_identity_parameters.go b/rest_management_api_server/operations/identity/patch_identity_parameters.go deleted file mode 100644 index 696890f0e..000000000 --- a/rest_management_api_server/operations/identity/patch_identity_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchIdentityParams creates a new PatchIdentityParams object -// -// There are no default values defined in the spec. -func NewPatchIdentityParams() PatchIdentityParams { - - return PatchIdentityParams{} -} - -// PatchIdentityParams contains all the bound params for the patch identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchIdentity -type PatchIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*An identity patch object - Required: true - In: body - */ - Identity *rest_model.IdentityPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchIdentityParams() beforehand. -func (o *PatchIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("identity", "body", "")) - } else { - res = append(res, errors.NewParseError("identity", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Identity = &body - } - } - } else { - res = append(res, errors.Required("identity", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchIdentityParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/patch_identity_responses.go b/rest_management_api_server/operations/identity/patch_identity_responses.go deleted file mode 100644 index 7617155da..000000000 --- a/rest_management_api_server/operations/identity/patch_identity_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchIdentityOKCode is the HTTP code returned for type PatchIdentityOK -const PatchIdentityOKCode int = 200 - -/*PatchIdentityOK The patch request was successful and the resource has been altered - -swagger:response patchIdentityOK -*/ -type PatchIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchIdentityOK creates PatchIdentityOK with default headers values -func NewPatchIdentityOK() *PatchIdentityOK { - - return &PatchIdentityOK{} -} - -// WithPayload adds the payload to the patch identity o k response -func (o *PatchIdentityOK) WithPayload(payload *rest_model.Empty) *PatchIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch identity o k response -func (o *PatchIdentityOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchIdentityBadRequestCode is the HTTP code returned for type PatchIdentityBadRequest -const PatchIdentityBadRequestCode int = 400 - -/*PatchIdentityBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchIdentityBadRequest -*/ -type PatchIdentityBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchIdentityBadRequest creates PatchIdentityBadRequest with default headers values -func NewPatchIdentityBadRequest() *PatchIdentityBadRequest { - - return &PatchIdentityBadRequest{} -} - -// WithPayload adds the payload to the patch identity bad request response -func (o *PatchIdentityBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchIdentityBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch identity bad request response -func (o *PatchIdentityBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchIdentityBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchIdentityUnauthorizedCode is the HTTP code returned for type PatchIdentityUnauthorized -const PatchIdentityUnauthorizedCode int = 401 - -/*PatchIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchIdentityUnauthorized -*/ -type PatchIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchIdentityUnauthorized creates PatchIdentityUnauthorized with default headers values -func NewPatchIdentityUnauthorized() *PatchIdentityUnauthorized { - - return &PatchIdentityUnauthorized{} -} - -// WithPayload adds the payload to the patch identity unauthorized response -func (o *PatchIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch identity unauthorized response -func (o *PatchIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchIdentityNotFoundCode is the HTTP code returned for type PatchIdentityNotFound -const PatchIdentityNotFoundCode int = 404 - -/*PatchIdentityNotFound The requested resource does not exist - -swagger:response patchIdentityNotFound -*/ -type PatchIdentityNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchIdentityNotFound creates PatchIdentityNotFound with default headers values -func NewPatchIdentityNotFound() *PatchIdentityNotFound { - - return &PatchIdentityNotFound{} -} - -// WithPayload adds the payload to the patch identity not found response -func (o *PatchIdentityNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchIdentityNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch identity not found response -func (o *PatchIdentityNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/patch_identity_urlbuilder.go b/rest_management_api_server/operations/identity/patch_identity_urlbuilder.go deleted file mode 100644 index fd9b5965c..000000000 --- a/rest_management_api_server/operations/identity/patch_identity_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchIdentityURL generates an URL for the patch identity operation -type PatchIdentityURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchIdentityURL) WithBasePath(bp string) *PatchIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchIdentityURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/remove_identity_mfa.go b/rest_management_api_server/operations/identity/remove_identity_mfa.go deleted file mode 100644 index 80e4f693b..000000000 --- a/rest_management_api_server/operations/identity/remove_identity_mfa.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RemoveIdentityMfaHandlerFunc turns a function with the right signature into a remove identity mfa handler -type RemoveIdentityMfaHandlerFunc func(RemoveIdentityMfaParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn RemoveIdentityMfaHandlerFunc) Handle(params RemoveIdentityMfaParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// RemoveIdentityMfaHandler interface for that can handle valid remove identity mfa params -type RemoveIdentityMfaHandler interface { - Handle(RemoveIdentityMfaParams, interface{}) middleware.Responder -} - -// NewRemoveIdentityMfa creates a new http.Handler for the remove identity mfa operation -func NewRemoveIdentityMfa(ctx *middleware.Context, handler RemoveIdentityMfaHandler) *RemoveIdentityMfa { - return &RemoveIdentityMfa{Context: ctx, Handler: handler} -} - -/* RemoveIdentityMfa swagger:route DELETE /identities/{id}/mfa Identity MFA removeIdentityMfa - -Remove MFA from an identitity - -Allows an admin to remove MFA enrollment from a specific identity. Requires admin. - - -*/ -type RemoveIdentityMfa struct { - Context *middleware.Context - Handler RemoveIdentityMfaHandler -} - -func (o *RemoveIdentityMfa) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRemoveIdentityMfaParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/remove_identity_mfa_parameters.go b/rest_management_api_server/operations/identity/remove_identity_mfa_parameters.go deleted file mode 100644 index cb51187d1..000000000 --- a/rest_management_api_server/operations/identity/remove_identity_mfa_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewRemoveIdentityMfaParams creates a new RemoveIdentityMfaParams object -// -// There are no default values defined in the spec. -func NewRemoveIdentityMfaParams() RemoveIdentityMfaParams { - - return RemoveIdentityMfaParams{} -} - -// RemoveIdentityMfaParams contains all the bound params for the remove identity mfa operation -// typically these are obtained from a http.Request -// -// swagger:parameters removeIdentityMfa -type RemoveIdentityMfaParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRemoveIdentityMfaParams() beforehand. -func (o *RemoveIdentityMfaParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *RemoveIdentityMfaParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/remove_identity_mfa_responses.go b/rest_management_api_server/operations/identity/remove_identity_mfa_responses.go deleted file mode 100644 index b947378a9..000000000 --- a/rest_management_api_server/operations/identity/remove_identity_mfa_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// RemoveIdentityMfaOKCode is the HTTP code returned for type RemoveIdentityMfaOK -const RemoveIdentityMfaOKCode int = 200 - -/*RemoveIdentityMfaOK Base empty response - -swagger:response removeIdentityMfaOK -*/ -type RemoveIdentityMfaOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewRemoveIdentityMfaOK creates RemoveIdentityMfaOK with default headers values -func NewRemoveIdentityMfaOK() *RemoveIdentityMfaOK { - - return &RemoveIdentityMfaOK{} -} - -// WithPayload adds the payload to the remove identity mfa o k response -func (o *RemoveIdentityMfaOK) WithPayload(payload *rest_model.Empty) *RemoveIdentityMfaOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the remove identity mfa o k response -func (o *RemoveIdentityMfaOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RemoveIdentityMfaOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RemoveIdentityMfaUnauthorizedCode is the HTTP code returned for type RemoveIdentityMfaUnauthorized -const RemoveIdentityMfaUnauthorizedCode int = 401 - -/*RemoveIdentityMfaUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response removeIdentityMfaUnauthorized -*/ -type RemoveIdentityMfaUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewRemoveIdentityMfaUnauthorized creates RemoveIdentityMfaUnauthorized with default headers values -func NewRemoveIdentityMfaUnauthorized() *RemoveIdentityMfaUnauthorized { - - return &RemoveIdentityMfaUnauthorized{} -} - -// WithPayload adds the payload to the remove identity mfa unauthorized response -func (o *RemoveIdentityMfaUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *RemoveIdentityMfaUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the remove identity mfa unauthorized response -func (o *RemoveIdentityMfaUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RemoveIdentityMfaUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RemoveIdentityMfaNotFoundCode is the HTTP code returned for type RemoveIdentityMfaNotFound -const RemoveIdentityMfaNotFoundCode int = 404 - -/*RemoveIdentityMfaNotFound The requested resource does not exist - -swagger:response removeIdentityMfaNotFound -*/ -type RemoveIdentityMfaNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewRemoveIdentityMfaNotFound creates RemoveIdentityMfaNotFound with default headers values -func NewRemoveIdentityMfaNotFound() *RemoveIdentityMfaNotFound { - - return &RemoveIdentityMfaNotFound{} -} - -// WithPayload adds the payload to the remove identity mfa not found response -func (o *RemoveIdentityMfaNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *RemoveIdentityMfaNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the remove identity mfa not found response -func (o *RemoveIdentityMfaNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RemoveIdentityMfaNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/remove_identity_mfa_urlbuilder.go b/rest_management_api_server/operations/identity/remove_identity_mfa_urlbuilder.go deleted file mode 100644 index aba78c871..000000000 --- a/rest_management_api_server/operations/identity/remove_identity_mfa_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// RemoveIdentityMfaURL generates an URL for the remove identity mfa operation -type RemoveIdentityMfaURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RemoveIdentityMfaURL) WithBasePath(bp string) *RemoveIdentityMfaURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RemoveIdentityMfaURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RemoveIdentityMfaURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/mfa" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on RemoveIdentityMfaURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RemoveIdentityMfaURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RemoveIdentityMfaURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RemoveIdentityMfaURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RemoveIdentityMfaURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RemoveIdentityMfaURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RemoveIdentityMfaURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/update_identity.go b/rest_management_api_server/operations/identity/update_identity.go deleted file mode 100644 index 3ace56f40..000000000 --- a/rest_management_api_server/operations/identity/update_identity.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateIdentityHandlerFunc turns a function with the right signature into a update identity handler -type UpdateIdentityHandlerFunc func(UpdateIdentityParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateIdentityHandlerFunc) Handle(params UpdateIdentityParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateIdentityHandler interface for that can handle valid update identity params -type UpdateIdentityHandler interface { - Handle(UpdateIdentityParams, interface{}) middleware.Responder -} - -// NewUpdateIdentity creates a new http.Handler for the update identity operation -func NewUpdateIdentity(ctx *middleware.Context, handler UpdateIdentityHandler) *UpdateIdentity { - return &UpdateIdentity{Context: ctx, Handler: handler} -} - -/* UpdateIdentity swagger:route PUT /identities/{id} Identity updateIdentity - -Update all fields on an identity - -Update all fields on an identity by id. Requires admin access. - -*/ -type UpdateIdentity struct { - Context *middleware.Context - Handler UpdateIdentityHandler -} - -func (o *UpdateIdentity) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateIdentityParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/update_identity_parameters.go b/rest_management_api_server/operations/identity/update_identity_parameters.go deleted file mode 100644 index 589dcd044..000000000 --- a/rest_management_api_server/operations/identity/update_identity_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateIdentityParams creates a new UpdateIdentityParams object -// -// There are no default values defined in the spec. -func NewUpdateIdentityParams() UpdateIdentityParams { - - return UpdateIdentityParams{} -} - -// UpdateIdentityParams contains all the bound params for the update identity operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateIdentity -type UpdateIdentityParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*An identity update object - Required: true - In: body - */ - Identity *rest_model.IdentityUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateIdentityParams() beforehand. -func (o *UpdateIdentityParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.IdentityUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("identity", "body", "")) - } else { - res = append(res, errors.NewParseError("identity", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Identity = &body - } - } - } else { - res = append(res, errors.Required("identity", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateIdentityParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/update_identity_responses.go b/rest_management_api_server/operations/identity/update_identity_responses.go deleted file mode 100644 index 0051b72bc..000000000 --- a/rest_management_api_server/operations/identity/update_identity_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateIdentityOKCode is the HTTP code returned for type UpdateIdentityOK -const UpdateIdentityOKCode int = 200 - -/*UpdateIdentityOK The update request was successful and the resource has been altered - -swagger:response updateIdentityOK -*/ -type UpdateIdentityOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateIdentityOK creates UpdateIdentityOK with default headers values -func NewUpdateIdentityOK() *UpdateIdentityOK { - - return &UpdateIdentityOK{} -} - -// WithPayload adds the payload to the update identity o k response -func (o *UpdateIdentityOK) WithPayload(payload *rest_model.Empty) *UpdateIdentityOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity o k response -func (o *UpdateIdentityOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateIdentityBadRequestCode is the HTTP code returned for type UpdateIdentityBadRequest -const UpdateIdentityBadRequestCode int = 400 - -/*UpdateIdentityBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateIdentityBadRequest -*/ -type UpdateIdentityBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityBadRequest creates UpdateIdentityBadRequest with default headers values -func NewUpdateIdentityBadRequest() *UpdateIdentityBadRequest { - - return &UpdateIdentityBadRequest{} -} - -// WithPayload adds the payload to the update identity bad request response -func (o *UpdateIdentityBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateIdentityBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity bad request response -func (o *UpdateIdentityBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateIdentityUnauthorizedCode is the HTTP code returned for type UpdateIdentityUnauthorized -const UpdateIdentityUnauthorizedCode int = 401 - -/*UpdateIdentityUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateIdentityUnauthorized -*/ -type UpdateIdentityUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityUnauthorized creates UpdateIdentityUnauthorized with default headers values -func NewUpdateIdentityUnauthorized() *UpdateIdentityUnauthorized { - - return &UpdateIdentityUnauthorized{} -} - -// WithPayload adds the payload to the update identity unauthorized response -func (o *UpdateIdentityUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateIdentityUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity unauthorized response -func (o *UpdateIdentityUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateIdentityNotFoundCode is the HTTP code returned for type UpdateIdentityNotFound -const UpdateIdentityNotFoundCode int = 404 - -/*UpdateIdentityNotFound The requested resource does not exist - -swagger:response updateIdentityNotFound -*/ -type UpdateIdentityNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityNotFound creates UpdateIdentityNotFound with default headers values -func NewUpdateIdentityNotFound() *UpdateIdentityNotFound { - - return &UpdateIdentityNotFound{} -} - -// WithPayload adds the payload to the update identity not found response -func (o *UpdateIdentityNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateIdentityNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity not found response -func (o *UpdateIdentityNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/update_identity_tracing.go b/rest_management_api_server/operations/identity/update_identity_tracing.go deleted file mode 100644 index 5afdde4ce..000000000 --- a/rest_management_api_server/operations/identity/update_identity_tracing.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateIdentityTracingHandlerFunc turns a function with the right signature into a update identity tracing handler -type UpdateIdentityTracingHandlerFunc func(UpdateIdentityTracingParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateIdentityTracingHandlerFunc) Handle(params UpdateIdentityTracingParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateIdentityTracingHandler interface for that can handle valid update identity tracing params -type UpdateIdentityTracingHandler interface { - Handle(UpdateIdentityTracingParams, interface{}) middleware.Responder -} - -// NewUpdateIdentityTracing creates a new http.Handler for the update identity tracing operation -func NewUpdateIdentityTracing(ctx *middleware.Context, handler UpdateIdentityTracingHandler) *UpdateIdentityTracing { - return &UpdateIdentityTracing{Context: ctx, Handler: handler} -} - -/* UpdateIdentityTracing swagger:route PUT /identities/{id}/trace Identity Tracing updateIdentityTracing - -Enable/disable data flow tracing for an identity - -Allows an admin to enable/disable data flow tracing for an identity - - -*/ -type UpdateIdentityTracing struct { - Context *middleware.Context - Handler UpdateIdentityTracingHandler -} - -func (o *UpdateIdentityTracing) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateIdentityTracingParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/identity/update_identity_tracing_parameters.go b/rest_management_api_server/operations/identity/update_identity_tracing_parameters.go deleted file mode 100644 index 7661e1eb4..000000000 --- a/rest_management_api_server/operations/identity/update_identity_tracing_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateIdentityTracingParams creates a new UpdateIdentityTracingParams object -// -// There are no default values defined in the spec. -func NewUpdateIdentityTracingParams() UpdateIdentityTracingParams { - - return UpdateIdentityTracingParams{} -} - -// UpdateIdentityTracingParams contains all the bound params for the update identity tracing operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateIdentityTracing -type UpdateIdentityTracingParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A traceSpec object - Required: true - In: body - */ - TraceSpec *rest_model.TraceSpec -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateIdentityTracingParams() beforehand. -func (o *UpdateIdentityTracingParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.TraceSpec - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("traceSpec", "body", "")) - } else { - res = append(res, errors.NewParseError("traceSpec", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.TraceSpec = &body - } - } - } else { - res = append(res, errors.Required("traceSpec", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateIdentityTracingParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/identity/update_identity_tracing_responses.go b/rest_management_api_server/operations/identity/update_identity_tracing_responses.go deleted file mode 100644 index 259068332..000000000 --- a/rest_management_api_server/operations/identity/update_identity_tracing_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateIdentityTracingOKCode is the HTTP code returned for type UpdateIdentityTracingOK -const UpdateIdentityTracingOKCode int = 200 - -/*UpdateIdentityTracingOK Returns the document that represents the trace state - -swagger:response updateIdentityTracingOK -*/ -type UpdateIdentityTracingOK struct { - - /* - In: Body - */ - Payload *rest_model.TraceDetailEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityTracingOK creates UpdateIdentityTracingOK with default headers values -func NewUpdateIdentityTracingOK() *UpdateIdentityTracingOK { - - return &UpdateIdentityTracingOK{} -} - -// WithPayload adds the payload to the update identity tracing o k response -func (o *UpdateIdentityTracingOK) WithPayload(payload *rest_model.TraceDetailEnvelope) *UpdateIdentityTracingOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity tracing o k response -func (o *UpdateIdentityTracingOK) SetPayload(payload *rest_model.TraceDetailEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityTracingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateIdentityTracingBadRequestCode is the HTTP code returned for type UpdateIdentityTracingBadRequest -const UpdateIdentityTracingBadRequestCode int = 400 - -/*UpdateIdentityTracingBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateIdentityTracingBadRequest -*/ -type UpdateIdentityTracingBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityTracingBadRequest creates UpdateIdentityTracingBadRequest with default headers values -func NewUpdateIdentityTracingBadRequest() *UpdateIdentityTracingBadRequest { - - return &UpdateIdentityTracingBadRequest{} -} - -// WithPayload adds the payload to the update identity tracing bad request response -func (o *UpdateIdentityTracingBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateIdentityTracingBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity tracing bad request response -func (o *UpdateIdentityTracingBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityTracingBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateIdentityTracingUnauthorizedCode is the HTTP code returned for type UpdateIdentityTracingUnauthorized -const UpdateIdentityTracingUnauthorizedCode int = 401 - -/*UpdateIdentityTracingUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateIdentityTracingUnauthorized -*/ -type UpdateIdentityTracingUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityTracingUnauthorized creates UpdateIdentityTracingUnauthorized with default headers values -func NewUpdateIdentityTracingUnauthorized() *UpdateIdentityTracingUnauthorized { - - return &UpdateIdentityTracingUnauthorized{} -} - -// WithPayload adds the payload to the update identity tracing unauthorized response -func (o *UpdateIdentityTracingUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateIdentityTracingUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity tracing unauthorized response -func (o *UpdateIdentityTracingUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityTracingUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateIdentityTracingNotFoundCode is the HTTP code returned for type UpdateIdentityTracingNotFound -const UpdateIdentityTracingNotFoundCode int = 404 - -/*UpdateIdentityTracingNotFound The requested resource does not exist - -swagger:response updateIdentityTracingNotFound -*/ -type UpdateIdentityTracingNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateIdentityTracingNotFound creates UpdateIdentityTracingNotFound with default headers values -func NewUpdateIdentityTracingNotFound() *UpdateIdentityTracingNotFound { - - return &UpdateIdentityTracingNotFound{} -} - -// WithPayload adds the payload to the update identity tracing not found response -func (o *UpdateIdentityTracingNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateIdentityTracingNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update identity tracing not found response -func (o *UpdateIdentityTracingNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateIdentityTracingNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/identity/update_identity_tracing_urlbuilder.go b/rest_management_api_server/operations/identity/update_identity_tracing_urlbuilder.go deleted file mode 100644 index 17d407391..000000000 --- a/rest_management_api_server/operations/identity/update_identity_tracing_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateIdentityTracingURL generates an URL for the update identity tracing operation -type UpdateIdentityTracingURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateIdentityTracingURL) WithBasePath(bp string) *UpdateIdentityTracingURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateIdentityTracingURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateIdentityTracingURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}/trace" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateIdentityTracingURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateIdentityTracingURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateIdentityTracingURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateIdentityTracingURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateIdentityTracingURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateIdentityTracingURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateIdentityTracingURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/identity/update_identity_urlbuilder.go b/rest_management_api_server/operations/identity/update_identity_urlbuilder.go deleted file mode 100644 index f5c2edd74..000000000 --- a/rest_management_api_server/operations/identity/update_identity_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package identity - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateIdentityURL generates an URL for the update identity operation -type UpdateIdentityURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateIdentityURL) WithBasePath(bp string) *UpdateIdentityURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateIdentityURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateIdentityURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identities/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateIdentityURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateIdentityURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateIdentityURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateIdentityURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateIdentityURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateIdentityURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateIdentityURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/informational/detail_spec.go b/rest_management_api_server/operations/informational/detail_spec.go deleted file mode 100644 index 36e8ec49d..000000000 --- a/rest_management_api_server/operations/informational/detail_spec.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSpecHandlerFunc turns a function with the right signature into a detail spec handler -type DetailSpecHandlerFunc func(DetailSpecParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSpecHandlerFunc) Handle(params DetailSpecParams) middleware.Responder { - return fn(params) -} - -// DetailSpecHandler interface for that can handle valid detail spec params -type DetailSpecHandler interface { - Handle(DetailSpecParams) middleware.Responder -} - -// NewDetailSpec creates a new http.Handler for the detail spec operation -func NewDetailSpec(ctx *middleware.Context, handler DetailSpecHandler) *DetailSpec { - return &DetailSpec{Context: ctx, Handler: handler} -} - -/* DetailSpec swagger:route GET /specs/{id} Informational detailSpec - -Return a single spec resource - -Returns single spec resource embedded within the controller for consumption/documentation/code geneartion - -*/ -type DetailSpec struct { - Context *middleware.Context - Handler DetailSpecHandler -} - -func (o *DetailSpec) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSpecParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/informational/detail_spec_body.go b/rest_management_api_server/operations/informational/detail_spec_body.go deleted file mode 100644 index 79072efc5..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_body.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSpecBodyHandlerFunc turns a function with the right signature into a detail spec body handler -type DetailSpecBodyHandlerFunc func(DetailSpecBodyParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSpecBodyHandlerFunc) Handle(params DetailSpecBodyParams) middleware.Responder { - return fn(params) -} - -// DetailSpecBodyHandler interface for that can handle valid detail spec body params -type DetailSpecBodyHandler interface { - Handle(DetailSpecBodyParams) middleware.Responder -} - -// NewDetailSpecBody creates a new http.Handler for the detail spec body operation -func NewDetailSpecBody(ctx *middleware.Context, handler DetailSpecBodyHandler) *DetailSpecBody { - return &DetailSpecBody{Context: ctx, Handler: handler} -} - -/* DetailSpecBody swagger:route GET /specs/{id}/spec Informational detailSpecBody - -Returns the spec's file - -Return the body of the specification (i.e. Swagger, OpenAPI 2.0, 3.0, etc). - -*/ -type DetailSpecBody struct { - Context *middleware.Context - Handler DetailSpecBodyHandler -} - -func (o *DetailSpecBody) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSpecBodyParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/informational/detail_spec_body_parameters.go b/rest_management_api_server/operations/informational/detail_spec_body_parameters.go deleted file mode 100644 index 464799d9e..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_body_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecBodyParams creates a new DetailSpecBodyParams object -// -// There are no default values defined in the spec. -func NewDetailSpecBodyParams() DetailSpecBodyParams { - - return DetailSpecBodyParams{} -} - -// DetailSpecBodyParams contains all the bound params for the detail spec body operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSpecBody -type DetailSpecBodyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSpecBodyParams() beforehand. -func (o *DetailSpecBodyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSpecBodyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/informational/detail_spec_body_responses.go b/rest_management_api_server/operations/informational/detail_spec_body_responses.go deleted file mode 100644 index 6e542a8b8..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_body_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecBodyOKCode is the HTTP code returned for type DetailSpecBodyOK -const DetailSpecBodyOKCode int = 200 - -/*DetailSpecBodyOK Returns the document that represents the specification - -swagger:response detailSpecBodyOK -*/ -type DetailSpecBodyOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSpecBodyEnvelope `json:"body,omitempty"` -} - -// NewDetailSpecBodyOK creates DetailSpecBodyOK with default headers values -func NewDetailSpecBodyOK() *DetailSpecBodyOK { - - return &DetailSpecBodyOK{} -} - -// WithPayload adds the payload to the detail spec body o k response -func (o *DetailSpecBodyOK) WithPayload(payload *rest_model.DetailSpecBodyEnvelope) *DetailSpecBodyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail spec body o k response -func (o *DetailSpecBodyOK) SetPayload(payload *rest_model.DetailSpecBodyEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSpecBodyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/informational/detail_spec_body_urlbuilder.go b/rest_management_api_server/operations/informational/detail_spec_body_urlbuilder.go deleted file mode 100644 index 42b5f70de..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_body_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSpecBodyURL generates an URL for the detail spec body operation -type DetailSpecBodyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecBodyURL) WithBasePath(bp string) *DetailSpecBodyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecBodyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSpecBodyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/specs/{id}/spec" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSpecBodyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSpecBodyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSpecBodyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSpecBodyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSpecBodyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSpecBodyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSpecBodyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/informational/detail_spec_parameters.go b/rest_management_api_server/operations/informational/detail_spec_parameters.go deleted file mode 100644 index 3f1b7214d..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSpecParams creates a new DetailSpecParams object -// -// There are no default values defined in the spec. -func NewDetailSpecParams() DetailSpecParams { - - return DetailSpecParams{} -} - -// DetailSpecParams contains all the bound params for the detail spec operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSpec -type DetailSpecParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSpecParams() beforehand. -func (o *DetailSpecParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSpecParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/informational/detail_spec_responses.go b/rest_management_api_server/operations/informational/detail_spec_responses.go deleted file mode 100644 index 4a481fa3f..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSpecOKCode is the HTTP code returned for type DetailSpecOK -const DetailSpecOKCode int = 200 - -/*DetailSpecOK A single specification - -swagger:response detailSpecOK -*/ -type DetailSpecOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSpecEnvelope `json:"body,omitempty"` -} - -// NewDetailSpecOK creates DetailSpecOK with default headers values -func NewDetailSpecOK() *DetailSpecOK { - - return &DetailSpecOK{} -} - -// WithPayload adds the payload to the detail spec o k response -func (o *DetailSpecOK) WithPayload(payload *rest_model.DetailSpecEnvelope) *DetailSpecOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail spec o k response -func (o *DetailSpecOK) SetPayload(payload *rest_model.DetailSpecEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSpecOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/informational/detail_spec_urlbuilder.go b/rest_management_api_server/operations/informational/detail_spec_urlbuilder.go deleted file mode 100644 index 18c043de6..000000000 --- a/rest_management_api_server/operations/informational/detail_spec_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSpecURL generates an URL for the detail spec operation -type DetailSpecURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecURL) WithBasePath(bp string) *DetailSpecURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSpecURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSpecURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/specs/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSpecURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSpecURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSpecURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSpecURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSpecURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSpecURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSpecURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/informational/list_root.go b/rest_management_api_server/operations/informational/list_root.go deleted file mode 100644 index 69984e661..000000000 --- a/rest_management_api_server/operations/informational/list_root.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListRootHandlerFunc turns a function with the right signature into a list root handler -type ListRootHandlerFunc func(ListRootParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListRootHandlerFunc) Handle(params ListRootParams) middleware.Responder { - return fn(params) -} - -// ListRootHandler interface for that can handle valid list root params -type ListRootHandler interface { - Handle(ListRootParams) middleware.Responder -} - -// NewListRoot creates a new http.Handler for the list root operation -func NewListRoot(ctx *middleware.Context, handler ListRootHandler) *ListRoot { - return &ListRoot{Context: ctx, Handler: handler} -} - -/* ListRoot swagger:route GET / Informational listRoot - -Returns version information - -*/ -type ListRoot struct { - Context *middleware.Context - Handler ListRootHandler -} - -func (o *ListRoot) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListRootParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/informational/list_root_parameters.go b/rest_management_api_server/operations/informational/list_root_parameters.go deleted file mode 100644 index 48f3ac32e..000000000 --- a/rest_management_api_server/operations/informational/list_root_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListRootParams creates a new ListRootParams object -// -// There are no default values defined in the spec. -func NewListRootParams() ListRootParams { - - return ListRootParams{} -} - -// ListRootParams contains all the bound params for the list root operation -// typically these are obtained from a http.Request -// -// swagger:parameters listRoot -type ListRootParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListRootParams() beforehand. -func (o *ListRootParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/informational/list_root_responses.go b/rest_management_api_server/operations/informational/list_root_responses.go deleted file mode 100644 index 2612e218d..000000000 --- a/rest_management_api_server/operations/informational/list_root_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListRootOKCode is the HTTP code returned for type ListRootOK -const ListRootOKCode int = 200 - -/*ListRootOK Version information for the controller - -swagger:response listRootOK -*/ -type ListRootOK struct { - - /* - In: Body - */ - Payload *rest_model.ListVersionEnvelope `json:"body,omitempty"` -} - -// NewListRootOK creates ListRootOK with default headers values -func NewListRootOK() *ListRootOK { - - return &ListRootOK{} -} - -// WithPayload adds the payload to the list root o k response -func (o *ListRootOK) WithPayload(payload *rest_model.ListVersionEnvelope) *ListRootOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list root o k response -func (o *ListRootOK) SetPayload(payload *rest_model.ListVersionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListRootOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/informational/list_root_urlbuilder.go b/rest_management_api_server/operations/informational/list_root_urlbuilder.go deleted file mode 100644 index 23a9f601c..000000000 --- a/rest_management_api_server/operations/informational/list_root_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListRootURL generates an URL for the list root operation -type ListRootURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListRootURL) WithBasePath(bp string) *ListRootURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListRootURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListRootURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListRootURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListRootURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListRootURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListRootURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListRootURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListRootURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/informational/list_specs.go b/rest_management_api_server/operations/informational/list_specs.go deleted file mode 100644 index 4d0b1eaac..000000000 --- a/rest_management_api_server/operations/informational/list_specs.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListSpecsHandlerFunc turns a function with the right signature into a list specs handler -type ListSpecsHandlerFunc func(ListSpecsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListSpecsHandlerFunc) Handle(params ListSpecsParams) middleware.Responder { - return fn(params) -} - -// ListSpecsHandler interface for that can handle valid list specs params -type ListSpecsHandler interface { - Handle(ListSpecsParams) middleware.Responder -} - -// NewListSpecs creates a new http.Handler for the list specs operation -func NewListSpecs(ctx *middleware.Context, handler ListSpecsHandler) *ListSpecs { - return &ListSpecs{Context: ctx, Handler: handler} -} - -/* ListSpecs swagger:route GET /specs Informational listSpecs - -Returns a list of API specs - -Returns a list of spec files embedded within the controller for consumption/documentation/code geneartion - -*/ -type ListSpecs struct { - Context *middleware.Context - Handler ListSpecsHandler -} - -func (o *ListSpecs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListSpecsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/informational/list_specs_parameters.go b/rest_management_api_server/operations/informational/list_specs_parameters.go deleted file mode 100644 index 4774b46eb..000000000 --- a/rest_management_api_server/operations/informational/list_specs_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListSpecsParams creates a new ListSpecsParams object -// -// There are no default values defined in the spec. -func NewListSpecsParams() ListSpecsParams { - - return ListSpecsParams{} -} - -// ListSpecsParams contains all the bound params for the list specs operation -// typically these are obtained from a http.Request -// -// swagger:parameters listSpecs -type ListSpecsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListSpecsParams() beforehand. -func (o *ListSpecsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/informational/list_specs_responses.go b/rest_management_api_server/operations/informational/list_specs_responses.go deleted file mode 100644 index b46b08e3a..000000000 --- a/rest_management_api_server/operations/informational/list_specs_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListSpecsOKCode is the HTTP code returned for type ListSpecsOK -const ListSpecsOKCode int = 200 - -/*ListSpecsOK A list of specifications - -swagger:response listSpecsOK -*/ -type ListSpecsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListSpecsEnvelope `json:"body,omitempty"` -} - -// NewListSpecsOK creates ListSpecsOK with default headers values -func NewListSpecsOK() *ListSpecsOK { - - return &ListSpecsOK{} -} - -// WithPayload adds the payload to the list specs o k response -func (o *ListSpecsOK) WithPayload(payload *rest_model.ListSpecsEnvelope) *ListSpecsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list specs o k response -func (o *ListSpecsOK) SetPayload(payload *rest_model.ListSpecsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSpecsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/informational/list_specs_urlbuilder.go b/rest_management_api_server/operations/informational/list_specs_urlbuilder.go deleted file mode 100644 index 2acfad120..000000000 --- a/rest_management_api_server/operations/informational/list_specs_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListSpecsURL generates an URL for the list specs operation -type ListSpecsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSpecsURL) WithBasePath(bp string) *ListSpecsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSpecsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListSpecsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/specs" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListSpecsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListSpecsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListSpecsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListSpecsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListSpecsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListSpecsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/informational/list_summary.go b/rest_management_api_server/operations/informational/list_summary.go deleted file mode 100644 index 788839218..000000000 --- a/rest_management_api_server/operations/informational/list_summary.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListSummaryHandlerFunc turns a function with the right signature into a list summary handler -type ListSummaryHandlerFunc func(ListSummaryParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListSummaryHandlerFunc) Handle(params ListSummaryParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListSummaryHandler interface for that can handle valid list summary params -type ListSummaryHandler interface { - Handle(ListSummaryParams, interface{}) middleware.Responder -} - -// NewListSummary creates a new http.Handler for the list summary operation -func NewListSummary(ctx *middleware.Context, handler ListSummaryHandler) *ListSummary { - return &ListSummary{Context: ctx, Handler: handler} -} - -/* ListSummary swagger:route GET /summary Informational listSummary - -Returns a list of accessible resource counts - -This endpoint is usefull for UIs that wish to display UI elements with counts. - -*/ -type ListSummary struct { - Context *middleware.Context - Handler ListSummaryHandler -} - -func (o *ListSummary) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListSummaryParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/informational/list_summary_parameters.go b/rest_management_api_server/operations/informational/list_summary_parameters.go deleted file mode 100644 index 7b76731e7..000000000 --- a/rest_management_api_server/operations/informational/list_summary_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListSummaryParams creates a new ListSummaryParams object -// -// There are no default values defined in the spec. -func NewListSummaryParams() ListSummaryParams { - - return ListSummaryParams{} -} - -// ListSummaryParams contains all the bound params for the list summary operation -// typically these are obtained from a http.Request -// -// swagger:parameters listSummary -type ListSummaryParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListSummaryParams() beforehand. -func (o *ListSummaryParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/informational/list_summary_responses.go b/rest_management_api_server/operations/informational/list_summary_responses.go deleted file mode 100644 index d2f16f9e7..000000000 --- a/rest_management_api_server/operations/informational/list_summary_responses.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListSummaryOKCode is the HTTP code returned for type ListSummaryOK -const ListSummaryOKCode int = 200 - -/*ListSummaryOK Entity counts scopped to the current identitie's access - -swagger:response listSummaryOK -*/ -type ListSummaryOK struct { - - /* - In: Body - */ - Payload *rest_model.ListSummaryCountsEnvelope `json:"body,omitempty"` -} - -// NewListSummaryOK creates ListSummaryOK with default headers values -func NewListSummaryOK() *ListSummaryOK { - - return &ListSummaryOK{} -} - -// WithPayload adds the payload to the list summary o k response -func (o *ListSummaryOK) WithPayload(payload *rest_model.ListSummaryCountsEnvelope) *ListSummaryOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list summary o k response -func (o *ListSummaryOK) SetPayload(payload *rest_model.ListSummaryCountsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSummaryOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListSummaryUnauthorizedCode is the HTTP code returned for type ListSummaryUnauthorized -const ListSummaryUnauthorizedCode int = 401 - -/*ListSummaryUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listSummaryUnauthorized -*/ -type ListSummaryUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListSummaryUnauthorized creates ListSummaryUnauthorized with default headers values -func NewListSummaryUnauthorized() *ListSummaryUnauthorized { - - return &ListSummaryUnauthorized{} -} - -// WithPayload adds the payload to the list summary unauthorized response -func (o *ListSummaryUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListSummaryUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list summary unauthorized response -func (o *ListSummaryUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSummaryUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/informational/list_summary_urlbuilder.go b/rest_management_api_server/operations/informational/list_summary_urlbuilder.go deleted file mode 100644 index 77a43061d..000000000 --- a/rest_management_api_server/operations/informational/list_summary_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListSummaryURL generates an URL for the list summary operation -type ListSummaryURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSummaryURL) WithBasePath(bp string) *ListSummaryURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSummaryURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListSummaryURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/summary" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListSummaryURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListSummaryURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListSummaryURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListSummaryURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListSummaryURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListSummaryURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/informational/list_version.go b/rest_management_api_server/operations/informational/list_version.go deleted file mode 100644 index 62369beda..000000000 --- a/rest_management_api_server/operations/informational/list_version.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListVersionHandlerFunc turns a function with the right signature into a list version handler -type ListVersionHandlerFunc func(ListVersionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListVersionHandlerFunc) Handle(params ListVersionParams) middleware.Responder { - return fn(params) -} - -// ListVersionHandler interface for that can handle valid list version params -type ListVersionHandler interface { - Handle(ListVersionParams) middleware.Responder -} - -// NewListVersion creates a new http.Handler for the list version operation -func NewListVersion(ctx *middleware.Context, handler ListVersionHandler) *ListVersion { - return &ListVersion{Context: ctx, Handler: handler} -} - -/* ListVersion swagger:route GET /version Informational listVersion - -Returns version information - -*/ -type ListVersion struct { - Context *middleware.Context - Handler ListVersionHandler -} - -func (o *ListVersion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListVersionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/informational/list_version_parameters.go b/rest_management_api_server/operations/informational/list_version_parameters.go deleted file mode 100644 index 995c50b01..000000000 --- a/rest_management_api_server/operations/informational/list_version_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewListVersionParams creates a new ListVersionParams object -// -// There are no default values defined in the spec. -func NewListVersionParams() ListVersionParams { - - return ListVersionParams{} -} - -// ListVersionParams contains all the bound params for the list version operation -// typically these are obtained from a http.Request -// -// swagger:parameters listVersion -type ListVersionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListVersionParams() beforehand. -func (o *ListVersionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/informational/list_version_responses.go b/rest_management_api_server/operations/informational/list_version_responses.go deleted file mode 100644 index 0d1f6f752..000000000 --- a/rest_management_api_server/operations/informational/list_version_responses.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListVersionOKCode is the HTTP code returned for type ListVersionOK -const ListVersionOKCode int = 200 - -/*ListVersionOK Version information for the controller - -swagger:response listVersionOK -*/ -type ListVersionOK struct { - - /* - In: Body - */ - Payload *rest_model.ListVersionEnvelope `json:"body,omitempty"` -} - -// NewListVersionOK creates ListVersionOK with default headers values -func NewListVersionOK() *ListVersionOK { - - return &ListVersionOK{} -} - -// WithPayload adds the payload to the list version o k response -func (o *ListVersionOK) WithPayload(payload *rest_model.ListVersionEnvelope) *ListVersionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list version o k response -func (o *ListVersionOK) SetPayload(payload *rest_model.ListVersionEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListVersionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/informational/list_version_urlbuilder.go b/rest_management_api_server/operations/informational/list_version_urlbuilder.go deleted file mode 100644 index 54a549ad6..000000000 --- a/rest_management_api_server/operations/informational/list_version_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package informational - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ListVersionURL generates an URL for the list version operation -type ListVersionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListVersionURL) WithBasePath(bp string) *ListVersionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListVersionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListVersionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/version" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListVersionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListVersionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListVersionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListVersionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListVersionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListVersionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/create_posture_check.go b/rest_management_api_server/operations/posture_checks/create_posture_check.go deleted file mode 100644 index 15bcd14c1..000000000 --- a/rest_management_api_server/operations/posture_checks/create_posture_check.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreatePostureCheckHandlerFunc turns a function with the right signature into a create posture check handler -type CreatePostureCheckHandlerFunc func(CreatePostureCheckParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreatePostureCheckHandlerFunc) Handle(params CreatePostureCheckParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreatePostureCheckHandler interface for that can handle valid create posture check params -type CreatePostureCheckHandler interface { - Handle(CreatePostureCheckParams, interface{}) middleware.Responder -} - -// NewCreatePostureCheck creates a new http.Handler for the create posture check operation -func NewCreatePostureCheck(ctx *middleware.Context, handler CreatePostureCheckHandler) *CreatePostureCheck { - return &CreatePostureCheck{Context: ctx, Handler: handler} -} - -/* CreatePostureCheck swagger:route POST /posture-checks Posture Checks createPostureCheck - -Creates a Posture Checks - -Creates a Posture Checks - -*/ -type CreatePostureCheck struct { - Context *middleware.Context - Handler CreatePostureCheckHandler -} - -func (o *CreatePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreatePostureCheckParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/create_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/create_posture_check_parameters.go deleted file mode 100644 index b5be049dc..000000000 --- a/rest_management_api_server/operations/posture_checks/create_posture_check_parameters.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreatePostureCheckParams creates a new CreatePostureCheckParams object -// -// There are no default values defined in the spec. -func NewCreatePostureCheckParams() CreatePostureCheckParams { - - return CreatePostureCheckParams{} -} - -// CreatePostureCheckParams contains all the bound params for the create posture check operation -// typically these are obtained from a http.Request -// -// swagger:parameters createPostureCheck -type CreatePostureCheckParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A Posture Check to create - Required: true - In: body - */ - PostureCheck rest_model.PostureCheckCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreatePostureCheckParams() beforehand. -func (o *CreatePostureCheckParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := rest_model.UnmarshalPostureCheckCreate(r.Body, route.Consumer) - if err != nil { - if err == io.EOF { - err = errors.Required("postureCheck", "body", "") - } - res = append(res, err) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PostureCheck = body - } - } - } else { - res = append(res, errors.Required("postureCheck", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/create_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/create_posture_check_responses.go deleted file mode 100644 index f0f401cb1..000000000 --- a/rest_management_api_server/operations/posture_checks/create_posture_check_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreatePostureCheckCreatedCode is the HTTP code returned for type CreatePostureCheckCreated -const CreatePostureCheckCreatedCode int = 201 - -/*CreatePostureCheckCreated The create request was successful and the resource has been added at the following location - -swagger:response createPostureCheckCreated -*/ -type CreatePostureCheckCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureCheckCreated creates CreatePostureCheckCreated with default headers values -func NewCreatePostureCheckCreated() *CreatePostureCheckCreated { - - return &CreatePostureCheckCreated{} -} - -// WithPayload adds the payload to the create posture check created response -func (o *CreatePostureCheckCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreatePostureCheckCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture check created response -func (o *CreatePostureCheckCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureCheckCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePostureCheckBadRequestCode is the HTTP code returned for type CreatePostureCheckBadRequest -const CreatePostureCheckBadRequestCode int = 400 - -/*CreatePostureCheckBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createPostureCheckBadRequest -*/ -type CreatePostureCheckBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureCheckBadRequest creates CreatePostureCheckBadRequest with default headers values -func NewCreatePostureCheckBadRequest() *CreatePostureCheckBadRequest { - - return &CreatePostureCheckBadRequest{} -} - -// WithPayload adds the payload to the create posture check bad request response -func (o *CreatePostureCheckBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreatePostureCheckBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture check bad request response -func (o *CreatePostureCheckBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureCheckBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePostureCheckUnauthorizedCode is the HTTP code returned for type CreatePostureCheckUnauthorized -const CreatePostureCheckUnauthorizedCode int = 401 - -/*CreatePostureCheckUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createPostureCheckUnauthorized -*/ -type CreatePostureCheckUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreatePostureCheckUnauthorized creates CreatePostureCheckUnauthorized with default headers values -func NewCreatePostureCheckUnauthorized() *CreatePostureCheckUnauthorized { - - return &CreatePostureCheckUnauthorized{} -} - -// WithPayload adds the payload to the create posture check unauthorized response -func (o *CreatePostureCheckUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreatePostureCheckUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create posture check unauthorized response -func (o *CreatePostureCheckUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePostureCheckUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/create_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/create_posture_check_urlbuilder.go deleted file mode 100644 index 51f2cd5d0..000000000 --- a/rest_management_api_server/operations/posture_checks/create_posture_check_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreatePostureCheckURL generates an URL for the create posture check operation -type CreatePostureCheckURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePostureCheckURL) WithBasePath(bp string) *CreatePostureCheckURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePostureCheckURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreatePostureCheckURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-checks" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreatePostureCheckURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreatePostureCheckURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreatePostureCheckURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreatePostureCheckURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreatePostureCheckURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreatePostureCheckURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/delete_posture_check.go b/rest_management_api_server/operations/posture_checks/delete_posture_check.go deleted file mode 100644 index 4c0c9f19a..000000000 --- a/rest_management_api_server/operations/posture_checks/delete_posture_check.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeletePostureCheckHandlerFunc turns a function with the right signature into a delete posture check handler -type DeletePostureCheckHandlerFunc func(DeletePostureCheckParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeletePostureCheckHandlerFunc) Handle(params DeletePostureCheckParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeletePostureCheckHandler interface for that can handle valid delete posture check params -type DeletePostureCheckHandler interface { - Handle(DeletePostureCheckParams, interface{}) middleware.Responder -} - -// NewDeletePostureCheck creates a new http.Handler for the delete posture check operation -func NewDeletePostureCheck(ctx *middleware.Context, handler DeletePostureCheckHandler) *DeletePostureCheck { - return &DeletePostureCheck{Context: ctx, Handler: handler} -} - -/* DeletePostureCheck swagger:route DELETE /posture-checks/{id} Posture Checks deletePostureCheck - -Deletes an Posture Checks - -Deletes and Posture Checks by id - -*/ -type DeletePostureCheck struct { - Context *middleware.Context - Handler DeletePostureCheckHandler -} - -func (o *DeletePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeletePostureCheckParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/delete_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/delete_posture_check_parameters.go deleted file mode 100644 index 3799fc4c5..000000000 --- a/rest_management_api_server/operations/posture_checks/delete_posture_check_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeletePostureCheckParams creates a new DeletePostureCheckParams object -// -// There are no default values defined in the spec. -func NewDeletePostureCheckParams() DeletePostureCheckParams { - - return DeletePostureCheckParams{} -} - -// DeletePostureCheckParams contains all the bound params for the delete posture check operation -// typically these are obtained from a http.Request -// -// swagger:parameters deletePostureCheck -type DeletePostureCheckParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeletePostureCheckParams() beforehand. -func (o *DeletePostureCheckParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeletePostureCheckParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/delete_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/delete_posture_check_responses.go deleted file mode 100644 index d1144c3f5..000000000 --- a/rest_management_api_server/operations/posture_checks/delete_posture_check_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeletePostureCheckOKCode is the HTTP code returned for type DeletePostureCheckOK -const DeletePostureCheckOKCode int = 200 - -/*DeletePostureCheckOK The delete request was successful and the resource has been removed - -swagger:response deletePostureCheckOK -*/ -type DeletePostureCheckOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeletePostureCheckOK creates DeletePostureCheckOK with default headers values -func NewDeletePostureCheckOK() *DeletePostureCheckOK { - - return &DeletePostureCheckOK{} -} - -// WithPayload adds the payload to the delete posture check o k response -func (o *DeletePostureCheckOK) WithPayload(payload *rest_model.Empty) *DeletePostureCheckOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete posture check o k response -func (o *DeletePostureCheckOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeletePostureCheckOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeletePostureCheckForbiddenCode is the HTTP code returned for type DeletePostureCheckForbidden -const DeletePostureCheckForbiddenCode int = 403 - -/*DeletePostureCheckForbidden The currently supplied session does not have the correct access rights to request this resource - -swagger:response deletePostureCheckForbidden -*/ -type DeletePostureCheckForbidden struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeletePostureCheckForbidden creates DeletePostureCheckForbidden with default headers values -func NewDeletePostureCheckForbidden() *DeletePostureCheckForbidden { - - return &DeletePostureCheckForbidden{} -} - -// WithPayload adds the payload to the delete posture check forbidden response -func (o *DeletePostureCheckForbidden) WithPayload(payload *rest_model.APIErrorEnvelope) *DeletePostureCheckForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete posture check forbidden response -func (o *DeletePostureCheckForbidden) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeletePostureCheckForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeletePostureCheckNotFoundCode is the HTTP code returned for type DeletePostureCheckNotFound -const DeletePostureCheckNotFoundCode int = 404 - -/*DeletePostureCheckNotFound The requested resource does not exist - -swagger:response deletePostureCheckNotFound -*/ -type DeletePostureCheckNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeletePostureCheckNotFound creates DeletePostureCheckNotFound with default headers values -func NewDeletePostureCheckNotFound() *DeletePostureCheckNotFound { - - return &DeletePostureCheckNotFound{} -} - -// WithPayload adds the payload to the delete posture check not found response -func (o *DeletePostureCheckNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DeletePostureCheckNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete posture check not found response -func (o *DeletePostureCheckNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeletePostureCheckNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/delete_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/delete_posture_check_urlbuilder.go deleted file mode 100644 index 4ba9f9fe6..000000000 --- a/rest_management_api_server/operations/posture_checks/delete_posture_check_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeletePostureCheckURL generates an URL for the delete posture check operation -type DeletePostureCheckURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeletePostureCheckURL) WithBasePath(bp string) *DeletePostureCheckURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeletePostureCheckURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeletePostureCheckURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-checks/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeletePostureCheckURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeletePostureCheckURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeletePostureCheckURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeletePostureCheckURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeletePostureCheckURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeletePostureCheckURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeletePostureCheckURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check.go b/rest_management_api_server/operations/posture_checks/detail_posture_check.go deleted file mode 100644 index af433df65..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailPostureCheckHandlerFunc turns a function with the right signature into a detail posture check handler -type DetailPostureCheckHandlerFunc func(DetailPostureCheckParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailPostureCheckHandlerFunc) Handle(params DetailPostureCheckParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailPostureCheckHandler interface for that can handle valid detail posture check params -type DetailPostureCheckHandler interface { - Handle(DetailPostureCheckParams, interface{}) middleware.Responder -} - -// NewDetailPostureCheck creates a new http.Handler for the detail posture check operation -func NewDetailPostureCheck(ctx *middleware.Context, handler DetailPostureCheckHandler) *DetailPostureCheck { - return &DetailPostureCheck{Context: ctx, Handler: handler} -} - -/* DetailPostureCheck swagger:route GET /posture-checks/{id} Posture Checks detailPostureCheck - -Retrieves a single Posture Checks - -Retrieves a single Posture Checks by id - -*/ -type DetailPostureCheck struct { - Context *middleware.Context - Handler DetailPostureCheckHandler -} - -func (o *DetailPostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailPostureCheckParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_parameters.go deleted file mode 100644 index 40117ffc7..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailPostureCheckParams creates a new DetailPostureCheckParams object -// -// There are no default values defined in the spec. -func NewDetailPostureCheckParams() DetailPostureCheckParams { - - return DetailPostureCheckParams{} -} - -// DetailPostureCheckParams contains all the bound params for the detail posture check operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailPostureCheck -type DetailPostureCheckParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailPostureCheckParams() beforehand. -func (o *DetailPostureCheckParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailPostureCheckParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_responses.go deleted file mode 100644 index 6731b0260..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailPostureCheckOKCode is the HTTP code returned for type DetailPostureCheckOK -const DetailPostureCheckOKCode int = 200 - -/*DetailPostureCheckOK Retrieves a singular posture check by id - -swagger:response detailPostureCheckOK -*/ -type DetailPostureCheckOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailPostureCheckEnvelope `json:"body,omitempty"` -} - -// NewDetailPostureCheckOK creates DetailPostureCheckOK with default headers values -func NewDetailPostureCheckOK() *DetailPostureCheckOK { - - return &DetailPostureCheckOK{} -} - -// WithPayload adds the payload to the detail posture check o k response -func (o *DetailPostureCheckOK) WithPayload(payload *rest_model.DetailPostureCheckEnvelope) *DetailPostureCheckOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail posture check o k response -func (o *DetailPostureCheckOK) SetPayload(payload *rest_model.DetailPostureCheckEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailPostureCheckOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailPostureCheckUnauthorizedCode is the HTTP code returned for type DetailPostureCheckUnauthorized -const DetailPostureCheckUnauthorizedCode int = 401 - -/*DetailPostureCheckUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailPostureCheckUnauthorized -*/ -type DetailPostureCheckUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailPostureCheckUnauthorized creates DetailPostureCheckUnauthorized with default headers values -func NewDetailPostureCheckUnauthorized() *DetailPostureCheckUnauthorized { - - return &DetailPostureCheckUnauthorized{} -} - -// WithPayload adds the payload to the detail posture check unauthorized response -func (o *DetailPostureCheckUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailPostureCheckUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail posture check unauthorized response -func (o *DetailPostureCheckUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailPostureCheckUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailPostureCheckNotFoundCode is the HTTP code returned for type DetailPostureCheckNotFound -const DetailPostureCheckNotFoundCode int = 404 - -/*DetailPostureCheckNotFound The requested resource does not exist - -swagger:response detailPostureCheckNotFound -*/ -type DetailPostureCheckNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailPostureCheckNotFound creates DetailPostureCheckNotFound with default headers values -func NewDetailPostureCheckNotFound() *DetailPostureCheckNotFound { - - return &DetailPostureCheckNotFound{} -} - -// WithPayload adds the payload to the detail posture check not found response -func (o *DetailPostureCheckNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailPostureCheckNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail posture check not found response -func (o *DetailPostureCheckNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailPostureCheckNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_type.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type.go deleted file mode 100644 index 9239a0285..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailPostureCheckTypeHandlerFunc turns a function with the right signature into a detail posture check type handler -type DetailPostureCheckTypeHandlerFunc func(DetailPostureCheckTypeParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailPostureCheckTypeHandlerFunc) Handle(params DetailPostureCheckTypeParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailPostureCheckTypeHandler interface for that can handle valid detail posture check type params -type DetailPostureCheckTypeHandler interface { - Handle(DetailPostureCheckTypeParams, interface{}) middleware.Responder -} - -// NewDetailPostureCheckType creates a new http.Handler for the detail posture check type operation -func NewDetailPostureCheckType(ctx *middleware.Context, handler DetailPostureCheckTypeHandler) *DetailPostureCheckType { - return &DetailPostureCheckType{Context: ctx, Handler: handler} -} - -/* DetailPostureCheckType swagger:route GET /posture-check-types/{id} Posture Checks detailPostureCheckType - -Retrieves a single posture check type - -Retrieves a single posture check type by id - -*/ -type DetailPostureCheckType struct { - Context *middleware.Context - Handler DetailPostureCheckTypeHandler -} - -func (o *DetailPostureCheckType) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailPostureCheckTypeParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_type_parameters.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_parameters.go deleted file mode 100644 index f94b21e52..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_type_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailPostureCheckTypeParams creates a new DetailPostureCheckTypeParams object -// -// There are no default values defined in the spec. -func NewDetailPostureCheckTypeParams() DetailPostureCheckTypeParams { - - return DetailPostureCheckTypeParams{} -} - -// DetailPostureCheckTypeParams contains all the bound params for the detail posture check type operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailPostureCheckType -type DetailPostureCheckTypeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailPostureCheckTypeParams() beforehand. -func (o *DetailPostureCheckTypeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailPostureCheckTypeParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_type_responses.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_responses.go deleted file mode 100644 index ab0e3f1dd..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_type_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailPostureCheckTypeOKCode is the HTTP code returned for type DetailPostureCheckTypeOK -const DetailPostureCheckTypeOKCode int = 200 - -/*DetailPostureCheckTypeOK Retrieves a singular posture check type by id - -swagger:response detailPostureCheckTypeOK -*/ -type DetailPostureCheckTypeOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailPostureCheckTypeEnvelope `json:"body,omitempty"` -} - -// NewDetailPostureCheckTypeOK creates DetailPostureCheckTypeOK with default headers values -func NewDetailPostureCheckTypeOK() *DetailPostureCheckTypeOK { - - return &DetailPostureCheckTypeOK{} -} - -// WithPayload adds the payload to the detail posture check type o k response -func (o *DetailPostureCheckTypeOK) WithPayload(payload *rest_model.DetailPostureCheckTypeEnvelope) *DetailPostureCheckTypeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail posture check type o k response -func (o *DetailPostureCheckTypeOK) SetPayload(payload *rest_model.DetailPostureCheckTypeEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailPostureCheckTypeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailPostureCheckTypeUnauthorizedCode is the HTTP code returned for type DetailPostureCheckTypeUnauthorized -const DetailPostureCheckTypeUnauthorizedCode int = 401 - -/*DetailPostureCheckTypeUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailPostureCheckTypeUnauthorized -*/ -type DetailPostureCheckTypeUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailPostureCheckTypeUnauthorized creates DetailPostureCheckTypeUnauthorized with default headers values -func NewDetailPostureCheckTypeUnauthorized() *DetailPostureCheckTypeUnauthorized { - - return &DetailPostureCheckTypeUnauthorized{} -} - -// WithPayload adds the payload to the detail posture check type unauthorized response -func (o *DetailPostureCheckTypeUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailPostureCheckTypeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail posture check type unauthorized response -func (o *DetailPostureCheckTypeUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailPostureCheckTypeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailPostureCheckTypeNotFoundCode is the HTTP code returned for type DetailPostureCheckTypeNotFound -const DetailPostureCheckTypeNotFoundCode int = 404 - -/*DetailPostureCheckTypeNotFound The requested resource does not exist - -swagger:response detailPostureCheckTypeNotFound -*/ -type DetailPostureCheckTypeNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailPostureCheckTypeNotFound creates DetailPostureCheckTypeNotFound with default headers values -func NewDetailPostureCheckTypeNotFound() *DetailPostureCheckTypeNotFound { - - return &DetailPostureCheckTypeNotFound{} -} - -// WithPayload adds the payload to the detail posture check type not found response -func (o *DetailPostureCheckTypeNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailPostureCheckTypeNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail posture check type not found response -func (o *DetailPostureCheckTypeNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailPostureCheckTypeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go deleted file mode 100644 index 7eb815e7d..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_type_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailPostureCheckTypeURL generates an URL for the detail posture check type operation -type DetailPostureCheckTypeURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailPostureCheckTypeURL) WithBasePath(bp string) *DetailPostureCheckTypeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailPostureCheckTypeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailPostureCheckTypeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-check-types/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailPostureCheckTypeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailPostureCheckTypeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailPostureCheckTypeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailPostureCheckTypeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailPostureCheckTypeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailPostureCheckTypeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailPostureCheckTypeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/detail_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/detail_posture_check_urlbuilder.go deleted file mode 100644 index 1f292d468..000000000 --- a/rest_management_api_server/operations/posture_checks/detail_posture_check_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailPostureCheckURL generates an URL for the detail posture check operation -type DetailPostureCheckURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailPostureCheckURL) WithBasePath(bp string) *DetailPostureCheckURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailPostureCheckURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailPostureCheckURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-checks/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailPostureCheckURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailPostureCheckURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailPostureCheckURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailPostureCheckURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailPostureCheckURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailPostureCheckURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailPostureCheckURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_check_types.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types.go deleted file mode 100644 index 7e6700db5..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_check_types.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListPostureCheckTypesHandlerFunc turns a function with the right signature into a list posture check types handler -type ListPostureCheckTypesHandlerFunc func(ListPostureCheckTypesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListPostureCheckTypesHandlerFunc) Handle(params ListPostureCheckTypesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListPostureCheckTypesHandler interface for that can handle valid list posture check types params -type ListPostureCheckTypesHandler interface { - Handle(ListPostureCheckTypesParams, interface{}) middleware.Responder -} - -// NewListPostureCheckTypes creates a new http.Handler for the list posture check types operation -func NewListPostureCheckTypes(ctx *middleware.Context, handler ListPostureCheckTypesHandler) *ListPostureCheckTypes { - return &ListPostureCheckTypes{Context: ctx, Handler: handler} -} - -/* ListPostureCheckTypes swagger:route GET /posture-check-types Posture Checks listPostureCheckTypes - -List a subset of posture check types - -Retrieves a list of posture check types - - -*/ -type ListPostureCheckTypes struct { - Context *middleware.Context - Handler ListPostureCheckTypesHandler -} - -func (o *ListPostureCheckTypes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListPostureCheckTypesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_check_types_parameters.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types_parameters.go deleted file mode 100644 index b3ecfb288..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_check_types_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListPostureCheckTypesParams creates a new ListPostureCheckTypesParams object -// -// There are no default values defined in the spec. -func NewListPostureCheckTypesParams() ListPostureCheckTypesParams { - - return ListPostureCheckTypesParams{} -} - -// ListPostureCheckTypesParams contains all the bound params for the list posture check types operation -// typically these are obtained from a http.Request -// -// swagger:parameters listPostureCheckTypes -type ListPostureCheckTypesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListPostureCheckTypesParams() beforehand. -func (o *ListPostureCheckTypesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListPostureCheckTypesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListPostureCheckTypesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListPostureCheckTypesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_check_types_responses.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types_responses.go deleted file mode 100644 index f6a7ae611..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_check_types_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListPostureCheckTypesOKCode is the HTTP code returned for type ListPostureCheckTypesOK -const ListPostureCheckTypesOKCode int = 200 - -/*ListPostureCheckTypesOK A list of posture check types - -swagger:response listPostureCheckTypesOK -*/ -type ListPostureCheckTypesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListPostureCheckTypesEnvelope `json:"body,omitempty"` -} - -// NewListPostureCheckTypesOK creates ListPostureCheckTypesOK with default headers values -func NewListPostureCheckTypesOK() *ListPostureCheckTypesOK { - - return &ListPostureCheckTypesOK{} -} - -// WithPayload adds the payload to the list posture check types o k response -func (o *ListPostureCheckTypesOK) WithPayload(payload *rest_model.ListPostureCheckTypesEnvelope) *ListPostureCheckTypesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list posture check types o k response -func (o *ListPostureCheckTypesOK) SetPayload(payload *rest_model.ListPostureCheckTypesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPostureCheckTypesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListPostureCheckTypesBadRequestCode is the HTTP code returned for type ListPostureCheckTypesBadRequest -const ListPostureCheckTypesBadRequestCode int = 400 - -/*ListPostureCheckTypesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listPostureCheckTypesBadRequest -*/ -type ListPostureCheckTypesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListPostureCheckTypesBadRequest creates ListPostureCheckTypesBadRequest with default headers values -func NewListPostureCheckTypesBadRequest() *ListPostureCheckTypesBadRequest { - - return &ListPostureCheckTypesBadRequest{} -} - -// WithPayload adds the payload to the list posture check types bad request response -func (o *ListPostureCheckTypesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureCheckTypesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list posture check types bad request response -func (o *ListPostureCheckTypesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPostureCheckTypesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListPostureCheckTypesUnauthorizedCode is the HTTP code returned for type ListPostureCheckTypesUnauthorized -const ListPostureCheckTypesUnauthorizedCode int = 401 - -/*ListPostureCheckTypesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listPostureCheckTypesUnauthorized -*/ -type ListPostureCheckTypesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListPostureCheckTypesUnauthorized creates ListPostureCheckTypesUnauthorized with default headers values -func NewListPostureCheckTypesUnauthorized() *ListPostureCheckTypesUnauthorized { - - return &ListPostureCheckTypesUnauthorized{} -} - -// WithPayload adds the payload to the list posture check types unauthorized response -func (o *ListPostureCheckTypesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureCheckTypesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list posture check types unauthorized response -func (o *ListPostureCheckTypesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPostureCheckTypesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_check_types_urlbuilder.go b/rest_management_api_server/operations/posture_checks/list_posture_check_types_urlbuilder.go deleted file mode 100644 index 613c7ce42..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_check_types_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListPostureCheckTypesURL generates an URL for the list posture check types operation -type ListPostureCheckTypesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListPostureCheckTypesURL) WithBasePath(bp string) *ListPostureCheckTypesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListPostureCheckTypesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListPostureCheckTypesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-check-types" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListPostureCheckTypesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListPostureCheckTypesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListPostureCheckTypesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListPostureCheckTypesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListPostureCheckTypesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListPostureCheckTypesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_checks.go b/rest_management_api_server/operations/posture_checks/list_posture_checks.go deleted file mode 100644 index c6cc6a13b..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_checks.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListPostureChecksHandlerFunc turns a function with the right signature into a list posture checks handler -type ListPostureChecksHandlerFunc func(ListPostureChecksParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListPostureChecksHandlerFunc) Handle(params ListPostureChecksParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListPostureChecksHandler interface for that can handle valid list posture checks params -type ListPostureChecksHandler interface { - Handle(ListPostureChecksParams, interface{}) middleware.Responder -} - -// NewListPostureChecks creates a new http.Handler for the list posture checks operation -func NewListPostureChecks(ctx *middleware.Context, handler ListPostureChecksHandler) *ListPostureChecks { - return &ListPostureChecks{Context: ctx, Handler: handler} -} - -/* ListPostureChecks swagger:route GET /posture-checks Posture Checks listPostureChecks - -List a subset of posture checks - -Retrieves a list of posture checks - - -*/ -type ListPostureChecks struct { - Context *middleware.Context - Handler ListPostureChecksHandler -} - -func (o *ListPostureChecks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListPostureChecksParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_checks_parameters.go b/rest_management_api_server/operations/posture_checks/list_posture_checks_parameters.go deleted file mode 100644 index 195ab1001..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_checks_parameters.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListPostureChecksParams creates a new ListPostureChecksParams object -// -// There are no default values defined in the spec. -func NewListPostureChecksParams() ListPostureChecksParams { - - return ListPostureChecksParams{} -} - -// ListPostureChecksParams contains all the bound params for the list posture checks operation -// typically these are obtained from a http.Request -// -// swagger:parameters listPostureChecks -type ListPostureChecksParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /* - In: query - Collection Format: multi - */ - RoleFilter []string - /* - In: query - */ - RoleSemantic *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListPostureChecksParams() beforehand. -func (o *ListPostureChecksParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qRoleFilter, qhkRoleFilter, _ := qs.GetOK("roleFilter") - if err := o.bindRoleFilter(qRoleFilter, qhkRoleFilter, route.Formats); err != nil { - res = append(res, err) - } - - qRoleSemantic, qhkRoleSemantic, _ := qs.GetOK("roleSemantic") - if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListPostureChecksParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListPostureChecksParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListPostureChecksParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindRoleFilter binds and validates array parameter RoleFilter from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *ListPostureChecksParams) bindRoleFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - roleFilterIC := rawData - if len(roleFilterIC) == 0 { - return nil - } - - var roleFilterIR []string - for _, roleFilterIV := range roleFilterIC { - roleFilterI := roleFilterIV - - roleFilterIR = append(roleFilterIR, roleFilterI) - } - - o.RoleFilter = roleFilterIR - - return nil -} - -// bindRoleSemantic binds and validates parameter RoleSemantic from query. -func (o *ListPostureChecksParams) bindRoleSemantic(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RoleSemantic = &raw - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_checks_responses.go b/rest_management_api_server/operations/posture_checks/list_posture_checks_responses.go deleted file mode 100644 index bd3fd29fd..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_checks_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListPostureChecksOKCode is the HTTP code returned for type ListPostureChecksOK -const ListPostureChecksOKCode int = 200 - -/*ListPostureChecksOK A list of posture checks - -swagger:response listPostureChecksOK -*/ -type ListPostureChecksOK struct { - - /* - In: Body - */ - Payload *rest_model.ListPostureCheckEnvelope `json:"body,omitempty"` -} - -// NewListPostureChecksOK creates ListPostureChecksOK with default headers values -func NewListPostureChecksOK() *ListPostureChecksOK { - - return &ListPostureChecksOK{} -} - -// WithPayload adds the payload to the list posture checks o k response -func (o *ListPostureChecksOK) WithPayload(payload *rest_model.ListPostureCheckEnvelope) *ListPostureChecksOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list posture checks o k response -func (o *ListPostureChecksOK) SetPayload(payload *rest_model.ListPostureCheckEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPostureChecksOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListPostureChecksBadRequestCode is the HTTP code returned for type ListPostureChecksBadRequest -const ListPostureChecksBadRequestCode int = 400 - -/*ListPostureChecksBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listPostureChecksBadRequest -*/ -type ListPostureChecksBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListPostureChecksBadRequest creates ListPostureChecksBadRequest with default headers values -func NewListPostureChecksBadRequest() *ListPostureChecksBadRequest { - - return &ListPostureChecksBadRequest{} -} - -// WithPayload adds the payload to the list posture checks bad request response -func (o *ListPostureChecksBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureChecksBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list posture checks bad request response -func (o *ListPostureChecksBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPostureChecksBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListPostureChecksUnauthorizedCode is the HTTP code returned for type ListPostureChecksUnauthorized -const ListPostureChecksUnauthorizedCode int = 401 - -/*ListPostureChecksUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listPostureChecksUnauthorized -*/ -type ListPostureChecksUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListPostureChecksUnauthorized creates ListPostureChecksUnauthorized with default headers values -func NewListPostureChecksUnauthorized() *ListPostureChecksUnauthorized { - - return &ListPostureChecksUnauthorized{} -} - -// WithPayload adds the payload to the list posture checks unauthorized response -func (o *ListPostureChecksUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListPostureChecksUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list posture checks unauthorized response -func (o *ListPostureChecksUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPostureChecksUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/list_posture_checks_urlbuilder.go b/rest_management_api_server/operations/posture_checks/list_posture_checks_urlbuilder.go deleted file mode 100644 index 383c1dde3..000000000 --- a/rest_management_api_server/operations/posture_checks/list_posture_checks_urlbuilder.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListPostureChecksURL generates an URL for the list posture checks operation -type ListPostureChecksURL struct { - Filter *string - Limit *int64 - Offset *int64 - RoleFilter []string - RoleSemantic *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListPostureChecksURL) WithBasePath(bp string) *ListPostureChecksURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListPostureChecksURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListPostureChecksURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-checks" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var roleFilterIR []string - for _, roleFilterI := range o.RoleFilter { - roleFilterIS := roleFilterI - if roleFilterIS != "" { - roleFilterIR = append(roleFilterIR, roleFilterIS) - } - } - - roleFilter := swag.JoinByFormat(roleFilterIR, "multi") - - for _, qsv := range roleFilter { - qs.Add("roleFilter", qsv) - } - - var roleSemanticQ string - if o.RoleSemantic != nil { - roleSemanticQ = *o.RoleSemantic - } - if roleSemanticQ != "" { - qs.Set("roleSemantic", roleSemanticQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListPostureChecksURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListPostureChecksURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListPostureChecksURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListPostureChecksURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListPostureChecksURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListPostureChecksURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/patch_posture_check.go b/rest_management_api_server/operations/posture_checks/patch_posture_check.go deleted file mode 100644 index e38b99478..000000000 --- a/rest_management_api_server/operations/posture_checks/patch_posture_check.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchPostureCheckHandlerFunc turns a function with the right signature into a patch posture check handler -type PatchPostureCheckHandlerFunc func(PatchPostureCheckParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchPostureCheckHandlerFunc) Handle(params PatchPostureCheckParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchPostureCheckHandler interface for that can handle valid patch posture check params -type PatchPostureCheckHandler interface { - Handle(PatchPostureCheckParams, interface{}) middleware.Responder -} - -// NewPatchPostureCheck creates a new http.Handler for the patch posture check operation -func NewPatchPostureCheck(ctx *middleware.Context, handler PatchPostureCheckHandler) *PatchPostureCheck { - return &PatchPostureCheck{Context: ctx, Handler: handler} -} - -/* PatchPostureCheck swagger:route PATCH /posture-checks/{id} Posture Checks patchPostureCheck - -Update the supplied fields on a Posture Checks - -Update only the supplied fields on a Posture Checks by id - -*/ -type PatchPostureCheck struct { - Context *middleware.Context - Handler PatchPostureCheckHandler -} - -func (o *PatchPostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchPostureCheckParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/patch_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/patch_posture_check_parameters.go deleted file mode 100644 index af4a709d7..000000000 --- a/rest_management_api_server/operations/posture_checks/patch_posture_check_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchPostureCheckParams creates a new PatchPostureCheckParams object -// -// There are no default values defined in the spec. -func NewPatchPostureCheckParams() PatchPostureCheckParams { - - return PatchPostureCheckParams{} -} - -// PatchPostureCheckParams contains all the bound params for the patch posture check operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchPostureCheck -type PatchPostureCheckParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A Posture Check patch object - Required: true - In: body - */ - PostureCheck rest_model.PostureCheckPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchPostureCheckParams() beforehand. -func (o *PatchPostureCheckParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := rest_model.UnmarshalPostureCheckPatch(r.Body, route.Consumer) - if err != nil { - if err == io.EOF { - err = errors.Required("postureCheck", "body", "") - } - res = append(res, err) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PostureCheck = body - } - } - } else { - res = append(res, errors.Required("postureCheck", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchPostureCheckParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/patch_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/patch_posture_check_responses.go deleted file mode 100644 index 88009740d..000000000 --- a/rest_management_api_server/operations/posture_checks/patch_posture_check_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchPostureCheckOKCode is the HTTP code returned for type PatchPostureCheckOK -const PatchPostureCheckOKCode int = 200 - -/*PatchPostureCheckOK The patch request was successful and the resource has been altered - -swagger:response patchPostureCheckOK -*/ -type PatchPostureCheckOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchPostureCheckOK creates PatchPostureCheckOK with default headers values -func NewPatchPostureCheckOK() *PatchPostureCheckOK { - - return &PatchPostureCheckOK{} -} - -// WithPayload adds the payload to the patch posture check o k response -func (o *PatchPostureCheckOK) WithPayload(payload *rest_model.Empty) *PatchPostureCheckOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch posture check o k response -func (o *PatchPostureCheckOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchPostureCheckOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchPostureCheckBadRequestCode is the HTTP code returned for type PatchPostureCheckBadRequest -const PatchPostureCheckBadRequestCode int = 400 - -/*PatchPostureCheckBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchPostureCheckBadRequest -*/ -type PatchPostureCheckBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchPostureCheckBadRequest creates PatchPostureCheckBadRequest with default headers values -func NewPatchPostureCheckBadRequest() *PatchPostureCheckBadRequest { - - return &PatchPostureCheckBadRequest{} -} - -// WithPayload adds the payload to the patch posture check bad request response -func (o *PatchPostureCheckBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchPostureCheckBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch posture check bad request response -func (o *PatchPostureCheckBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchPostureCheckBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchPostureCheckUnauthorizedCode is the HTTP code returned for type PatchPostureCheckUnauthorized -const PatchPostureCheckUnauthorizedCode int = 401 - -/*PatchPostureCheckUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchPostureCheckUnauthorized -*/ -type PatchPostureCheckUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchPostureCheckUnauthorized creates PatchPostureCheckUnauthorized with default headers values -func NewPatchPostureCheckUnauthorized() *PatchPostureCheckUnauthorized { - - return &PatchPostureCheckUnauthorized{} -} - -// WithPayload adds the payload to the patch posture check unauthorized response -func (o *PatchPostureCheckUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchPostureCheckUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch posture check unauthorized response -func (o *PatchPostureCheckUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchPostureCheckUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchPostureCheckNotFoundCode is the HTTP code returned for type PatchPostureCheckNotFound -const PatchPostureCheckNotFoundCode int = 404 - -/*PatchPostureCheckNotFound The requested resource does not exist - -swagger:response patchPostureCheckNotFound -*/ -type PatchPostureCheckNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchPostureCheckNotFound creates PatchPostureCheckNotFound with default headers values -func NewPatchPostureCheckNotFound() *PatchPostureCheckNotFound { - - return &PatchPostureCheckNotFound{} -} - -// WithPayload adds the payload to the patch posture check not found response -func (o *PatchPostureCheckNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchPostureCheckNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch posture check not found response -func (o *PatchPostureCheckNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchPostureCheckNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/patch_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/patch_posture_check_urlbuilder.go deleted file mode 100644 index c25dacfc7..000000000 --- a/rest_management_api_server/operations/posture_checks/patch_posture_check_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchPostureCheckURL generates an URL for the patch posture check operation -type PatchPostureCheckURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchPostureCheckURL) WithBasePath(bp string) *PatchPostureCheckURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchPostureCheckURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchPostureCheckURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-checks/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchPostureCheckURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchPostureCheckURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchPostureCheckURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchPostureCheckURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchPostureCheckURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchPostureCheckURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchPostureCheckURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/posture_checks/update_posture_check.go b/rest_management_api_server/operations/posture_checks/update_posture_check.go deleted file mode 100644 index 3539425f9..000000000 --- a/rest_management_api_server/operations/posture_checks/update_posture_check.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdatePostureCheckHandlerFunc turns a function with the right signature into a update posture check handler -type UpdatePostureCheckHandlerFunc func(UpdatePostureCheckParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdatePostureCheckHandlerFunc) Handle(params UpdatePostureCheckParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdatePostureCheckHandler interface for that can handle valid update posture check params -type UpdatePostureCheckHandler interface { - Handle(UpdatePostureCheckParams, interface{}) middleware.Responder -} - -// NewUpdatePostureCheck creates a new http.Handler for the update posture check operation -func NewUpdatePostureCheck(ctx *middleware.Context, handler UpdatePostureCheckHandler) *UpdatePostureCheck { - return &UpdatePostureCheck{Context: ctx, Handler: handler} -} - -/* UpdatePostureCheck swagger:route PUT /posture-checks/{id} Posture Checks updatePostureCheck - -Update all fields on a Posture Checks - -Update all fields on a Posture Checks by id - -*/ -type UpdatePostureCheck struct { - Context *middleware.Context - Handler UpdatePostureCheckHandler -} - -func (o *UpdatePostureCheck) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdatePostureCheckParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/posture_checks/update_posture_check_parameters.go b/rest_management_api_server/operations/posture_checks/update_posture_check_parameters.go deleted file mode 100644 index b3161028f..000000000 --- a/rest_management_api_server/operations/posture_checks/update_posture_check_parameters.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdatePostureCheckParams creates a new UpdatePostureCheckParams object -// -// There are no default values defined in the spec. -func NewUpdatePostureCheckParams() UpdatePostureCheckParams { - - return UpdatePostureCheckParams{} -} - -// UpdatePostureCheckParams contains all the bound params for the update posture check operation -// typically these are obtained from a http.Request -// -// swagger:parameters updatePostureCheck -type UpdatePostureCheckParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A Posture Check update object - Required: true - In: body - */ - PostureCheck rest_model.PostureCheckUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdatePostureCheckParams() beforehand. -func (o *UpdatePostureCheckParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := rest_model.UnmarshalPostureCheckUpdate(r.Body, route.Consumer) - if err != nil { - if err == io.EOF { - err = errors.Required("postureCheck", "body", "") - } - res = append(res, err) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PostureCheck = body - } - } - } else { - res = append(res, errors.Required("postureCheck", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdatePostureCheckParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/posture_checks/update_posture_check_responses.go b/rest_management_api_server/operations/posture_checks/update_posture_check_responses.go deleted file mode 100644 index 435925a65..000000000 --- a/rest_management_api_server/operations/posture_checks/update_posture_check_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdatePostureCheckOKCode is the HTTP code returned for type UpdatePostureCheckOK -const UpdatePostureCheckOKCode int = 200 - -/*UpdatePostureCheckOK The update request was successful and the resource has been altered - -swagger:response updatePostureCheckOK -*/ -type UpdatePostureCheckOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdatePostureCheckOK creates UpdatePostureCheckOK with default headers values -func NewUpdatePostureCheckOK() *UpdatePostureCheckOK { - - return &UpdatePostureCheckOK{} -} - -// WithPayload adds the payload to the update posture check o k response -func (o *UpdatePostureCheckOK) WithPayload(payload *rest_model.Empty) *UpdatePostureCheckOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update posture check o k response -func (o *UpdatePostureCheckOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePostureCheckOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePostureCheckBadRequestCode is the HTTP code returned for type UpdatePostureCheckBadRequest -const UpdatePostureCheckBadRequestCode int = 400 - -/*UpdatePostureCheckBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updatePostureCheckBadRequest -*/ -type UpdatePostureCheckBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdatePostureCheckBadRequest creates UpdatePostureCheckBadRequest with default headers values -func NewUpdatePostureCheckBadRequest() *UpdatePostureCheckBadRequest { - - return &UpdatePostureCheckBadRequest{} -} - -// WithPayload adds the payload to the update posture check bad request response -func (o *UpdatePostureCheckBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdatePostureCheckBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update posture check bad request response -func (o *UpdatePostureCheckBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePostureCheckBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePostureCheckUnauthorizedCode is the HTTP code returned for type UpdatePostureCheckUnauthorized -const UpdatePostureCheckUnauthorizedCode int = 401 - -/*UpdatePostureCheckUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updatePostureCheckUnauthorized -*/ -type UpdatePostureCheckUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdatePostureCheckUnauthorized creates UpdatePostureCheckUnauthorized with default headers values -func NewUpdatePostureCheckUnauthorized() *UpdatePostureCheckUnauthorized { - - return &UpdatePostureCheckUnauthorized{} -} - -// WithPayload adds the payload to the update posture check unauthorized response -func (o *UpdatePostureCheckUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdatePostureCheckUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update posture check unauthorized response -func (o *UpdatePostureCheckUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePostureCheckUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePostureCheckNotFoundCode is the HTTP code returned for type UpdatePostureCheckNotFound -const UpdatePostureCheckNotFoundCode int = 404 - -/*UpdatePostureCheckNotFound The requested resource does not exist - -swagger:response updatePostureCheckNotFound -*/ -type UpdatePostureCheckNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdatePostureCheckNotFound creates UpdatePostureCheckNotFound with default headers values -func NewUpdatePostureCheckNotFound() *UpdatePostureCheckNotFound { - - return &UpdatePostureCheckNotFound{} -} - -// WithPayload adds the payload to the update posture check not found response -func (o *UpdatePostureCheckNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdatePostureCheckNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update posture check not found response -func (o *UpdatePostureCheckNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePostureCheckNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/posture_checks/update_posture_check_urlbuilder.go b/rest_management_api_server/operations/posture_checks/update_posture_check_urlbuilder.go deleted file mode 100644 index 4172070f8..000000000 --- a/rest_management_api_server/operations/posture_checks/update_posture_check_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package posture_checks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdatePostureCheckURL generates an URL for the update posture check operation -type UpdatePostureCheckURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePostureCheckURL) WithBasePath(bp string) *UpdatePostureCheckURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePostureCheckURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdatePostureCheckURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/posture-checks/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdatePostureCheckURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdatePostureCheckURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdatePostureCheckURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdatePostureCheckURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdatePostureCheckURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdatePostureCheckURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdatePostureCheckURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes.go deleted file mode 100644 index 2dfde1fb1..000000000 --- a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListEdgeRouterRoleAttributesHandlerFunc turns a function with the right signature into a list edge router role attributes handler -type ListEdgeRouterRoleAttributesHandlerFunc func(ListEdgeRouterRoleAttributesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListEdgeRouterRoleAttributesHandlerFunc) Handle(params ListEdgeRouterRoleAttributesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListEdgeRouterRoleAttributesHandler interface for that can handle valid list edge router role attributes params -type ListEdgeRouterRoleAttributesHandler interface { - Handle(ListEdgeRouterRoleAttributesParams, interface{}) middleware.Responder -} - -// NewListEdgeRouterRoleAttributes creates a new http.Handler for the list edge router role attributes operation -func NewListEdgeRouterRoleAttributes(ctx *middleware.Context, handler ListEdgeRouterRoleAttributesHandler) *ListEdgeRouterRoleAttributes { - return &ListEdgeRouterRoleAttributes{Context: ctx, Handler: handler} -} - -/* ListEdgeRouterRoleAttributes swagger:route GET /edge-router-role-attributes Role Attributes listEdgeRouterRoleAttributes - -List role attributes in use by edge routers - -Retrieves a list of role attributes in use by edge routers; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListEdgeRouterRoleAttributes struct { - Context *middleware.Context - Handler ListEdgeRouterRoleAttributesHandler -} - -func (o *ListEdgeRouterRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListEdgeRouterRoleAttributesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_parameters.go b/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_parameters.go deleted file mode 100644 index 86fc468bc..000000000 --- a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListEdgeRouterRoleAttributesParams creates a new ListEdgeRouterRoleAttributesParams object -// -// There are no default values defined in the spec. -func NewListEdgeRouterRoleAttributesParams() ListEdgeRouterRoleAttributesParams { - - return ListEdgeRouterRoleAttributesParams{} -} - -// ListEdgeRouterRoleAttributesParams contains all the bound params for the list edge router role attributes operation -// typically these are obtained from a http.Request -// -// swagger:parameters listEdgeRouterRoleAttributes -type ListEdgeRouterRoleAttributesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListEdgeRouterRoleAttributesParams() beforehand. -func (o *ListEdgeRouterRoleAttributesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListEdgeRouterRoleAttributesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListEdgeRouterRoleAttributesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListEdgeRouterRoleAttributesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_responses.go b/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_responses.go deleted file mode 100644 index 39d75ff91..000000000 --- a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListEdgeRouterRoleAttributesOKCode is the HTTP code returned for type ListEdgeRouterRoleAttributesOK -const ListEdgeRouterRoleAttributesOKCode int = 200 - -/*ListEdgeRouterRoleAttributesOK A list of role attributes - -swagger:response listEdgeRouterRoleAttributesOK -*/ -type ListEdgeRouterRoleAttributesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListRoleAttributesEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterRoleAttributesOK creates ListEdgeRouterRoleAttributesOK with default headers values -func NewListEdgeRouterRoleAttributesOK() *ListEdgeRouterRoleAttributesOK { - - return &ListEdgeRouterRoleAttributesOK{} -} - -// WithPayload adds the payload to the list edge router role attributes o k response -func (o *ListEdgeRouterRoleAttributesOK) WithPayload(payload *rest_model.ListRoleAttributesEnvelope) *ListEdgeRouterRoleAttributesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router role attributes o k response -func (o *ListEdgeRouterRoleAttributesOK) SetPayload(payload *rest_model.ListRoleAttributesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterRoleAttributesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterRoleAttributesBadRequestCode is the HTTP code returned for type ListEdgeRouterRoleAttributesBadRequest -const ListEdgeRouterRoleAttributesBadRequestCode int = 400 - -/*ListEdgeRouterRoleAttributesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listEdgeRouterRoleAttributesBadRequest -*/ -type ListEdgeRouterRoleAttributesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterRoleAttributesBadRequest creates ListEdgeRouterRoleAttributesBadRequest with default headers values -func NewListEdgeRouterRoleAttributesBadRequest() *ListEdgeRouterRoleAttributesBadRequest { - - return &ListEdgeRouterRoleAttributesBadRequest{} -} - -// WithPayload adds the payload to the list edge router role attributes bad request response -func (o *ListEdgeRouterRoleAttributesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterRoleAttributesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router role attributes bad request response -func (o *ListEdgeRouterRoleAttributesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterRoleAttributesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListEdgeRouterRoleAttributesUnauthorizedCode is the HTTP code returned for type ListEdgeRouterRoleAttributesUnauthorized -const ListEdgeRouterRoleAttributesUnauthorizedCode int = 401 - -/*ListEdgeRouterRoleAttributesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listEdgeRouterRoleAttributesUnauthorized -*/ -type ListEdgeRouterRoleAttributesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListEdgeRouterRoleAttributesUnauthorized creates ListEdgeRouterRoleAttributesUnauthorized with default headers values -func NewListEdgeRouterRoleAttributesUnauthorized() *ListEdgeRouterRoleAttributesUnauthorized { - - return &ListEdgeRouterRoleAttributesUnauthorized{} -} - -// WithPayload adds the payload to the list edge router role attributes unauthorized response -func (o *ListEdgeRouterRoleAttributesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListEdgeRouterRoleAttributesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list edge router role attributes unauthorized response -func (o *ListEdgeRouterRoleAttributesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListEdgeRouterRoleAttributesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_urlbuilder.go b/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_urlbuilder.go deleted file mode 100644 index 45cc82d7a..000000000 --- a/rest_management_api_server/operations/role_attributes/list_edge_router_role_attributes_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListEdgeRouterRoleAttributesURL generates an URL for the list edge router role attributes operation -type ListEdgeRouterRoleAttributesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterRoleAttributesURL) WithBasePath(bp string) *ListEdgeRouterRoleAttributesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListEdgeRouterRoleAttributesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListEdgeRouterRoleAttributesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/edge-router-role-attributes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListEdgeRouterRoleAttributesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListEdgeRouterRoleAttributesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListEdgeRouterRoleAttributesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListEdgeRouterRoleAttributesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListEdgeRouterRoleAttributesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListEdgeRouterRoleAttributesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes.go deleted file mode 100644 index cab3429d2..000000000 --- a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListIdentityRoleAttributesHandlerFunc turns a function with the right signature into a list identity role attributes handler -type ListIdentityRoleAttributesHandlerFunc func(ListIdentityRoleAttributesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListIdentityRoleAttributesHandlerFunc) Handle(params ListIdentityRoleAttributesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListIdentityRoleAttributesHandler interface for that can handle valid list identity role attributes params -type ListIdentityRoleAttributesHandler interface { - Handle(ListIdentityRoleAttributesParams, interface{}) middleware.Responder -} - -// NewListIdentityRoleAttributes creates a new http.Handler for the list identity role attributes operation -func NewListIdentityRoleAttributes(ctx *middleware.Context, handler ListIdentityRoleAttributesHandler) *ListIdentityRoleAttributes { - return &ListIdentityRoleAttributes{Context: ctx, Handler: handler} -} - -/* ListIdentityRoleAttributes swagger:route GET /identity-role-attributes Role Attributes listIdentityRoleAttributes - -List role attributes in use by identities - -Retrieves a list of role attributes in use by identities; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListIdentityRoleAttributes struct { - Context *middleware.Context - Handler ListIdentityRoleAttributesHandler -} - -func (o *ListIdentityRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListIdentityRoleAttributesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_parameters.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_parameters.go deleted file mode 100644 index bd235d6e7..000000000 --- a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListIdentityRoleAttributesParams creates a new ListIdentityRoleAttributesParams object -// -// There are no default values defined in the spec. -func NewListIdentityRoleAttributesParams() ListIdentityRoleAttributesParams { - - return ListIdentityRoleAttributesParams{} -} - -// ListIdentityRoleAttributesParams contains all the bound params for the list identity role attributes operation -// typically these are obtained from a http.Request -// -// swagger:parameters listIdentityRoleAttributes -type ListIdentityRoleAttributesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListIdentityRoleAttributesParams() beforehand. -func (o *ListIdentityRoleAttributesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListIdentityRoleAttributesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListIdentityRoleAttributesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListIdentityRoleAttributesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_responses.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_responses.go deleted file mode 100644 index 06f66d7fe..000000000 --- a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListIdentityRoleAttributesOKCode is the HTTP code returned for type ListIdentityRoleAttributesOK -const ListIdentityRoleAttributesOKCode int = 200 - -/*ListIdentityRoleAttributesOK A list of role attributes - -swagger:response listIdentityRoleAttributesOK -*/ -type ListIdentityRoleAttributesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListRoleAttributesEnvelope `json:"body,omitempty"` -} - -// NewListIdentityRoleAttributesOK creates ListIdentityRoleAttributesOK with default headers values -func NewListIdentityRoleAttributesOK() *ListIdentityRoleAttributesOK { - - return &ListIdentityRoleAttributesOK{} -} - -// WithPayload adds the payload to the list identity role attributes o k response -func (o *ListIdentityRoleAttributesOK) WithPayload(payload *rest_model.ListRoleAttributesEnvelope) *ListIdentityRoleAttributesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity role attributes o k response -func (o *ListIdentityRoleAttributesOK) SetPayload(payload *rest_model.ListRoleAttributesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityRoleAttributesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityRoleAttributesBadRequestCode is the HTTP code returned for type ListIdentityRoleAttributesBadRequest -const ListIdentityRoleAttributesBadRequestCode int = 400 - -/*ListIdentityRoleAttributesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listIdentityRoleAttributesBadRequest -*/ -type ListIdentityRoleAttributesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityRoleAttributesBadRequest creates ListIdentityRoleAttributesBadRequest with default headers values -func NewListIdentityRoleAttributesBadRequest() *ListIdentityRoleAttributesBadRequest { - - return &ListIdentityRoleAttributesBadRequest{} -} - -// WithPayload adds the payload to the list identity role attributes bad request response -func (o *ListIdentityRoleAttributesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityRoleAttributesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity role attributes bad request response -func (o *ListIdentityRoleAttributesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityRoleAttributesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListIdentityRoleAttributesUnauthorizedCode is the HTTP code returned for type ListIdentityRoleAttributesUnauthorized -const ListIdentityRoleAttributesUnauthorizedCode int = 401 - -/*ListIdentityRoleAttributesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listIdentityRoleAttributesUnauthorized -*/ -type ListIdentityRoleAttributesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListIdentityRoleAttributesUnauthorized creates ListIdentityRoleAttributesUnauthorized with default headers values -func NewListIdentityRoleAttributesUnauthorized() *ListIdentityRoleAttributesUnauthorized { - - return &ListIdentityRoleAttributesUnauthorized{} -} - -// WithPayload adds the payload to the list identity role attributes unauthorized response -func (o *ListIdentityRoleAttributesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListIdentityRoleAttributesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list identity role attributes unauthorized response -func (o *ListIdentityRoleAttributesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListIdentityRoleAttributesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go b/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go deleted file mode 100644 index 85ec4a18a..000000000 --- a/rest_management_api_server/operations/role_attributes/list_identity_role_attributes_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListIdentityRoleAttributesURL generates an URL for the list identity role attributes operation -type ListIdentityRoleAttributesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityRoleAttributesURL) WithBasePath(bp string) *ListIdentityRoleAttributesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListIdentityRoleAttributesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListIdentityRoleAttributesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/identity-role-attributes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListIdentityRoleAttributesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListIdentityRoleAttributesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListIdentityRoleAttributesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListIdentityRoleAttributesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListIdentityRoleAttributesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListIdentityRoleAttributesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/role_attributes/list_service_role_attributes.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes.go deleted file mode 100644 index 83e42eb83..000000000 --- a/rest_management_api_server/operations/role_attributes/list_service_role_attributes.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceRoleAttributesHandlerFunc turns a function with the right signature into a list service role attributes handler -type ListServiceRoleAttributesHandlerFunc func(ListServiceRoleAttributesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceRoleAttributesHandlerFunc) Handle(params ListServiceRoleAttributesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceRoleAttributesHandler interface for that can handle valid list service role attributes params -type ListServiceRoleAttributesHandler interface { - Handle(ListServiceRoleAttributesParams, interface{}) middleware.Responder -} - -// NewListServiceRoleAttributes creates a new http.Handler for the list service role attributes operation -func NewListServiceRoleAttributes(ctx *middleware.Context, handler ListServiceRoleAttributesHandler) *ListServiceRoleAttributes { - return &ListServiceRoleAttributes{Context: ctx, Handler: handler} -} - -/* ListServiceRoleAttributes swagger:route GET /service-role-attributes Role Attributes listServiceRoleAttributes - -List role attributes in use by services - -Retrieves a list of role attributes in use by services; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceRoleAttributes struct { - Context *middleware.Context - Handler ListServiceRoleAttributesHandler -} - -func (o *ListServiceRoleAttributes) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceRoleAttributesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/role_attributes/list_service_role_attributes_parameters.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_parameters.go deleted file mode 100644 index 27245e008..000000000 --- a/rest_management_api_server/operations/role_attributes/list_service_role_attributes_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceRoleAttributesParams creates a new ListServiceRoleAttributesParams object -// -// There are no default values defined in the spec. -func NewListServiceRoleAttributesParams() ListServiceRoleAttributesParams { - - return ListServiceRoleAttributesParams{} -} - -// ListServiceRoleAttributesParams contains all the bound params for the list service role attributes operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceRoleAttributes -type ListServiceRoleAttributesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceRoleAttributesParams() beforehand. -func (o *ListServiceRoleAttributesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceRoleAttributesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceRoleAttributesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceRoleAttributesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/role_attributes/list_service_role_attributes_responses.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_responses.go deleted file mode 100644 index 8b782aae9..000000000 --- a/rest_management_api_server/operations/role_attributes/list_service_role_attributes_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceRoleAttributesOKCode is the HTTP code returned for type ListServiceRoleAttributesOK -const ListServiceRoleAttributesOKCode int = 200 - -/*ListServiceRoleAttributesOK A list of role attributes - -swagger:response listServiceRoleAttributesOK -*/ -type ListServiceRoleAttributesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListRoleAttributesEnvelope `json:"body,omitempty"` -} - -// NewListServiceRoleAttributesOK creates ListServiceRoleAttributesOK with default headers values -func NewListServiceRoleAttributesOK() *ListServiceRoleAttributesOK { - - return &ListServiceRoleAttributesOK{} -} - -// WithPayload adds the payload to the list service role attributes o k response -func (o *ListServiceRoleAttributesOK) WithPayload(payload *rest_model.ListRoleAttributesEnvelope) *ListServiceRoleAttributesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service role attributes o k response -func (o *ListServiceRoleAttributesOK) SetPayload(payload *rest_model.ListRoleAttributesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceRoleAttributesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceRoleAttributesBadRequestCode is the HTTP code returned for type ListServiceRoleAttributesBadRequest -const ListServiceRoleAttributesBadRequestCode int = 400 - -/*ListServiceRoleAttributesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceRoleAttributesBadRequest -*/ -type ListServiceRoleAttributesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceRoleAttributesBadRequest creates ListServiceRoleAttributesBadRequest with default headers values -func NewListServiceRoleAttributesBadRequest() *ListServiceRoleAttributesBadRequest { - - return &ListServiceRoleAttributesBadRequest{} -} - -// WithPayload adds the payload to the list service role attributes bad request response -func (o *ListServiceRoleAttributesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceRoleAttributesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service role attributes bad request response -func (o *ListServiceRoleAttributesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceRoleAttributesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceRoleAttributesUnauthorizedCode is the HTTP code returned for type ListServiceRoleAttributesUnauthorized -const ListServiceRoleAttributesUnauthorizedCode int = 401 - -/*ListServiceRoleAttributesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceRoleAttributesUnauthorized -*/ -type ListServiceRoleAttributesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceRoleAttributesUnauthorized creates ListServiceRoleAttributesUnauthorized with default headers values -func NewListServiceRoleAttributesUnauthorized() *ListServiceRoleAttributesUnauthorized { - - return &ListServiceRoleAttributesUnauthorized{} -} - -// WithPayload adds the payload to the list service role attributes unauthorized response -func (o *ListServiceRoleAttributesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceRoleAttributesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service role attributes unauthorized response -func (o *ListServiceRoleAttributesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceRoleAttributesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go b/rest_management_api_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go deleted file mode 100644 index 36aecb3d3..000000000 --- a/rest_management_api_server/operations/role_attributes/list_service_role_attributes_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package role_attributes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListServiceRoleAttributesURL generates an URL for the list service role attributes operation -type ListServiceRoleAttributesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceRoleAttributesURL) WithBasePath(bp string) *ListServiceRoleAttributesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceRoleAttributesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceRoleAttributesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-role-attributes" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceRoleAttributesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceRoleAttributesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceRoleAttributesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceRoleAttributesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceRoleAttributesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceRoleAttributesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/create_router.go b/rest_management_api_server/operations/router/create_router.go deleted file mode 100644 index afd417876..000000000 --- a/rest_management_api_server/operations/router/create_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateRouterHandlerFunc turns a function with the right signature into a create router handler -type CreateRouterHandlerFunc func(CreateRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateRouterHandlerFunc) Handle(params CreateRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateRouterHandler interface for that can handle valid create router params -type CreateRouterHandler interface { - Handle(CreateRouterParams, interface{}) middleware.Responder -} - -// NewCreateRouter creates a new http.Handler for the create router operation -func NewCreateRouter(ctx *middleware.Context, handler CreateRouterHandler) *CreateRouter { - return &CreateRouter{Context: ctx, Handler: handler} -} - -/* CreateRouter swagger:route POST /routers Router createRouter - -Create a router resource - -Create a router resource. Requires admin access. - -*/ -type CreateRouter struct { - Context *middleware.Context - Handler CreateRouterHandler -} - -func (o *CreateRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/create_router_parameters.go b/rest_management_api_server/operations/router/create_router_parameters.go deleted file mode 100644 index 9ffb78bef..000000000 --- a/rest_management_api_server/operations/router/create_router_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateRouterParams creates a new CreateRouterParams object -// -// There are no default values defined in the spec. -func NewCreateRouterParams() CreateRouterParams { - - return CreateRouterParams{} -} - -// CreateRouterParams contains all the bound params for the create router operation -// typically these are obtained from a http.Request -// -// swagger:parameters createRouter -type CreateRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A router to create - Required: true - In: body - */ - Router *rest_model.RouterCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateRouterParams() beforehand. -func (o *CreateRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("router", "body", "")) - } else { - res = append(res, errors.NewParseError("router", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Router = &body - } - } - } else { - res = append(res, errors.Required("router", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/router/create_router_responses.go b/rest_management_api_server/operations/router/create_router_responses.go deleted file mode 100644 index 85d714789..000000000 --- a/rest_management_api_server/operations/router/create_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateRouterCreatedCode is the HTTP code returned for type CreateRouterCreated -const CreateRouterCreatedCode int = 201 - -/*CreateRouterCreated The create request was successful and the resource has been added at the following location - -swagger:response createRouterCreated -*/ -type CreateRouterCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateRouterCreated creates CreateRouterCreated with default headers values -func NewCreateRouterCreated() *CreateRouterCreated { - - return &CreateRouterCreated{} -} - -// WithPayload adds the payload to the create router created response -func (o *CreateRouterCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateRouterCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create router created response -func (o *CreateRouterCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateRouterCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateRouterBadRequestCode is the HTTP code returned for type CreateRouterBadRequest -const CreateRouterBadRequestCode int = 400 - -/*CreateRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createRouterBadRequest -*/ -type CreateRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateRouterBadRequest creates CreateRouterBadRequest with default headers values -func NewCreateRouterBadRequest() *CreateRouterBadRequest { - - return &CreateRouterBadRequest{} -} - -// WithPayload adds the payload to the create router bad request response -func (o *CreateRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create router bad request response -func (o *CreateRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateRouterUnauthorizedCode is the HTTP code returned for type CreateRouterUnauthorized -const CreateRouterUnauthorizedCode int = 401 - -/*CreateRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createRouterUnauthorized -*/ -type CreateRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateRouterUnauthorized creates CreateRouterUnauthorized with default headers values -func NewCreateRouterUnauthorized() *CreateRouterUnauthorized { - - return &CreateRouterUnauthorized{} -} - -// WithPayload adds the payload to the create router unauthorized response -func (o *CreateRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create router unauthorized response -func (o *CreateRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/create_router_urlbuilder.go b/rest_management_api_server/operations/router/create_router_urlbuilder.go deleted file mode 100644 index afbc4a334..000000000 --- a/rest_management_api_server/operations/router/create_router_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateRouterURL generates an URL for the create router operation -type CreateRouterURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateRouterURL) WithBasePath(bp string) *CreateRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/create_transit_router.go b/rest_management_api_server/operations/router/create_transit_router.go deleted file mode 100644 index cf3b9ae69..000000000 --- a/rest_management_api_server/operations/router/create_transit_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateTransitRouterHandlerFunc turns a function with the right signature into a create transit router handler -type CreateTransitRouterHandlerFunc func(CreateTransitRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateTransitRouterHandlerFunc) Handle(params CreateTransitRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateTransitRouterHandler interface for that can handle valid create transit router params -type CreateTransitRouterHandler interface { - Handle(CreateTransitRouterParams, interface{}) middleware.Responder -} - -// NewCreateTransitRouter creates a new http.Handler for the create transit router operation -func NewCreateTransitRouter(ctx *middleware.Context, handler CreateTransitRouterHandler) *CreateTransitRouter { - return &CreateTransitRouter{Context: ctx, Handler: handler} -} - -/* CreateTransitRouter swagger:route POST /transit-routers Router createTransitRouter - -Create a router resource - -Create a router resource. Requires admin access. - -*/ -type CreateTransitRouter struct { - Context *middleware.Context - Handler CreateTransitRouterHandler -} - -func (o *CreateTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateTransitRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/create_transit_router_parameters.go b/rest_management_api_server/operations/router/create_transit_router_parameters.go deleted file mode 100644 index 1797a9210..000000000 --- a/rest_management_api_server/operations/router/create_transit_router_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateTransitRouterParams creates a new CreateTransitRouterParams object -// -// There are no default values defined in the spec. -func NewCreateTransitRouterParams() CreateTransitRouterParams { - - return CreateTransitRouterParams{} -} - -// CreateTransitRouterParams contains all the bound params for the create transit router operation -// typically these are obtained from a http.Request -// -// swagger:parameters createTransitRouter -type CreateTransitRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A router to create - Required: true - In: body - */ - Router *rest_model.RouterCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateTransitRouterParams() beforehand. -func (o *CreateTransitRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("router", "body", "")) - } else { - res = append(res, errors.NewParseError("router", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Router = &body - } - } - } else { - res = append(res, errors.Required("router", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/router/create_transit_router_responses.go b/rest_management_api_server/operations/router/create_transit_router_responses.go deleted file mode 100644 index b0ddc297a..000000000 --- a/rest_management_api_server/operations/router/create_transit_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateTransitRouterCreatedCode is the HTTP code returned for type CreateTransitRouterCreated -const CreateTransitRouterCreatedCode int = 201 - -/*CreateTransitRouterCreated The create request was successful and the resource has been added at the following location - -swagger:response createTransitRouterCreated -*/ -type CreateTransitRouterCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateTransitRouterCreated creates CreateTransitRouterCreated with default headers values -func NewCreateTransitRouterCreated() *CreateTransitRouterCreated { - - return &CreateTransitRouterCreated{} -} - -// WithPayload adds the payload to the create transit router created response -func (o *CreateTransitRouterCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateTransitRouterCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create transit router created response -func (o *CreateTransitRouterCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateTransitRouterCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateTransitRouterBadRequestCode is the HTTP code returned for type CreateTransitRouterBadRequest -const CreateTransitRouterBadRequestCode int = 400 - -/*CreateTransitRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createTransitRouterBadRequest -*/ -type CreateTransitRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateTransitRouterBadRequest creates CreateTransitRouterBadRequest with default headers values -func NewCreateTransitRouterBadRequest() *CreateTransitRouterBadRequest { - - return &CreateTransitRouterBadRequest{} -} - -// WithPayload adds the payload to the create transit router bad request response -func (o *CreateTransitRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateTransitRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create transit router bad request response -func (o *CreateTransitRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateTransitRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateTransitRouterUnauthorizedCode is the HTTP code returned for type CreateTransitRouterUnauthorized -const CreateTransitRouterUnauthorizedCode int = 401 - -/*CreateTransitRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createTransitRouterUnauthorized -*/ -type CreateTransitRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateTransitRouterUnauthorized creates CreateTransitRouterUnauthorized with default headers values -func NewCreateTransitRouterUnauthorized() *CreateTransitRouterUnauthorized { - - return &CreateTransitRouterUnauthorized{} -} - -// WithPayload adds the payload to the create transit router unauthorized response -func (o *CreateTransitRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateTransitRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create transit router unauthorized response -func (o *CreateTransitRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateTransitRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/create_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/create_transit_router_urlbuilder.go deleted file mode 100644 index 42061ee9d..000000000 --- a/rest_management_api_server/operations/router/create_transit_router_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateTransitRouterURL generates an URL for the create transit router operation -type CreateTransitRouterURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateTransitRouterURL) WithBasePath(bp string) *CreateTransitRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateTransitRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateTransitRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transit-routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateTransitRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateTransitRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateTransitRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateTransitRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateTransitRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateTransitRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/delete_router.go b/rest_management_api_server/operations/router/delete_router.go deleted file mode 100644 index 2b027c7ab..000000000 --- a/rest_management_api_server/operations/router/delete_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteRouterHandlerFunc turns a function with the right signature into a delete router handler -type DeleteRouterHandlerFunc func(DeleteRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteRouterHandlerFunc) Handle(params DeleteRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteRouterHandler interface for that can handle valid delete router params -type DeleteRouterHandler interface { - Handle(DeleteRouterParams, interface{}) middleware.Responder -} - -// NewDeleteRouter creates a new http.Handler for the delete router operation -func NewDeleteRouter(ctx *middleware.Context, handler DeleteRouterHandler) *DeleteRouter { - return &DeleteRouter{Context: ctx, Handler: handler} -} - -/* DeleteRouter swagger:route DELETE /routers/{id} Router deleteRouter - -Delete a router - -Delete a router by id. Requires admin access. - -*/ -type DeleteRouter struct { - Context *middleware.Context - Handler DeleteRouterHandler -} - -func (o *DeleteRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/delete_router_parameters.go b/rest_management_api_server/operations/router/delete_router_parameters.go deleted file mode 100644 index 911d79ec4..000000000 --- a/rest_management_api_server/operations/router/delete_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteRouterParams creates a new DeleteRouterParams object -// -// There are no default values defined in the spec. -func NewDeleteRouterParams() DeleteRouterParams { - - return DeleteRouterParams{} -} - -// DeleteRouterParams contains all the bound params for the delete router operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteRouter -type DeleteRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteRouterParams() beforehand. -func (o *DeleteRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/delete_router_responses.go b/rest_management_api_server/operations/router/delete_router_responses.go deleted file mode 100644 index 252255ae4..000000000 --- a/rest_management_api_server/operations/router/delete_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteRouterOKCode is the HTTP code returned for type DeleteRouterOK -const DeleteRouterOKCode int = 200 - -/*DeleteRouterOK The delete request was successful and the resource has been removed - -swagger:response deleteRouterOK -*/ -type DeleteRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteRouterOK creates DeleteRouterOK with default headers values -func NewDeleteRouterOK() *DeleteRouterOK { - - return &DeleteRouterOK{} -} - -// WithPayload adds the payload to the delete router o k response -func (o *DeleteRouterOK) WithPayload(payload *rest_model.Empty) *DeleteRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete router o k response -func (o *DeleteRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteRouterBadRequestCode is the HTTP code returned for type DeleteRouterBadRequest -const DeleteRouterBadRequestCode int = 400 - -/*DeleteRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteRouterBadRequest -*/ -type DeleteRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteRouterBadRequest creates DeleteRouterBadRequest with default headers values -func NewDeleteRouterBadRequest() *DeleteRouterBadRequest { - - return &DeleteRouterBadRequest{} -} - -// WithPayload adds the payload to the delete router bad request response -func (o *DeleteRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete router bad request response -func (o *DeleteRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteRouterUnauthorizedCode is the HTTP code returned for type DeleteRouterUnauthorized -const DeleteRouterUnauthorizedCode int = 401 - -/*DeleteRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteRouterUnauthorized -*/ -type DeleteRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteRouterUnauthorized creates DeleteRouterUnauthorized with default headers values -func NewDeleteRouterUnauthorized() *DeleteRouterUnauthorized { - - return &DeleteRouterUnauthorized{} -} - -// WithPayload adds the payload to the delete router unauthorized response -func (o *DeleteRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete router unauthorized response -func (o *DeleteRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteRouterConflictCode is the HTTP code returned for type DeleteRouterConflict -const DeleteRouterConflictCode int = 409 - -/*DeleteRouterConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteRouterConflict -*/ -type DeleteRouterConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteRouterConflict creates DeleteRouterConflict with default headers values -func NewDeleteRouterConflict() *DeleteRouterConflict { - - return &DeleteRouterConflict{} -} - -// WithPayload adds the payload to the delete router conflict response -func (o *DeleteRouterConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteRouterConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete router conflict response -func (o *DeleteRouterConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteRouterConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/delete_router_urlbuilder.go b/rest_management_api_server/operations/router/delete_router_urlbuilder.go deleted file mode 100644 index 3218bbc0b..000000000 --- a/rest_management_api_server/operations/router/delete_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteRouterURL generates an URL for the delete router operation -type DeleteRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteRouterURL) WithBasePath(bp string) *DeleteRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/delete_transit_router.go b/rest_management_api_server/operations/router/delete_transit_router.go deleted file mode 100644 index dc979f1ed..000000000 --- a/rest_management_api_server/operations/router/delete_transit_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteTransitRouterHandlerFunc turns a function with the right signature into a delete transit router handler -type DeleteTransitRouterHandlerFunc func(DeleteTransitRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteTransitRouterHandlerFunc) Handle(params DeleteTransitRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteTransitRouterHandler interface for that can handle valid delete transit router params -type DeleteTransitRouterHandler interface { - Handle(DeleteTransitRouterParams, interface{}) middleware.Responder -} - -// NewDeleteTransitRouter creates a new http.Handler for the delete transit router operation -func NewDeleteTransitRouter(ctx *middleware.Context, handler DeleteTransitRouterHandler) *DeleteTransitRouter { - return &DeleteTransitRouter{Context: ctx, Handler: handler} -} - -/* DeleteTransitRouter swagger:route DELETE /transit-routers/{id} Router deleteTransitRouter - -Delete a router - -Delete a router by id. Requires admin access. - -*/ -type DeleteTransitRouter struct { - Context *middleware.Context - Handler DeleteTransitRouterHandler -} - -func (o *DeleteTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteTransitRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/delete_transit_router_parameters.go b/rest_management_api_server/operations/router/delete_transit_router_parameters.go deleted file mode 100644 index 1feded265..000000000 --- a/rest_management_api_server/operations/router/delete_transit_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteTransitRouterParams creates a new DeleteTransitRouterParams object -// -// There are no default values defined in the spec. -func NewDeleteTransitRouterParams() DeleteTransitRouterParams { - - return DeleteTransitRouterParams{} -} - -// DeleteTransitRouterParams contains all the bound params for the delete transit router operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteTransitRouter -type DeleteTransitRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteTransitRouterParams() beforehand. -func (o *DeleteTransitRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteTransitRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/delete_transit_router_responses.go b/rest_management_api_server/operations/router/delete_transit_router_responses.go deleted file mode 100644 index 58e007363..000000000 --- a/rest_management_api_server/operations/router/delete_transit_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteTransitRouterOKCode is the HTTP code returned for type DeleteTransitRouterOK -const DeleteTransitRouterOKCode int = 200 - -/*DeleteTransitRouterOK The delete request was successful and the resource has been removed - -swagger:response deleteTransitRouterOK -*/ -type DeleteTransitRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteTransitRouterOK creates DeleteTransitRouterOK with default headers values -func NewDeleteTransitRouterOK() *DeleteTransitRouterOK { - - return &DeleteTransitRouterOK{} -} - -// WithPayload adds the payload to the delete transit router o k response -func (o *DeleteTransitRouterOK) WithPayload(payload *rest_model.Empty) *DeleteTransitRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete transit router o k response -func (o *DeleteTransitRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTransitRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteTransitRouterBadRequestCode is the HTTP code returned for type DeleteTransitRouterBadRequest -const DeleteTransitRouterBadRequestCode int = 400 - -/*DeleteTransitRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteTransitRouterBadRequest -*/ -type DeleteTransitRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteTransitRouterBadRequest creates DeleteTransitRouterBadRequest with default headers values -func NewDeleteTransitRouterBadRequest() *DeleteTransitRouterBadRequest { - - return &DeleteTransitRouterBadRequest{} -} - -// WithPayload adds the payload to the delete transit router bad request response -func (o *DeleteTransitRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteTransitRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete transit router bad request response -func (o *DeleteTransitRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTransitRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteTransitRouterUnauthorizedCode is the HTTP code returned for type DeleteTransitRouterUnauthorized -const DeleteTransitRouterUnauthorizedCode int = 401 - -/*DeleteTransitRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteTransitRouterUnauthorized -*/ -type DeleteTransitRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteTransitRouterUnauthorized creates DeleteTransitRouterUnauthorized with default headers values -func NewDeleteTransitRouterUnauthorized() *DeleteTransitRouterUnauthorized { - - return &DeleteTransitRouterUnauthorized{} -} - -// WithPayload adds the payload to the delete transit router unauthorized response -func (o *DeleteTransitRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteTransitRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete transit router unauthorized response -func (o *DeleteTransitRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTransitRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteTransitRouterConflictCode is the HTTP code returned for type DeleteTransitRouterConflict -const DeleteTransitRouterConflictCode int = 409 - -/*DeleteTransitRouterConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteTransitRouterConflict -*/ -type DeleteTransitRouterConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteTransitRouterConflict creates DeleteTransitRouterConflict with default headers values -func NewDeleteTransitRouterConflict() *DeleteTransitRouterConflict { - - return &DeleteTransitRouterConflict{} -} - -// WithPayload adds the payload to the delete transit router conflict response -func (o *DeleteTransitRouterConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteTransitRouterConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete transit router conflict response -func (o *DeleteTransitRouterConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTransitRouterConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/delete_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/delete_transit_router_urlbuilder.go deleted file mode 100644 index 1a30bff16..000000000 --- a/rest_management_api_server/operations/router/delete_transit_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteTransitRouterURL generates an URL for the delete transit router operation -type DeleteTransitRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteTransitRouterURL) WithBasePath(bp string) *DeleteTransitRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteTransitRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteTransitRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transit-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteTransitRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteTransitRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteTransitRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteTransitRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteTransitRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteTransitRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteTransitRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/detail_router.go b/rest_management_api_server/operations/router/detail_router.go deleted file mode 100644 index c62f1cd2b..000000000 --- a/rest_management_api_server/operations/router/detail_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailRouterHandlerFunc turns a function with the right signature into a detail router handler -type DetailRouterHandlerFunc func(DetailRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailRouterHandlerFunc) Handle(params DetailRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailRouterHandler interface for that can handle valid detail router params -type DetailRouterHandler interface { - Handle(DetailRouterParams, interface{}) middleware.Responder -} - -// NewDetailRouter creates a new http.Handler for the detail router operation -func NewDetailRouter(ctx *middleware.Context, handler DetailRouterHandler) *DetailRouter { - return &DetailRouter{Context: ctx, Handler: handler} -} - -/* DetailRouter swagger:route GET /routers/{id} Router detailRouter - -Retrieves a single router - -Retrieves a single router by id. Requires admin access. - -*/ -type DetailRouter struct { - Context *middleware.Context - Handler DetailRouterHandler -} - -func (o *DetailRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/detail_router_parameters.go b/rest_management_api_server/operations/router/detail_router_parameters.go deleted file mode 100644 index de34790c1..000000000 --- a/rest_management_api_server/operations/router/detail_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailRouterParams creates a new DetailRouterParams object -// -// There are no default values defined in the spec. -func NewDetailRouterParams() DetailRouterParams { - - return DetailRouterParams{} -} - -// DetailRouterParams contains all the bound params for the detail router operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailRouter -type DetailRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailRouterParams() beforehand. -func (o *DetailRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/detail_router_responses.go b/rest_management_api_server/operations/router/detail_router_responses.go deleted file mode 100644 index 771346cb9..000000000 --- a/rest_management_api_server/operations/router/detail_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailRouterOKCode is the HTTP code returned for type DetailRouterOK -const DetailRouterOKCode int = 200 - -/*DetailRouterOK A single router - -swagger:response detailRouterOK -*/ -type DetailRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailRouterEnvelope `json:"body,omitempty"` -} - -// NewDetailRouterOK creates DetailRouterOK with default headers values -func NewDetailRouterOK() *DetailRouterOK { - - return &DetailRouterOK{} -} - -// WithPayload adds the payload to the detail router o k response -func (o *DetailRouterOK) WithPayload(payload *rest_model.DetailRouterEnvelope) *DetailRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail router o k response -func (o *DetailRouterOK) SetPayload(payload *rest_model.DetailRouterEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailRouterUnauthorizedCode is the HTTP code returned for type DetailRouterUnauthorized -const DetailRouterUnauthorizedCode int = 401 - -/*DetailRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailRouterUnauthorized -*/ -type DetailRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailRouterUnauthorized creates DetailRouterUnauthorized with default headers values -func NewDetailRouterUnauthorized() *DetailRouterUnauthorized { - - return &DetailRouterUnauthorized{} -} - -// WithPayload adds the payload to the detail router unauthorized response -func (o *DetailRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail router unauthorized response -func (o *DetailRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailRouterNotFoundCode is the HTTP code returned for type DetailRouterNotFound -const DetailRouterNotFoundCode int = 404 - -/*DetailRouterNotFound The requested resource does not exist - -swagger:response detailRouterNotFound -*/ -type DetailRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailRouterNotFound creates DetailRouterNotFound with default headers values -func NewDetailRouterNotFound() *DetailRouterNotFound { - - return &DetailRouterNotFound{} -} - -// WithPayload adds the payload to the detail router not found response -func (o *DetailRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail router not found response -func (o *DetailRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/detail_router_urlbuilder.go b/rest_management_api_server/operations/router/detail_router_urlbuilder.go deleted file mode 100644 index 087eb7074..000000000 --- a/rest_management_api_server/operations/router/detail_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailRouterURL generates an URL for the detail router operation -type DetailRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailRouterURL) WithBasePath(bp string) *DetailRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/detail_transit_router.go b/rest_management_api_server/operations/router/detail_transit_router.go deleted file mode 100644 index 281c43371..000000000 --- a/rest_management_api_server/operations/router/detail_transit_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailTransitRouterHandlerFunc turns a function with the right signature into a detail transit router handler -type DetailTransitRouterHandlerFunc func(DetailTransitRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailTransitRouterHandlerFunc) Handle(params DetailTransitRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailTransitRouterHandler interface for that can handle valid detail transit router params -type DetailTransitRouterHandler interface { - Handle(DetailTransitRouterParams, interface{}) middleware.Responder -} - -// NewDetailTransitRouter creates a new http.Handler for the detail transit router operation -func NewDetailTransitRouter(ctx *middleware.Context, handler DetailTransitRouterHandler) *DetailTransitRouter { - return &DetailTransitRouter{Context: ctx, Handler: handler} -} - -/* DetailTransitRouter swagger:route GET /transit-routers/{id} Router detailTransitRouter - -Retrieves a single router - -Retrieves a single router by id. Requires admin access. - -*/ -type DetailTransitRouter struct { - Context *middleware.Context - Handler DetailTransitRouterHandler -} - -func (o *DetailTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailTransitRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/detail_transit_router_parameters.go b/rest_management_api_server/operations/router/detail_transit_router_parameters.go deleted file mode 100644 index 49041c01c..000000000 --- a/rest_management_api_server/operations/router/detail_transit_router_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailTransitRouterParams creates a new DetailTransitRouterParams object -// -// There are no default values defined in the spec. -func NewDetailTransitRouterParams() DetailTransitRouterParams { - - return DetailTransitRouterParams{} -} - -// DetailTransitRouterParams contains all the bound params for the detail transit router operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailTransitRouter -type DetailTransitRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailTransitRouterParams() beforehand. -func (o *DetailTransitRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailTransitRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/detail_transit_router_responses.go b/rest_management_api_server/operations/router/detail_transit_router_responses.go deleted file mode 100644 index 43651665e..000000000 --- a/rest_management_api_server/operations/router/detail_transit_router_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailTransitRouterOKCode is the HTTP code returned for type DetailTransitRouterOK -const DetailTransitRouterOKCode int = 200 - -/*DetailTransitRouterOK A single router - -swagger:response detailTransitRouterOK -*/ -type DetailTransitRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailRouterEnvelope `json:"body,omitempty"` -} - -// NewDetailTransitRouterOK creates DetailTransitRouterOK with default headers values -func NewDetailTransitRouterOK() *DetailTransitRouterOK { - - return &DetailTransitRouterOK{} -} - -// WithPayload adds the payload to the detail transit router o k response -func (o *DetailTransitRouterOK) WithPayload(payload *rest_model.DetailRouterEnvelope) *DetailTransitRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail transit router o k response -func (o *DetailTransitRouterOK) SetPayload(payload *rest_model.DetailRouterEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailTransitRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailTransitRouterUnauthorizedCode is the HTTP code returned for type DetailTransitRouterUnauthorized -const DetailTransitRouterUnauthorizedCode int = 401 - -/*DetailTransitRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailTransitRouterUnauthorized -*/ -type DetailTransitRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailTransitRouterUnauthorized creates DetailTransitRouterUnauthorized with default headers values -func NewDetailTransitRouterUnauthorized() *DetailTransitRouterUnauthorized { - - return &DetailTransitRouterUnauthorized{} -} - -// WithPayload adds the payload to the detail transit router unauthorized response -func (o *DetailTransitRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailTransitRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail transit router unauthorized response -func (o *DetailTransitRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailTransitRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailTransitRouterNotFoundCode is the HTTP code returned for type DetailTransitRouterNotFound -const DetailTransitRouterNotFoundCode int = 404 - -/*DetailTransitRouterNotFound The requested resource does not exist - -swagger:response detailTransitRouterNotFound -*/ -type DetailTransitRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailTransitRouterNotFound creates DetailTransitRouterNotFound with default headers values -func NewDetailTransitRouterNotFound() *DetailTransitRouterNotFound { - - return &DetailTransitRouterNotFound{} -} - -// WithPayload adds the payload to the detail transit router not found response -func (o *DetailTransitRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailTransitRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail transit router not found response -func (o *DetailTransitRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailTransitRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/detail_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/detail_transit_router_urlbuilder.go deleted file mode 100644 index 8e4206f58..000000000 --- a/rest_management_api_server/operations/router/detail_transit_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailTransitRouterURL generates an URL for the detail transit router operation -type DetailTransitRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailTransitRouterURL) WithBasePath(bp string) *DetailTransitRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailTransitRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailTransitRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transit-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailTransitRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailTransitRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailTransitRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailTransitRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailTransitRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailTransitRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailTransitRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/list_routers.go b/rest_management_api_server/operations/router/list_routers.go deleted file mode 100644 index 91be864af..000000000 --- a/rest_management_api_server/operations/router/list_routers.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListRoutersHandlerFunc turns a function with the right signature into a list routers handler -type ListRoutersHandlerFunc func(ListRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListRoutersHandlerFunc) Handle(params ListRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListRoutersHandler interface for that can handle valid list routers params -type ListRoutersHandler interface { - Handle(ListRoutersParams, interface{}) middleware.Responder -} - -// NewListRouters creates a new http.Handler for the list routers operation -func NewListRouters(ctx *middleware.Context, handler ListRoutersHandler) *ListRouters { - return &ListRouters{Context: ctx, Handler: handler} -} - -/* ListRouters swagger:route GET /routers Router listRouters - -List routers - -Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListRouters struct { - Context *middleware.Context - Handler ListRoutersHandler -} - -func (o *ListRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/list_routers_parameters.go b/rest_management_api_server/operations/router/list_routers_parameters.go deleted file mode 100644 index 3af933b74..000000000 --- a/rest_management_api_server/operations/router/list_routers_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListRoutersParams creates a new ListRoutersParams object -// -// There are no default values defined in the spec. -func NewListRoutersParams() ListRoutersParams { - - return ListRoutersParams{} -} - -// ListRoutersParams contains all the bound params for the list routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listRouters -type ListRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListRoutersParams() beforehand. -func (o *ListRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListRoutersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListRoutersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListRoutersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/router/list_routers_responses.go b/rest_management_api_server/operations/router/list_routers_responses.go deleted file mode 100644 index 395c773bc..000000000 --- a/rest_management_api_server/operations/router/list_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListRoutersOKCode is the HTTP code returned for type ListRoutersOK -const ListRoutersOKCode int = 200 - -/*ListRoutersOK A list of specifications - -swagger:response listRoutersOK -*/ -type ListRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListRoutersEnvelope `json:"body,omitempty"` -} - -// NewListRoutersOK creates ListRoutersOK with default headers values -func NewListRoutersOK() *ListRoutersOK { - - return &ListRoutersOK{} -} - -// WithPayload adds the payload to the list routers o k response -func (o *ListRoutersOK) WithPayload(payload *rest_model.ListRoutersEnvelope) *ListRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list routers o k response -func (o *ListRoutersOK) SetPayload(payload *rest_model.ListRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListRoutersBadRequestCode is the HTTP code returned for type ListRoutersBadRequest -const ListRoutersBadRequestCode int = 400 - -/*ListRoutersBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listRoutersBadRequest -*/ -type ListRoutersBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListRoutersBadRequest creates ListRoutersBadRequest with default headers values -func NewListRoutersBadRequest() *ListRoutersBadRequest { - - return &ListRoutersBadRequest{} -} - -// WithPayload adds the payload to the list routers bad request response -func (o *ListRoutersBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListRoutersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list routers bad request response -func (o *ListRoutersBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListRoutersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListRoutersUnauthorizedCode is the HTTP code returned for type ListRoutersUnauthorized -const ListRoutersUnauthorizedCode int = 401 - -/*ListRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listRoutersUnauthorized -*/ -type ListRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListRoutersUnauthorized creates ListRoutersUnauthorized with default headers values -func NewListRoutersUnauthorized() *ListRoutersUnauthorized { - - return &ListRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list routers unauthorized response -func (o *ListRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list routers unauthorized response -func (o *ListRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/list_routers_urlbuilder.go b/rest_management_api_server/operations/router/list_routers_urlbuilder.go deleted file mode 100644 index c82a3737f..000000000 --- a/rest_management_api_server/operations/router/list_routers_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListRoutersURL generates an URL for the list routers operation -type ListRoutersURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListRoutersURL) WithBasePath(bp string) *ListRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/list_transit_routers.go b/rest_management_api_server/operations/router/list_transit_routers.go deleted file mode 100644 index 98018cabb..000000000 --- a/rest_management_api_server/operations/router/list_transit_routers.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListTransitRoutersHandlerFunc turns a function with the right signature into a list transit routers handler -type ListTransitRoutersHandlerFunc func(ListTransitRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListTransitRoutersHandlerFunc) Handle(params ListTransitRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListTransitRoutersHandler interface for that can handle valid list transit routers params -type ListTransitRoutersHandler interface { - Handle(ListTransitRoutersParams, interface{}) middleware.Responder -} - -// NewListTransitRouters creates a new http.Handler for the list transit routers operation -func NewListTransitRouters(ctx *middleware.Context, handler ListTransitRoutersHandler) *ListTransitRouters { - return &ListTransitRouters{Context: ctx, Handler: handler} -} - -/* ListTransitRouters swagger:route GET /transit-routers Router listTransitRouters - -List routers - -Retrieves a list of router resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListTransitRouters struct { - Context *middleware.Context - Handler ListTransitRoutersHandler -} - -func (o *ListTransitRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListTransitRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/list_transit_routers_parameters.go b/rest_management_api_server/operations/router/list_transit_routers_parameters.go deleted file mode 100644 index 61b714434..000000000 --- a/rest_management_api_server/operations/router/list_transit_routers_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListTransitRoutersParams creates a new ListTransitRoutersParams object -// -// There are no default values defined in the spec. -func NewListTransitRoutersParams() ListTransitRoutersParams { - - return ListTransitRoutersParams{} -} - -// ListTransitRoutersParams contains all the bound params for the list transit routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listTransitRouters -type ListTransitRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListTransitRoutersParams() beforehand. -func (o *ListTransitRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListTransitRoutersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListTransitRoutersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListTransitRoutersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/router/list_transit_routers_responses.go b/rest_management_api_server/operations/router/list_transit_routers_responses.go deleted file mode 100644 index 34f3f12b7..000000000 --- a/rest_management_api_server/operations/router/list_transit_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListTransitRoutersOKCode is the HTTP code returned for type ListTransitRoutersOK -const ListTransitRoutersOKCode int = 200 - -/*ListTransitRoutersOK A list of specifications - -swagger:response listTransitRoutersOK -*/ -type ListTransitRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListRoutersEnvelope `json:"body,omitempty"` -} - -// NewListTransitRoutersOK creates ListTransitRoutersOK with default headers values -func NewListTransitRoutersOK() *ListTransitRoutersOK { - - return &ListTransitRoutersOK{} -} - -// WithPayload adds the payload to the list transit routers o k response -func (o *ListTransitRoutersOK) WithPayload(payload *rest_model.ListRoutersEnvelope) *ListTransitRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list transit routers o k response -func (o *ListTransitRoutersOK) SetPayload(payload *rest_model.ListRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListTransitRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListTransitRoutersBadRequestCode is the HTTP code returned for type ListTransitRoutersBadRequest -const ListTransitRoutersBadRequestCode int = 400 - -/*ListTransitRoutersBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listTransitRoutersBadRequest -*/ -type ListTransitRoutersBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListTransitRoutersBadRequest creates ListTransitRoutersBadRequest with default headers values -func NewListTransitRoutersBadRequest() *ListTransitRoutersBadRequest { - - return &ListTransitRoutersBadRequest{} -} - -// WithPayload adds the payload to the list transit routers bad request response -func (o *ListTransitRoutersBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListTransitRoutersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list transit routers bad request response -func (o *ListTransitRoutersBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListTransitRoutersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListTransitRoutersUnauthorizedCode is the HTTP code returned for type ListTransitRoutersUnauthorized -const ListTransitRoutersUnauthorizedCode int = 401 - -/*ListTransitRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listTransitRoutersUnauthorized -*/ -type ListTransitRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListTransitRoutersUnauthorized creates ListTransitRoutersUnauthorized with default headers values -func NewListTransitRoutersUnauthorized() *ListTransitRoutersUnauthorized { - - return &ListTransitRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list transit routers unauthorized response -func (o *ListTransitRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListTransitRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list transit routers unauthorized response -func (o *ListTransitRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListTransitRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/list_transit_routers_urlbuilder.go b/rest_management_api_server/operations/router/list_transit_routers_urlbuilder.go deleted file mode 100644 index 78307e4ac..000000000 --- a/rest_management_api_server/operations/router/list_transit_routers_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListTransitRoutersURL generates an URL for the list transit routers operation -type ListTransitRoutersURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListTransitRoutersURL) WithBasePath(bp string) *ListTransitRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListTransitRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListTransitRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transit-routers" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListTransitRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListTransitRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListTransitRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListTransitRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListTransitRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListTransitRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/patch_router.go b/rest_management_api_server/operations/router/patch_router.go deleted file mode 100644 index a16067d2b..000000000 --- a/rest_management_api_server/operations/router/patch_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchRouterHandlerFunc turns a function with the right signature into a patch router handler -type PatchRouterHandlerFunc func(PatchRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchRouterHandlerFunc) Handle(params PatchRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchRouterHandler interface for that can handle valid patch router params -type PatchRouterHandler interface { - Handle(PatchRouterParams, interface{}) middleware.Responder -} - -// NewPatchRouter creates a new http.Handler for the patch router operation -func NewPatchRouter(ctx *middleware.Context, handler PatchRouterHandler) *PatchRouter { - return &PatchRouter{Context: ctx, Handler: handler} -} - -/* PatchRouter swagger:route PATCH /routers/{id} Router patchRouter - -Update the supplied fields on a router - -Update the supplied fields on a router. Requires admin access. - -*/ -type PatchRouter struct { - Context *middleware.Context - Handler PatchRouterHandler -} - -func (o *PatchRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/patch_router_parameters.go b/rest_management_api_server/operations/router/patch_router_parameters.go deleted file mode 100644 index a18e66e07..000000000 --- a/rest_management_api_server/operations/router/patch_router_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchRouterParams creates a new PatchRouterParams object -// -// There are no default values defined in the spec. -func NewPatchRouterParams() PatchRouterParams { - - return PatchRouterParams{} -} - -// PatchRouterParams contains all the bound params for the patch router operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchRouter -type PatchRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A router patch object - Required: true - In: body - */ - Router *rest_model.RouterPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchRouterParams() beforehand. -func (o *PatchRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("router", "body", "")) - } else { - res = append(res, errors.NewParseError("router", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Router = &body - } - } - } else { - res = append(res, errors.Required("router", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/patch_router_responses.go b/rest_management_api_server/operations/router/patch_router_responses.go deleted file mode 100644 index dd3084790..000000000 --- a/rest_management_api_server/operations/router/patch_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchRouterOKCode is the HTTP code returned for type PatchRouterOK -const PatchRouterOKCode int = 200 - -/*PatchRouterOK The patch request was successful and the resource has been altered - -swagger:response patchRouterOK -*/ -type PatchRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchRouterOK creates PatchRouterOK with default headers values -func NewPatchRouterOK() *PatchRouterOK { - - return &PatchRouterOK{} -} - -// WithPayload adds the payload to the patch router o k response -func (o *PatchRouterOK) WithPayload(payload *rest_model.Empty) *PatchRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch router o k response -func (o *PatchRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchRouterBadRequestCode is the HTTP code returned for type PatchRouterBadRequest -const PatchRouterBadRequestCode int = 400 - -/*PatchRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchRouterBadRequest -*/ -type PatchRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchRouterBadRequest creates PatchRouterBadRequest with default headers values -func NewPatchRouterBadRequest() *PatchRouterBadRequest { - - return &PatchRouterBadRequest{} -} - -// WithPayload adds the payload to the patch router bad request response -func (o *PatchRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch router bad request response -func (o *PatchRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchRouterUnauthorizedCode is the HTTP code returned for type PatchRouterUnauthorized -const PatchRouterUnauthorizedCode int = 401 - -/*PatchRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchRouterUnauthorized -*/ -type PatchRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchRouterUnauthorized creates PatchRouterUnauthorized with default headers values -func NewPatchRouterUnauthorized() *PatchRouterUnauthorized { - - return &PatchRouterUnauthorized{} -} - -// WithPayload adds the payload to the patch router unauthorized response -func (o *PatchRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch router unauthorized response -func (o *PatchRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchRouterNotFoundCode is the HTTP code returned for type PatchRouterNotFound -const PatchRouterNotFoundCode int = 404 - -/*PatchRouterNotFound The requested resource does not exist - -swagger:response patchRouterNotFound -*/ -type PatchRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchRouterNotFound creates PatchRouterNotFound with default headers values -func NewPatchRouterNotFound() *PatchRouterNotFound { - - return &PatchRouterNotFound{} -} - -// WithPayload adds the payload to the patch router not found response -func (o *PatchRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch router not found response -func (o *PatchRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/patch_router_urlbuilder.go b/rest_management_api_server/operations/router/patch_router_urlbuilder.go deleted file mode 100644 index fd71c6e86..000000000 --- a/rest_management_api_server/operations/router/patch_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchRouterURL generates an URL for the patch router operation -type PatchRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchRouterURL) WithBasePath(bp string) *PatchRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/patch_transit_router.go b/rest_management_api_server/operations/router/patch_transit_router.go deleted file mode 100644 index 247ce65fe..000000000 --- a/rest_management_api_server/operations/router/patch_transit_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchTransitRouterHandlerFunc turns a function with the right signature into a patch transit router handler -type PatchTransitRouterHandlerFunc func(PatchTransitRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchTransitRouterHandlerFunc) Handle(params PatchTransitRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchTransitRouterHandler interface for that can handle valid patch transit router params -type PatchTransitRouterHandler interface { - Handle(PatchTransitRouterParams, interface{}) middleware.Responder -} - -// NewPatchTransitRouter creates a new http.Handler for the patch transit router operation -func NewPatchTransitRouter(ctx *middleware.Context, handler PatchTransitRouterHandler) *PatchTransitRouter { - return &PatchTransitRouter{Context: ctx, Handler: handler} -} - -/* PatchTransitRouter swagger:route PATCH /transit-routers/{id} Router patchTransitRouter - -Update the supplied fields on a router - -Update the supplied fields on a router. Requires admin access. - -*/ -type PatchTransitRouter struct { - Context *middleware.Context - Handler PatchTransitRouterHandler -} - -func (o *PatchTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchTransitRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/patch_transit_router_parameters.go b/rest_management_api_server/operations/router/patch_transit_router_parameters.go deleted file mode 100644 index 26ac47ec2..000000000 --- a/rest_management_api_server/operations/router/patch_transit_router_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchTransitRouterParams creates a new PatchTransitRouterParams object -// -// There are no default values defined in the spec. -func NewPatchTransitRouterParams() PatchTransitRouterParams { - - return PatchTransitRouterParams{} -} - -// PatchTransitRouterParams contains all the bound params for the patch transit router operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchTransitRouter -type PatchTransitRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A router patch object - Required: true - In: body - */ - Router *rest_model.RouterPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchTransitRouterParams() beforehand. -func (o *PatchTransitRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("router", "body", "")) - } else { - res = append(res, errors.NewParseError("router", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Router = &body - } - } - } else { - res = append(res, errors.Required("router", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchTransitRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/patch_transit_router_responses.go b/rest_management_api_server/operations/router/patch_transit_router_responses.go deleted file mode 100644 index 986a535c8..000000000 --- a/rest_management_api_server/operations/router/patch_transit_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchTransitRouterOKCode is the HTTP code returned for type PatchTransitRouterOK -const PatchTransitRouterOKCode int = 200 - -/*PatchTransitRouterOK The patch request was successful and the resource has been altered - -swagger:response patchTransitRouterOK -*/ -type PatchTransitRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchTransitRouterOK creates PatchTransitRouterOK with default headers values -func NewPatchTransitRouterOK() *PatchTransitRouterOK { - - return &PatchTransitRouterOK{} -} - -// WithPayload adds the payload to the patch transit router o k response -func (o *PatchTransitRouterOK) WithPayload(payload *rest_model.Empty) *PatchTransitRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch transit router o k response -func (o *PatchTransitRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTransitRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchTransitRouterBadRequestCode is the HTTP code returned for type PatchTransitRouterBadRequest -const PatchTransitRouterBadRequestCode int = 400 - -/*PatchTransitRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchTransitRouterBadRequest -*/ -type PatchTransitRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchTransitRouterBadRequest creates PatchTransitRouterBadRequest with default headers values -func NewPatchTransitRouterBadRequest() *PatchTransitRouterBadRequest { - - return &PatchTransitRouterBadRequest{} -} - -// WithPayload adds the payload to the patch transit router bad request response -func (o *PatchTransitRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchTransitRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch transit router bad request response -func (o *PatchTransitRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTransitRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchTransitRouterUnauthorizedCode is the HTTP code returned for type PatchTransitRouterUnauthorized -const PatchTransitRouterUnauthorizedCode int = 401 - -/*PatchTransitRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchTransitRouterUnauthorized -*/ -type PatchTransitRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchTransitRouterUnauthorized creates PatchTransitRouterUnauthorized with default headers values -func NewPatchTransitRouterUnauthorized() *PatchTransitRouterUnauthorized { - - return &PatchTransitRouterUnauthorized{} -} - -// WithPayload adds the payload to the patch transit router unauthorized response -func (o *PatchTransitRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchTransitRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch transit router unauthorized response -func (o *PatchTransitRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTransitRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchTransitRouterNotFoundCode is the HTTP code returned for type PatchTransitRouterNotFound -const PatchTransitRouterNotFoundCode int = 404 - -/*PatchTransitRouterNotFound The requested resource does not exist - -swagger:response patchTransitRouterNotFound -*/ -type PatchTransitRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchTransitRouterNotFound creates PatchTransitRouterNotFound with default headers values -func NewPatchTransitRouterNotFound() *PatchTransitRouterNotFound { - - return &PatchTransitRouterNotFound{} -} - -// WithPayload adds the payload to the patch transit router not found response -func (o *PatchTransitRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchTransitRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch transit router not found response -func (o *PatchTransitRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTransitRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/patch_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/patch_transit_router_urlbuilder.go deleted file mode 100644 index 754e75886..000000000 --- a/rest_management_api_server/operations/router/patch_transit_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchTransitRouterURL generates an URL for the patch transit router operation -type PatchTransitRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchTransitRouterURL) WithBasePath(bp string) *PatchTransitRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchTransitRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchTransitRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transit-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchTransitRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchTransitRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchTransitRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchTransitRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchTransitRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchTransitRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchTransitRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/update_router.go b/rest_management_api_server/operations/router/update_router.go deleted file mode 100644 index 8974a125a..000000000 --- a/rest_management_api_server/operations/router/update_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateRouterHandlerFunc turns a function with the right signature into a update router handler -type UpdateRouterHandlerFunc func(UpdateRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateRouterHandlerFunc) Handle(params UpdateRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateRouterHandler interface for that can handle valid update router params -type UpdateRouterHandler interface { - Handle(UpdateRouterParams, interface{}) middleware.Responder -} - -// NewUpdateRouter creates a new http.Handler for the update router operation -func NewUpdateRouter(ctx *middleware.Context, handler UpdateRouterHandler) *UpdateRouter { - return &UpdateRouter{Context: ctx, Handler: handler} -} - -/* UpdateRouter swagger:route PUT /routers/{id} Router updateRouter - -Update all fields on a router - -Update all fields on a router by id. Requires admin access. - -*/ -type UpdateRouter struct { - Context *middleware.Context - Handler UpdateRouterHandler -} - -func (o *UpdateRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/update_router_parameters.go b/rest_management_api_server/operations/router/update_router_parameters.go deleted file mode 100644 index a0511c906..000000000 --- a/rest_management_api_server/operations/router/update_router_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateRouterParams creates a new UpdateRouterParams object -// -// There are no default values defined in the spec. -func NewUpdateRouterParams() UpdateRouterParams { - - return UpdateRouterParams{} -} - -// UpdateRouterParams contains all the bound params for the update router operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateRouter -type UpdateRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A router update object - Required: true - In: body - */ - Router *rest_model.RouterUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateRouterParams() beforehand. -func (o *UpdateRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("router", "body", "")) - } else { - res = append(res, errors.NewParseError("router", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Router = &body - } - } - } else { - res = append(res, errors.Required("router", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/update_router_responses.go b/rest_management_api_server/operations/router/update_router_responses.go deleted file mode 100644 index 8e754cd51..000000000 --- a/rest_management_api_server/operations/router/update_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateRouterOKCode is the HTTP code returned for type UpdateRouterOK -const UpdateRouterOKCode int = 200 - -/*UpdateRouterOK The update request was successful and the resource has been altered - -swagger:response updateRouterOK -*/ -type UpdateRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateRouterOK creates UpdateRouterOK with default headers values -func NewUpdateRouterOK() *UpdateRouterOK { - - return &UpdateRouterOK{} -} - -// WithPayload adds the payload to the update router o k response -func (o *UpdateRouterOK) WithPayload(payload *rest_model.Empty) *UpdateRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update router o k response -func (o *UpdateRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateRouterBadRequestCode is the HTTP code returned for type UpdateRouterBadRequest -const UpdateRouterBadRequestCode int = 400 - -/*UpdateRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateRouterBadRequest -*/ -type UpdateRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateRouterBadRequest creates UpdateRouterBadRequest with default headers values -func NewUpdateRouterBadRequest() *UpdateRouterBadRequest { - - return &UpdateRouterBadRequest{} -} - -// WithPayload adds the payload to the update router bad request response -func (o *UpdateRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update router bad request response -func (o *UpdateRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateRouterUnauthorizedCode is the HTTP code returned for type UpdateRouterUnauthorized -const UpdateRouterUnauthorizedCode int = 401 - -/*UpdateRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateRouterUnauthorized -*/ -type UpdateRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateRouterUnauthorized creates UpdateRouterUnauthorized with default headers values -func NewUpdateRouterUnauthorized() *UpdateRouterUnauthorized { - - return &UpdateRouterUnauthorized{} -} - -// WithPayload adds the payload to the update router unauthorized response -func (o *UpdateRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update router unauthorized response -func (o *UpdateRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateRouterNotFoundCode is the HTTP code returned for type UpdateRouterNotFound -const UpdateRouterNotFoundCode int = 404 - -/*UpdateRouterNotFound The requested resource does not exist - -swagger:response updateRouterNotFound -*/ -type UpdateRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateRouterNotFound creates UpdateRouterNotFound with default headers values -func NewUpdateRouterNotFound() *UpdateRouterNotFound { - - return &UpdateRouterNotFound{} -} - -// WithPayload adds the payload to the update router not found response -func (o *UpdateRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update router not found response -func (o *UpdateRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/update_router_urlbuilder.go b/rest_management_api_server/operations/router/update_router_urlbuilder.go deleted file mode 100644 index 2c5a6c26c..000000000 --- a/rest_management_api_server/operations/router/update_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateRouterURL generates an URL for the update router operation -type UpdateRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateRouterURL) WithBasePath(bp string) *UpdateRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/router/update_transit_router.go b/rest_management_api_server/operations/router/update_transit_router.go deleted file mode 100644 index 0c997d4cd..000000000 --- a/rest_management_api_server/operations/router/update_transit_router.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateTransitRouterHandlerFunc turns a function with the right signature into a update transit router handler -type UpdateTransitRouterHandlerFunc func(UpdateTransitRouterParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateTransitRouterHandlerFunc) Handle(params UpdateTransitRouterParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateTransitRouterHandler interface for that can handle valid update transit router params -type UpdateTransitRouterHandler interface { - Handle(UpdateTransitRouterParams, interface{}) middleware.Responder -} - -// NewUpdateTransitRouter creates a new http.Handler for the update transit router operation -func NewUpdateTransitRouter(ctx *middleware.Context, handler UpdateTransitRouterHandler) *UpdateTransitRouter { - return &UpdateTransitRouter{Context: ctx, Handler: handler} -} - -/* UpdateTransitRouter swagger:route PUT /transit-routers/{id} Router updateTransitRouter - -Update all fields on a router - -Update all fields on a router by id. Requires admin access. - -*/ -type UpdateTransitRouter struct { - Context *middleware.Context - Handler UpdateTransitRouterHandler -} - -func (o *UpdateTransitRouter) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateTransitRouterParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/router/update_transit_router_parameters.go b/rest_management_api_server/operations/router/update_transit_router_parameters.go deleted file mode 100644 index 86f800603..000000000 --- a/rest_management_api_server/operations/router/update_transit_router_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateTransitRouterParams creates a new UpdateTransitRouterParams object -// -// There are no default values defined in the spec. -func NewUpdateTransitRouterParams() UpdateTransitRouterParams { - - return UpdateTransitRouterParams{} -} - -// UpdateTransitRouterParams contains all the bound params for the update transit router operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateTransitRouter -type UpdateTransitRouterParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A router update object - Required: true - In: body - */ - Router *rest_model.RouterUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateTransitRouterParams() beforehand. -func (o *UpdateTransitRouterParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.RouterUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("router", "body", "")) - } else { - res = append(res, errors.NewParseError("router", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Router = &body - } - } - } else { - res = append(res, errors.Required("router", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateTransitRouterParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/router/update_transit_router_responses.go b/rest_management_api_server/operations/router/update_transit_router_responses.go deleted file mode 100644 index 14d5bc79b..000000000 --- a/rest_management_api_server/operations/router/update_transit_router_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateTransitRouterOKCode is the HTTP code returned for type UpdateTransitRouterOK -const UpdateTransitRouterOKCode int = 200 - -/*UpdateTransitRouterOK The update request was successful and the resource has been altered - -swagger:response updateTransitRouterOK -*/ -type UpdateTransitRouterOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateTransitRouterOK creates UpdateTransitRouterOK with default headers values -func NewUpdateTransitRouterOK() *UpdateTransitRouterOK { - - return &UpdateTransitRouterOK{} -} - -// WithPayload adds the payload to the update transit router o k response -func (o *UpdateTransitRouterOK) WithPayload(payload *rest_model.Empty) *UpdateTransitRouterOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update transit router o k response -func (o *UpdateTransitRouterOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTransitRouterOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateTransitRouterBadRequestCode is the HTTP code returned for type UpdateTransitRouterBadRequest -const UpdateTransitRouterBadRequestCode int = 400 - -/*UpdateTransitRouterBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateTransitRouterBadRequest -*/ -type UpdateTransitRouterBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateTransitRouterBadRequest creates UpdateTransitRouterBadRequest with default headers values -func NewUpdateTransitRouterBadRequest() *UpdateTransitRouterBadRequest { - - return &UpdateTransitRouterBadRequest{} -} - -// WithPayload adds the payload to the update transit router bad request response -func (o *UpdateTransitRouterBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateTransitRouterBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update transit router bad request response -func (o *UpdateTransitRouterBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTransitRouterBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateTransitRouterUnauthorizedCode is the HTTP code returned for type UpdateTransitRouterUnauthorized -const UpdateTransitRouterUnauthorizedCode int = 401 - -/*UpdateTransitRouterUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateTransitRouterUnauthorized -*/ -type UpdateTransitRouterUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateTransitRouterUnauthorized creates UpdateTransitRouterUnauthorized with default headers values -func NewUpdateTransitRouterUnauthorized() *UpdateTransitRouterUnauthorized { - - return &UpdateTransitRouterUnauthorized{} -} - -// WithPayload adds the payload to the update transit router unauthorized response -func (o *UpdateTransitRouterUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateTransitRouterUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update transit router unauthorized response -func (o *UpdateTransitRouterUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTransitRouterUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateTransitRouterNotFoundCode is the HTTP code returned for type UpdateTransitRouterNotFound -const UpdateTransitRouterNotFoundCode int = 404 - -/*UpdateTransitRouterNotFound The requested resource does not exist - -swagger:response updateTransitRouterNotFound -*/ -type UpdateTransitRouterNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateTransitRouterNotFound creates UpdateTransitRouterNotFound with default headers values -func NewUpdateTransitRouterNotFound() *UpdateTransitRouterNotFound { - - return &UpdateTransitRouterNotFound{} -} - -// WithPayload adds the payload to the update transit router not found response -func (o *UpdateTransitRouterNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateTransitRouterNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update transit router not found response -func (o *UpdateTransitRouterNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTransitRouterNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/router/update_transit_router_urlbuilder.go b/rest_management_api_server/operations/router/update_transit_router_urlbuilder.go deleted file mode 100644 index 93e22d962..000000000 --- a/rest_management_api_server/operations/router/update_transit_router_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package router - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateTransitRouterURL generates an URL for the update transit router operation -type UpdateTransitRouterURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateTransitRouterURL) WithBasePath(bp string) *UpdateTransitRouterURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateTransitRouterURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateTransitRouterURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transit-routers/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateTransitRouterURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateTransitRouterURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateTransitRouterURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateTransitRouterURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateTransitRouterURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateTransitRouterURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateTransitRouterURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/create_service.go b/rest_management_api_server/operations/service/create_service.go deleted file mode 100644 index 855ddb275..000000000 --- a/rest_management_api_server/operations/service/create_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateServiceHandlerFunc turns a function with the right signature into a create service handler -type CreateServiceHandlerFunc func(CreateServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateServiceHandlerFunc) Handle(params CreateServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateServiceHandler interface for that can handle valid create service params -type CreateServiceHandler interface { - Handle(CreateServiceParams, interface{}) middleware.Responder -} - -// NewCreateService creates a new http.Handler for the create service operation -func NewCreateService(ctx *middleware.Context, handler CreateServiceHandler) *CreateService { - return &CreateService{Context: ctx, Handler: handler} -} - -/* CreateService swagger:route POST /services Service createService - -Create a services resource - -Create a services resource. Requires admin access. - -*/ -type CreateService struct { - Context *middleware.Context - Handler CreateServiceHandler -} - -func (o *CreateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/create_service_parameters.go b/rest_management_api_server/operations/service/create_service_parameters.go deleted file mode 100644 index b2fb30768..000000000 --- a/rest_management_api_server/operations/service/create_service_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateServiceParams creates a new CreateServiceParams object -// -// There are no default values defined in the spec. -func NewCreateServiceParams() CreateServiceParams { - - return CreateServiceParams{} -} - -// CreateServiceParams contains all the bound params for the create service operation -// typically these are obtained from a http.Request -// -// swagger:parameters createService -type CreateServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A service to create - Required: true - In: body - */ - Service *rest_model.ServiceCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateServiceParams() beforehand. -func (o *CreateServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("service", "body", "")) - } else { - res = append(res, errors.NewParseError("service", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Service = &body - } - } - } else { - res = append(res, errors.Required("service", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/service/create_service_responses.go b/rest_management_api_server/operations/service/create_service_responses.go deleted file mode 100644 index 875c4f3b5..000000000 --- a/rest_management_api_server/operations/service/create_service_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateServiceCreatedCode is the HTTP code returned for type CreateServiceCreated -const CreateServiceCreatedCode int = 201 - -/*CreateServiceCreated The create request was successful and the resource has been added at the following location - -swagger:response createServiceCreated -*/ -type CreateServiceCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateServiceCreated creates CreateServiceCreated with default headers values -func NewCreateServiceCreated() *CreateServiceCreated { - - return &CreateServiceCreated{} -} - -// WithPayload adds the payload to the create service created response -func (o *CreateServiceCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateServiceCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service created response -func (o *CreateServiceCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceBadRequestCode is the HTTP code returned for type CreateServiceBadRequest -const CreateServiceBadRequestCode int = 400 - -/*CreateServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createServiceBadRequest -*/ -type CreateServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateServiceBadRequest creates CreateServiceBadRequest with default headers values -func NewCreateServiceBadRequest() *CreateServiceBadRequest { - - return &CreateServiceBadRequest{} -} - -// WithPayload adds the payload to the create service bad request response -func (o *CreateServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service bad request response -func (o *CreateServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceUnauthorizedCode is the HTTP code returned for type CreateServiceUnauthorized -const CreateServiceUnauthorizedCode int = 401 - -/*CreateServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createServiceUnauthorized -*/ -type CreateServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateServiceUnauthorized creates CreateServiceUnauthorized with default headers values -func NewCreateServiceUnauthorized() *CreateServiceUnauthorized { - - return &CreateServiceUnauthorized{} -} - -// WithPayload adds the payload to the create service unauthorized response -func (o *CreateServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service unauthorized response -func (o *CreateServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/create_service_urlbuilder.go b/rest_management_api_server/operations/service/create_service_urlbuilder.go deleted file mode 100644 index 058fb71d8..000000000 --- a/rest_management_api_server/operations/service/create_service_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateServiceURL generates an URL for the create service operation -type CreateServiceURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceURL) WithBasePath(bp string) *CreateServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/delete_service.go b/rest_management_api_server/operations/service/delete_service.go deleted file mode 100644 index f0c9736e9..000000000 --- a/rest_management_api_server/operations/service/delete_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteServiceHandlerFunc turns a function with the right signature into a delete service handler -type DeleteServiceHandlerFunc func(DeleteServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteServiceHandlerFunc) Handle(params DeleteServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteServiceHandler interface for that can handle valid delete service params -type DeleteServiceHandler interface { - Handle(DeleteServiceParams, interface{}) middleware.Responder -} - -// NewDeleteService creates a new http.Handler for the delete service operation -func NewDeleteService(ctx *middleware.Context, handler DeleteServiceHandler) *DeleteService { - return &DeleteService{Context: ctx, Handler: handler} -} - -/* DeleteService swagger:route DELETE /services/{id} Service deleteService - -Delete a service - -Delete a service by id. Requires admin access. - -*/ -type DeleteService struct { - Context *middleware.Context - Handler DeleteServiceHandler -} - -func (o *DeleteService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/delete_service_parameters.go b/rest_management_api_server/operations/service/delete_service_parameters.go deleted file mode 100644 index 57bc96fc3..000000000 --- a/rest_management_api_server/operations/service/delete_service_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceParams creates a new DeleteServiceParams object -// -// There are no default values defined in the spec. -func NewDeleteServiceParams() DeleteServiceParams { - - return DeleteServiceParams{} -} - -// DeleteServiceParams contains all the bound params for the delete service operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteService -type DeleteServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteServiceParams() beforehand. -func (o *DeleteServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service/delete_service_responses.go b/rest_management_api_server/operations/service/delete_service_responses.go deleted file mode 100644 index d0ab1373f..000000000 --- a/rest_management_api_server/operations/service/delete_service_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServiceOKCode is the HTTP code returned for type DeleteServiceOK -const DeleteServiceOKCode int = 200 - -/*DeleteServiceOK The delete request was successful and the resource has been removed - -swagger:response deleteServiceOK -*/ -type DeleteServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteServiceOK creates DeleteServiceOK with default headers values -func NewDeleteServiceOK() *DeleteServiceOK { - - return &DeleteServiceOK{} -} - -// WithPayload adds the payload to the delete service o k response -func (o *DeleteServiceOK) WithPayload(payload *rest_model.Empty) *DeleteServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service o k response -func (o *DeleteServiceOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceBadRequestCode is the HTTP code returned for type DeleteServiceBadRequest -const DeleteServiceBadRequestCode int = 400 - -/*DeleteServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteServiceBadRequest -*/ -type DeleteServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceBadRequest creates DeleteServiceBadRequest with default headers values -func NewDeleteServiceBadRequest() *DeleteServiceBadRequest { - - return &DeleteServiceBadRequest{} -} - -// WithPayload adds the payload to the delete service bad request response -func (o *DeleteServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service bad request response -func (o *DeleteServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceUnauthorizedCode is the HTTP code returned for type DeleteServiceUnauthorized -const DeleteServiceUnauthorizedCode int = 401 - -/*DeleteServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteServiceUnauthorized -*/ -type DeleteServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceUnauthorized creates DeleteServiceUnauthorized with default headers values -func NewDeleteServiceUnauthorized() *DeleteServiceUnauthorized { - - return &DeleteServiceUnauthorized{} -} - -// WithPayload adds the payload to the delete service unauthorized response -func (o *DeleteServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service unauthorized response -func (o *DeleteServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceConflictCode is the HTTP code returned for type DeleteServiceConflict -const DeleteServiceConflictCode int = 409 - -/*DeleteServiceConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteServiceConflict -*/ -type DeleteServiceConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceConflict creates DeleteServiceConflict with default headers values -func NewDeleteServiceConflict() *DeleteServiceConflict { - - return &DeleteServiceConflict{} -} - -// WithPayload adds the payload to the delete service conflict response -func (o *DeleteServiceConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service conflict response -func (o *DeleteServiceConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/delete_service_urlbuilder.go b/rest_management_api_server/operations/service/delete_service_urlbuilder.go deleted file mode 100644 index af86e8e95..000000000 --- a/rest_management_api_server/operations/service/delete_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteServiceURL generates an URL for the delete service operation -type DeleteServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServiceURL) WithBasePath(bp string) *DeleteServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/detail_service.go b/rest_management_api_server/operations/service/detail_service.go deleted file mode 100644 index a2ac0f6b6..000000000 --- a/rest_management_api_server/operations/service/detail_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailServiceHandlerFunc turns a function with the right signature into a detail service handler -type DetailServiceHandlerFunc func(DetailServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailServiceHandlerFunc) Handle(params DetailServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailServiceHandler interface for that can handle valid detail service params -type DetailServiceHandler interface { - Handle(DetailServiceParams, interface{}) middleware.Responder -} - -// NewDetailService creates a new http.Handler for the detail service operation -func NewDetailService(ctx *middleware.Context, handler DetailServiceHandler) *DetailService { - return &DetailService{Context: ctx, Handler: handler} -} - -/* DetailService swagger:route GET /services/{id} Service detailService - -Retrieves a single service - -Retrieves a single service by id. Requires admin access. - -*/ -type DetailService struct { - Context *middleware.Context - Handler DetailServiceHandler -} - -func (o *DetailService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/detail_service_parameters.go b/rest_management_api_server/operations/service/detail_service_parameters.go deleted file mode 100644 index 8ea426c12..000000000 --- a/rest_management_api_server/operations/service/detail_service_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailServiceParams creates a new DetailServiceParams object -// -// There are no default values defined in the spec. -func NewDetailServiceParams() DetailServiceParams { - - return DetailServiceParams{} -} - -// DetailServiceParams contains all the bound params for the detail service operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailService -type DetailServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailServiceParams() beforehand. -func (o *DetailServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service/detail_service_responses.go b/rest_management_api_server/operations/service/detail_service_responses.go deleted file mode 100644 index 9cb28dddd..000000000 --- a/rest_management_api_server/operations/service/detail_service_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailServiceOKCode is the HTTP code returned for type DetailServiceOK -const DetailServiceOKCode int = 200 - -/*DetailServiceOK A single service - -swagger:response detailServiceOK -*/ -type DetailServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailServiceEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceOK creates DetailServiceOK with default headers values -func NewDetailServiceOK() *DetailServiceOK { - - return &DetailServiceOK{} -} - -// WithPayload adds the payload to the detail service o k response -func (o *DetailServiceOK) WithPayload(payload *rest_model.DetailServiceEnvelope) *DetailServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service o k response -func (o *DetailServiceOK) SetPayload(payload *rest_model.DetailServiceEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServiceUnauthorizedCode is the HTTP code returned for type DetailServiceUnauthorized -const DetailServiceUnauthorizedCode int = 401 - -/*DetailServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailServiceUnauthorized -*/ -type DetailServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceUnauthorized creates DetailServiceUnauthorized with default headers values -func NewDetailServiceUnauthorized() *DetailServiceUnauthorized { - - return &DetailServiceUnauthorized{} -} - -// WithPayload adds the payload to the detail service unauthorized response -func (o *DetailServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service unauthorized response -func (o *DetailServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServiceNotFoundCode is the HTTP code returned for type DetailServiceNotFound -const DetailServiceNotFoundCode int = 404 - -/*DetailServiceNotFound The requested resource does not exist - -swagger:response detailServiceNotFound -*/ -type DetailServiceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceNotFound creates DetailServiceNotFound with default headers values -func NewDetailServiceNotFound() *DetailServiceNotFound { - - return &DetailServiceNotFound{} -} - -// WithPayload adds the payload to the detail service not found response -func (o *DetailServiceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServiceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service not found response -func (o *DetailServiceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/detail_service_urlbuilder.go b/rest_management_api_server/operations/service/detail_service_urlbuilder.go deleted file mode 100644 index a8dd1ccdd..000000000 --- a/rest_management_api_server/operations/service/detail_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailServiceURL generates an URL for the detail service operation -type DetailServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServiceURL) WithBasePath(bp string) *DetailServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_service_config.go b/rest_management_api_server/operations/service/list_service_config.go deleted file mode 100644 index cdfbca167..000000000 --- a/rest_management_api_server/operations/service/list_service_config.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceConfigHandlerFunc turns a function with the right signature into a list service config handler -type ListServiceConfigHandlerFunc func(ListServiceConfigParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceConfigHandlerFunc) Handle(params ListServiceConfigParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceConfigHandler interface for that can handle valid list service config params -type ListServiceConfigHandler interface { - Handle(ListServiceConfigParams, interface{}) middleware.Responder -} - -// NewListServiceConfig creates a new http.Handler for the list service config operation -func NewListServiceConfig(ctx *middleware.Context, handler ListServiceConfigHandler) *ListServiceConfig { - return &ListServiceConfig{Context: ctx, Handler: handler} -} - -/* ListServiceConfig swagger:route GET /services/{id}/configs Service listServiceConfig - -List configs associated to a specific service - -Retrieves a list of config resources associated to a specific service; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceConfig struct { - Context *middleware.Context - Handler ListServiceConfigHandler -} - -func (o *ListServiceConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceConfigParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_service_config_parameters.go b/rest_management_api_server/operations/service/list_service_config_parameters.go deleted file mode 100644 index b3faf0dac..000000000 --- a/rest_management_api_server/operations/service/list_service_config_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceConfigParams creates a new ListServiceConfigParams object -// -// There are no default values defined in the spec. -func NewListServiceConfigParams() ListServiceConfigParams { - - return ListServiceConfigParams{} -} - -// ListServiceConfigParams contains all the bound params for the list service config operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceConfig -type ListServiceConfigParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceConfigParams() beforehand. -func (o *ListServiceConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceConfigParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceConfigParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceConfigParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceConfigParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service/list_service_config_responses.go b/rest_management_api_server/operations/service/list_service_config_responses.go deleted file mode 100644 index ae0b6e18f..000000000 --- a/rest_management_api_server/operations/service/list_service_config_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceConfigOKCode is the HTTP code returned for type ListServiceConfigOK -const ListServiceConfigOKCode int = 200 - -/*ListServiceConfigOK A list of configs - -swagger:response listServiceConfigOK -*/ -type ListServiceConfigOK struct { - - /* - In: Body - */ - Payload *rest_model.ListConfigsEnvelope `json:"body,omitempty"` -} - -// NewListServiceConfigOK creates ListServiceConfigOK with default headers values -func NewListServiceConfigOK() *ListServiceConfigOK { - - return &ListServiceConfigOK{} -} - -// WithPayload adds the payload to the list service config o k response -func (o *ListServiceConfigOK) WithPayload(payload *rest_model.ListConfigsEnvelope) *ListServiceConfigOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service config o k response -func (o *ListServiceConfigOK) SetPayload(payload *rest_model.ListConfigsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceConfigBadRequestCode is the HTTP code returned for type ListServiceConfigBadRequest -const ListServiceConfigBadRequestCode int = 400 - -/*ListServiceConfigBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceConfigBadRequest -*/ -type ListServiceConfigBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceConfigBadRequest creates ListServiceConfigBadRequest with default headers values -func NewListServiceConfigBadRequest() *ListServiceConfigBadRequest { - - return &ListServiceConfigBadRequest{} -} - -// WithPayload adds the payload to the list service config bad request response -func (o *ListServiceConfigBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceConfigBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service config bad request response -func (o *ListServiceConfigBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceConfigBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceConfigUnauthorizedCode is the HTTP code returned for type ListServiceConfigUnauthorized -const ListServiceConfigUnauthorizedCode int = 401 - -/*ListServiceConfigUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceConfigUnauthorized -*/ -type ListServiceConfigUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceConfigUnauthorized creates ListServiceConfigUnauthorized with default headers values -func NewListServiceConfigUnauthorized() *ListServiceConfigUnauthorized { - - return &ListServiceConfigUnauthorized{} -} - -// WithPayload adds the payload to the list service config unauthorized response -func (o *ListServiceConfigUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceConfigUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service config unauthorized response -func (o *ListServiceConfigUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceConfigUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_service_config_urlbuilder.go b/rest_management_api_server/operations/service/list_service_config_urlbuilder.go deleted file mode 100644 index 28c573654..000000000 --- a/rest_management_api_server/operations/service/list_service_config_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceConfigURL generates an URL for the list service config operation -type ListServiceConfigURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceConfigURL) WithBasePath(bp string) *ListServiceConfigURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceConfigURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceConfigURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/configs" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceConfigURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceConfigURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceConfigURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceConfigURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceConfigURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceConfigURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceConfigURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_service_edge_routers.go b/rest_management_api_server/operations/service/list_service_edge_routers.go deleted file mode 100644 index df02ad0cb..000000000 --- a/rest_management_api_server/operations/service/list_service_edge_routers.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceEdgeRoutersHandlerFunc turns a function with the right signature into a list service edge routers handler -type ListServiceEdgeRoutersHandlerFunc func(ListServiceEdgeRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceEdgeRoutersHandlerFunc) Handle(params ListServiceEdgeRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceEdgeRoutersHandler interface for that can handle valid list service edge routers params -type ListServiceEdgeRoutersHandler interface { - Handle(ListServiceEdgeRoutersParams, interface{}) middleware.Responder -} - -// NewListServiceEdgeRouters creates a new http.Handler for the list service edge routers operation -func NewListServiceEdgeRouters(ctx *middleware.Context, handler ListServiceEdgeRoutersHandler) *ListServiceEdgeRouters { - return &ListServiceEdgeRouters{Context: ctx, Handler: handler} -} - -/* ListServiceEdgeRouters swagger:route GET /services/{id}/edge-routers Service listServiceEdgeRouters - -List accessible edge-routers - -Retrieves a list of edge-routers that may be used to access the given service. Supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceEdgeRouters struct { - Context *middleware.Context - Handler ListServiceEdgeRoutersHandler -} - -func (o *ListServiceEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceEdgeRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_service_edge_routers_parameters.go b/rest_management_api_server/operations/service/list_service_edge_routers_parameters.go deleted file mode 100644 index d71b26c66..000000000 --- a/rest_management_api_server/operations/service/list_service_edge_routers_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceEdgeRoutersParams creates a new ListServiceEdgeRoutersParams object -// -// There are no default values defined in the spec. -func NewListServiceEdgeRoutersParams() ListServiceEdgeRoutersParams { - - return ListServiceEdgeRoutersParams{} -} - -// ListServiceEdgeRoutersParams contains all the bound params for the list service edge routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceEdgeRouters -type ListServiceEdgeRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceEdgeRoutersParams() beforehand. -func (o *ListServiceEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceEdgeRoutersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceEdgeRoutersParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceEdgeRoutersParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceEdgeRoutersParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service/list_service_edge_routers_responses.go b/rest_management_api_server/operations/service/list_service_edge_routers_responses.go deleted file mode 100644 index 346200b18..000000000 --- a/rest_management_api_server/operations/service/list_service_edge_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRoutersOKCode is the HTTP code returned for type ListServiceEdgeRoutersOK -const ListServiceEdgeRoutersOKCode int = 200 - -/*ListServiceEdgeRoutersOK A list of edge routers - -swagger:response listServiceEdgeRoutersOK -*/ -type ListServiceEdgeRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRoutersOK creates ListServiceEdgeRoutersOK with default headers values -func NewListServiceEdgeRoutersOK() *ListServiceEdgeRoutersOK { - - return &ListServiceEdgeRoutersOK{} -} - -// WithPayload adds the payload to the list service edge routers o k response -func (o *ListServiceEdgeRoutersOK) WithPayload(payload *rest_model.ListEdgeRoutersEnvelope) *ListServiceEdgeRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge routers o k response -func (o *ListServiceEdgeRoutersOK) SetPayload(payload *rest_model.ListEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRoutersBadRequestCode is the HTTP code returned for type ListServiceEdgeRoutersBadRequest -const ListServiceEdgeRoutersBadRequestCode int = 400 - -/*ListServiceEdgeRoutersBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceEdgeRoutersBadRequest -*/ -type ListServiceEdgeRoutersBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRoutersBadRequest creates ListServiceEdgeRoutersBadRequest with default headers values -func NewListServiceEdgeRoutersBadRequest() *ListServiceEdgeRoutersBadRequest { - - return &ListServiceEdgeRoutersBadRequest{} -} - -// WithPayload adds the payload to the list service edge routers bad request response -func (o *ListServiceEdgeRoutersBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRoutersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge routers bad request response -func (o *ListServiceEdgeRoutersBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRoutersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRoutersUnauthorizedCode is the HTTP code returned for type ListServiceEdgeRoutersUnauthorized -const ListServiceEdgeRoutersUnauthorizedCode int = 401 - -/*ListServiceEdgeRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceEdgeRoutersUnauthorized -*/ -type ListServiceEdgeRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRoutersUnauthorized creates ListServiceEdgeRoutersUnauthorized with default headers values -func NewListServiceEdgeRoutersUnauthorized() *ListServiceEdgeRoutersUnauthorized { - - return &ListServiceEdgeRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list service edge routers unauthorized response -func (o *ListServiceEdgeRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge routers unauthorized response -func (o *ListServiceEdgeRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_service_edge_routers_urlbuilder.go b/rest_management_api_server/operations/service/list_service_edge_routers_urlbuilder.go deleted file mode 100644 index c32781617..000000000 --- a/rest_management_api_server/operations/service/list_service_edge_routers_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceEdgeRoutersURL generates an URL for the list service edge routers operation -type ListServiceEdgeRoutersURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRoutersURL) WithBasePath(bp string) *ListServiceEdgeRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceEdgeRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/edge-routers" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceEdgeRoutersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceEdgeRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceEdgeRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceEdgeRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceEdgeRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceEdgeRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceEdgeRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_service_identities.go b/rest_management_api_server/operations/service/list_service_identities.go deleted file mode 100644 index 281e0dc5c..000000000 --- a/rest_management_api_server/operations/service/list_service_identities.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceIdentitiesHandlerFunc turns a function with the right signature into a list service identities handler -type ListServiceIdentitiesHandlerFunc func(ListServiceIdentitiesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceIdentitiesHandlerFunc) Handle(params ListServiceIdentitiesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceIdentitiesHandler interface for that can handle valid list service identities params -type ListServiceIdentitiesHandler interface { - Handle(ListServiceIdentitiesParams, interface{}) middleware.Responder -} - -// NewListServiceIdentities creates a new http.Handler for the list service identities operation -func NewListServiceIdentities(ctx *middleware.Context, handler ListServiceIdentitiesHandler) *ListServiceIdentities { - return &ListServiceIdentities{Context: ctx, Handler: handler} -} - -/* ListServiceIdentities swagger:route GET /services/{id}/identities Service listServiceIdentities - -List identities with access - -Retrieves a list of identities that have access to this service. Supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceIdentities struct { - Context *middleware.Context - Handler ListServiceIdentitiesHandler -} - -func (o *ListServiceIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceIdentitiesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_service_identities_parameters.go b/rest_management_api_server/operations/service/list_service_identities_parameters.go deleted file mode 100644 index 5601ee4a1..000000000 --- a/rest_management_api_server/operations/service/list_service_identities_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceIdentitiesParams creates a new ListServiceIdentitiesParams object -// -// There are no default values defined in the spec. -func NewListServiceIdentitiesParams() ListServiceIdentitiesParams { - - return ListServiceIdentitiesParams{} -} - -// ListServiceIdentitiesParams contains all the bound params for the list service identities operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceIdentities -type ListServiceIdentitiesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceIdentitiesParams() beforehand. -func (o *ListServiceIdentitiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceIdentitiesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceIdentitiesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceIdentitiesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceIdentitiesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service/list_service_identities_responses.go b/rest_management_api_server/operations/service/list_service_identities_responses.go deleted file mode 100644 index d72cb2dcc..000000000 --- a/rest_management_api_server/operations/service/list_service_identities_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceIdentitiesOKCode is the HTTP code returned for type ListServiceIdentitiesOK -const ListServiceIdentitiesOKCode int = 200 - -/*ListServiceIdentitiesOK A list of identities - -swagger:response listServiceIdentitiesOK -*/ -type ListServiceIdentitiesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListIdentitiesEnvelope `json:"body,omitempty"` -} - -// NewListServiceIdentitiesOK creates ListServiceIdentitiesOK with default headers values -func NewListServiceIdentitiesOK() *ListServiceIdentitiesOK { - - return &ListServiceIdentitiesOK{} -} - -// WithPayload adds the payload to the list service identities o k response -func (o *ListServiceIdentitiesOK) WithPayload(payload *rest_model.ListIdentitiesEnvelope) *ListServiceIdentitiesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service identities o k response -func (o *ListServiceIdentitiesOK) SetPayload(payload *rest_model.ListIdentitiesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceIdentitiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceIdentitiesBadRequestCode is the HTTP code returned for type ListServiceIdentitiesBadRequest -const ListServiceIdentitiesBadRequestCode int = 400 - -/*ListServiceIdentitiesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceIdentitiesBadRequest -*/ -type ListServiceIdentitiesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceIdentitiesBadRequest creates ListServiceIdentitiesBadRequest with default headers values -func NewListServiceIdentitiesBadRequest() *ListServiceIdentitiesBadRequest { - - return &ListServiceIdentitiesBadRequest{} -} - -// WithPayload adds the payload to the list service identities bad request response -func (o *ListServiceIdentitiesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceIdentitiesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service identities bad request response -func (o *ListServiceIdentitiesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceIdentitiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceIdentitiesUnauthorizedCode is the HTTP code returned for type ListServiceIdentitiesUnauthorized -const ListServiceIdentitiesUnauthorizedCode int = 401 - -/*ListServiceIdentitiesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceIdentitiesUnauthorized -*/ -type ListServiceIdentitiesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceIdentitiesUnauthorized creates ListServiceIdentitiesUnauthorized with default headers values -func NewListServiceIdentitiesUnauthorized() *ListServiceIdentitiesUnauthorized { - - return &ListServiceIdentitiesUnauthorized{} -} - -// WithPayload adds the payload to the list service identities unauthorized response -func (o *ListServiceIdentitiesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceIdentitiesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service identities unauthorized response -func (o *ListServiceIdentitiesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceIdentitiesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_service_identities_urlbuilder.go b/rest_management_api_server/operations/service/list_service_identities_urlbuilder.go deleted file mode 100644 index e8d0b1d09..000000000 --- a/rest_management_api_server/operations/service/list_service_identities_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceIdentitiesURL generates an URL for the list service identities operation -type ListServiceIdentitiesURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceIdentitiesURL) WithBasePath(bp string) *ListServiceIdentitiesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceIdentitiesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceIdentitiesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/identities" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceIdentitiesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceIdentitiesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceIdentitiesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceIdentitiesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceIdentitiesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceIdentitiesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceIdentitiesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_service_service_edge_router_policies.go b/rest_management_api_server/operations/service/list_service_service_edge_router_policies.go deleted file mode 100644 index 60f7cbaf3..000000000 --- a/rest_management_api_server/operations/service/list_service_service_edge_router_policies.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceServiceEdgeRouterPoliciesHandlerFunc turns a function with the right signature into a list service service edge router policies handler -type ListServiceServiceEdgeRouterPoliciesHandlerFunc func(ListServiceServiceEdgeRouterPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceServiceEdgeRouterPoliciesHandlerFunc) Handle(params ListServiceServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceServiceEdgeRouterPoliciesHandler interface for that can handle valid list service service edge router policies params -type ListServiceServiceEdgeRouterPoliciesHandler interface { - Handle(ListServiceServiceEdgeRouterPoliciesParams, interface{}) middleware.Responder -} - -// NewListServiceServiceEdgeRouterPolicies creates a new http.Handler for the list service service edge router policies operation -func NewListServiceServiceEdgeRouterPolicies(ctx *middleware.Context, handler ListServiceServiceEdgeRouterPoliciesHandler) *ListServiceServiceEdgeRouterPolicies { - return &ListServiceServiceEdgeRouterPolicies{Context: ctx, Handler: handler} -} - -/* ListServiceServiceEdgeRouterPolicies swagger:route GET /services/{id}/service-edge-router-policies Service listServiceServiceEdgeRouterPolicies - -List service edge router policies that affect a specific service - -Retrieves a list of service edge router policy resources that affect a specific service; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceServiceEdgeRouterPolicies struct { - Context *middleware.Context - Handler ListServiceServiceEdgeRouterPoliciesHandler -} - -func (o *ListServiceServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceServiceEdgeRouterPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_service_service_edge_router_policies_parameters.go b/rest_management_api_server/operations/service/list_service_service_edge_router_policies_parameters.go deleted file mode 100644 index 113970d98..000000000 --- a/rest_management_api_server/operations/service/list_service_service_edge_router_policies_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceServiceEdgeRouterPoliciesParams creates a new ListServiceServiceEdgeRouterPoliciesParams object -// -// There are no default values defined in the spec. -func NewListServiceServiceEdgeRouterPoliciesParams() ListServiceServiceEdgeRouterPoliciesParams { - - return ListServiceServiceEdgeRouterPoliciesParams{} -} - -// ListServiceServiceEdgeRouterPoliciesParams contains all the bound params for the list service service edge router policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceServiceEdgeRouterPolicies -type ListServiceServiceEdgeRouterPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceServiceEdgeRouterPoliciesParams() beforehand. -func (o *ListServiceServiceEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceServiceEdgeRouterPoliciesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceServiceEdgeRouterPoliciesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceServiceEdgeRouterPoliciesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceServiceEdgeRouterPoliciesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service/list_service_service_edge_router_policies_responses.go b/rest_management_api_server/operations/service/list_service_service_edge_router_policies_responses.go deleted file mode 100644 index 334ec2815..000000000 --- a/rest_management_api_server/operations/service/list_service_service_edge_router_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceServiceEdgeRouterPoliciesOKCode is the HTTP code returned for type ListServiceServiceEdgeRouterPoliciesOK -const ListServiceServiceEdgeRouterPoliciesOKCode int = 200 - -/*ListServiceServiceEdgeRouterPoliciesOK A list of service edge router policies - -swagger:response listServiceServiceEdgeRouterPoliciesOK -*/ -type ListServiceServiceEdgeRouterPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope `json:"body,omitempty"` -} - -// NewListServiceServiceEdgeRouterPoliciesOK creates ListServiceServiceEdgeRouterPoliciesOK with default headers values -func NewListServiceServiceEdgeRouterPoliciesOK() *ListServiceServiceEdgeRouterPoliciesOK { - - return &ListServiceServiceEdgeRouterPoliciesOK{} -} - -// WithPayload adds the payload to the list service service edge router policies o k response -func (o *ListServiceServiceEdgeRouterPoliciesOK) WithPayload(payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope) *ListServiceServiceEdgeRouterPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service service edge router policies o k response -func (o *ListServiceServiceEdgeRouterPoliciesOK) SetPayload(payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceServiceEdgeRouterPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceServiceEdgeRouterPoliciesBadRequestCode is the HTTP code returned for type ListServiceServiceEdgeRouterPoliciesBadRequest -const ListServiceServiceEdgeRouterPoliciesBadRequestCode int = 400 - -/*ListServiceServiceEdgeRouterPoliciesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceServiceEdgeRouterPoliciesBadRequest -*/ -type ListServiceServiceEdgeRouterPoliciesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceServiceEdgeRouterPoliciesBadRequest creates ListServiceServiceEdgeRouterPoliciesBadRequest with default headers values -func NewListServiceServiceEdgeRouterPoliciesBadRequest() *ListServiceServiceEdgeRouterPoliciesBadRequest { - - return &ListServiceServiceEdgeRouterPoliciesBadRequest{} -} - -// WithPayload adds the payload to the list service service edge router policies bad request response -func (o *ListServiceServiceEdgeRouterPoliciesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceServiceEdgeRouterPoliciesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service service edge router policies bad request response -func (o *ListServiceServiceEdgeRouterPoliciesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceServiceEdgeRouterPoliciesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceServiceEdgeRouterPoliciesUnauthorizedCode is the HTTP code returned for type ListServiceServiceEdgeRouterPoliciesUnauthorized -const ListServiceServiceEdgeRouterPoliciesUnauthorizedCode int = 401 - -/*ListServiceServiceEdgeRouterPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceServiceEdgeRouterPoliciesUnauthorized -*/ -type ListServiceServiceEdgeRouterPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceServiceEdgeRouterPoliciesUnauthorized creates ListServiceServiceEdgeRouterPoliciesUnauthorized with default headers values -func NewListServiceServiceEdgeRouterPoliciesUnauthorized() *ListServiceServiceEdgeRouterPoliciesUnauthorized { - - return &ListServiceServiceEdgeRouterPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list service service edge router policies unauthorized response -func (o *ListServiceServiceEdgeRouterPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceServiceEdgeRouterPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service service edge router policies unauthorized response -func (o *ListServiceServiceEdgeRouterPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceServiceEdgeRouterPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_service_service_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/service/list_service_service_edge_router_policies_urlbuilder.go deleted file mode 100644 index eb979db7e..000000000 --- a/rest_management_api_server/operations/service/list_service_service_edge_router_policies_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceServiceEdgeRouterPoliciesURL generates an URL for the list service service edge router policies operation -type ListServiceServiceEdgeRouterPoliciesURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceServiceEdgeRouterPoliciesURL) WithBasePath(bp string) *ListServiceServiceEdgeRouterPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceServiceEdgeRouterPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceServiceEdgeRouterPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/service-edge-router-policies" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceServiceEdgeRouterPoliciesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceServiceEdgeRouterPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceServiceEdgeRouterPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceServiceEdgeRouterPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceServiceEdgeRouterPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceServiceEdgeRouterPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceServiceEdgeRouterPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_service_service_policies.go b/rest_management_api_server/operations/service/list_service_service_policies.go deleted file mode 100644 index b1e3b4ead..000000000 --- a/rest_management_api_server/operations/service/list_service_service_policies.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceServicePoliciesHandlerFunc turns a function with the right signature into a list service service policies handler -type ListServiceServicePoliciesHandlerFunc func(ListServiceServicePoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceServicePoliciesHandlerFunc) Handle(params ListServiceServicePoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceServicePoliciesHandler interface for that can handle valid list service service policies params -type ListServiceServicePoliciesHandler interface { - Handle(ListServiceServicePoliciesParams, interface{}) middleware.Responder -} - -// NewListServiceServicePolicies creates a new http.Handler for the list service service policies operation -func NewListServiceServicePolicies(ctx *middleware.Context, handler ListServiceServicePoliciesHandler) *ListServiceServicePolicies { - return &ListServiceServicePolicies{Context: ctx, Handler: handler} -} - -/* ListServiceServicePolicies swagger:route GET /services/{id}/service-policies Service listServiceServicePolicies - -List service policies that affect a specific service - -Retrieves a list of service policy resources that affect specific service; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceServicePolicies struct { - Context *middleware.Context - Handler ListServiceServicePoliciesHandler -} - -func (o *ListServiceServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceServicePoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_service_service_policies_parameters.go b/rest_management_api_server/operations/service/list_service_service_policies_parameters.go deleted file mode 100644 index 0e27ebb95..000000000 --- a/rest_management_api_server/operations/service/list_service_service_policies_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceServicePoliciesParams creates a new ListServiceServicePoliciesParams object -// -// There are no default values defined in the spec. -func NewListServiceServicePoliciesParams() ListServiceServicePoliciesParams { - - return ListServiceServicePoliciesParams{} -} - -// ListServiceServicePoliciesParams contains all the bound params for the list service service policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceServicePolicies -type ListServiceServicePoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceServicePoliciesParams() beforehand. -func (o *ListServiceServicePoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceServicePoliciesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceServicePoliciesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceServicePoliciesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceServicePoliciesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service/list_service_service_policies_responses.go b/rest_management_api_server/operations/service/list_service_service_policies_responses.go deleted file mode 100644 index 343fe4a9c..000000000 --- a/rest_management_api_server/operations/service/list_service_service_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceServicePoliciesOKCode is the HTTP code returned for type ListServiceServicePoliciesOK -const ListServiceServicePoliciesOKCode int = 200 - -/*ListServiceServicePoliciesOK A list of service policies - -swagger:response listServiceServicePoliciesOK -*/ -type ListServiceServicePoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicePoliciesEnvelope `json:"body,omitempty"` -} - -// NewListServiceServicePoliciesOK creates ListServiceServicePoliciesOK with default headers values -func NewListServiceServicePoliciesOK() *ListServiceServicePoliciesOK { - - return &ListServiceServicePoliciesOK{} -} - -// WithPayload adds the payload to the list service service policies o k response -func (o *ListServiceServicePoliciesOK) WithPayload(payload *rest_model.ListServicePoliciesEnvelope) *ListServiceServicePoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service service policies o k response -func (o *ListServiceServicePoliciesOK) SetPayload(payload *rest_model.ListServicePoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceServicePoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceServicePoliciesBadRequestCode is the HTTP code returned for type ListServiceServicePoliciesBadRequest -const ListServiceServicePoliciesBadRequestCode int = 400 - -/*ListServiceServicePoliciesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceServicePoliciesBadRequest -*/ -type ListServiceServicePoliciesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceServicePoliciesBadRequest creates ListServiceServicePoliciesBadRequest with default headers values -func NewListServiceServicePoliciesBadRequest() *ListServiceServicePoliciesBadRequest { - - return &ListServiceServicePoliciesBadRequest{} -} - -// WithPayload adds the payload to the list service service policies bad request response -func (o *ListServiceServicePoliciesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceServicePoliciesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service service policies bad request response -func (o *ListServiceServicePoliciesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceServicePoliciesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceServicePoliciesUnauthorizedCode is the HTTP code returned for type ListServiceServicePoliciesUnauthorized -const ListServiceServicePoliciesUnauthorizedCode int = 401 - -/*ListServiceServicePoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceServicePoliciesUnauthorized -*/ -type ListServiceServicePoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceServicePoliciesUnauthorized creates ListServiceServicePoliciesUnauthorized with default headers values -func NewListServiceServicePoliciesUnauthorized() *ListServiceServicePoliciesUnauthorized { - - return &ListServiceServicePoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list service service policies unauthorized response -func (o *ListServiceServicePoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceServicePoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service service policies unauthorized response -func (o *ListServiceServicePoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceServicePoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_service_service_policies_urlbuilder.go b/rest_management_api_server/operations/service/list_service_service_policies_urlbuilder.go deleted file mode 100644 index e6226311c..000000000 --- a/rest_management_api_server/operations/service/list_service_service_policies_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceServicePoliciesURL generates an URL for the list service service policies operation -type ListServiceServicePoliciesURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceServicePoliciesURL) WithBasePath(bp string) *ListServiceServicePoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceServicePoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceServicePoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/service-policies" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceServicePoliciesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceServicePoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceServicePoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceServicePoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceServicePoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceServicePoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceServicePoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_service_terminators.go b/rest_management_api_server/operations/service/list_service_terminators.go deleted file mode 100644 index 8e2915d2b..000000000 --- a/rest_management_api_server/operations/service/list_service_terminators.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceTerminatorsHandlerFunc turns a function with the right signature into a list service terminators handler -type ListServiceTerminatorsHandlerFunc func(ListServiceTerminatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceTerminatorsHandlerFunc) Handle(params ListServiceTerminatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceTerminatorsHandler interface for that can handle valid list service terminators params -type ListServiceTerminatorsHandler interface { - Handle(ListServiceTerminatorsParams, interface{}) middleware.Responder -} - -// NewListServiceTerminators creates a new http.Handler for the list service terminators operation -func NewListServiceTerminators(ctx *middleware.Context, handler ListServiceTerminatorsHandler) *ListServiceTerminators { - return &ListServiceTerminators{Context: ctx, Handler: handler} -} - -/* ListServiceTerminators swagger:route GET /services/{id}/terminators Service listServiceTerminators - -List of terminators assigned to a service - -Retrieves a list of terminator resources that are assigned specific service; supports filtering, sorting, and pagination. - - -*/ -type ListServiceTerminators struct { - Context *middleware.Context - Handler ListServiceTerminatorsHandler -} - -func (o *ListServiceTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceTerminatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_service_terminators_parameters.go b/rest_management_api_server/operations/service/list_service_terminators_parameters.go deleted file mode 100644 index fc0a459fc..000000000 --- a/rest_management_api_server/operations/service/list_service_terminators_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceTerminatorsParams creates a new ListServiceTerminatorsParams object -// -// There are no default values defined in the spec. -func NewListServiceTerminatorsParams() ListServiceTerminatorsParams { - - return ListServiceTerminatorsParams{} -} - -// ListServiceTerminatorsParams contains all the bound params for the list service terminators operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceTerminators -type ListServiceTerminatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceTerminatorsParams() beforehand. -func (o *ListServiceTerminatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceTerminatorsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceTerminatorsParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceTerminatorsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceTerminatorsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service/list_service_terminators_responses.go b/rest_management_api_server/operations/service/list_service_terminators_responses.go deleted file mode 100644 index bb50c21dc..000000000 --- a/rest_management_api_server/operations/service/list_service_terminators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceTerminatorsOKCode is the HTTP code returned for type ListServiceTerminatorsOK -const ListServiceTerminatorsOKCode int = 200 - -/*ListServiceTerminatorsOK A list of terminators - -swagger:response listServiceTerminatorsOK -*/ -type ListServiceTerminatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListTerminatorsEnvelope `json:"body,omitempty"` -} - -// NewListServiceTerminatorsOK creates ListServiceTerminatorsOK with default headers values -func NewListServiceTerminatorsOK() *ListServiceTerminatorsOK { - - return &ListServiceTerminatorsOK{} -} - -// WithPayload adds the payload to the list service terminators o k response -func (o *ListServiceTerminatorsOK) WithPayload(payload *rest_model.ListTerminatorsEnvelope) *ListServiceTerminatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service terminators o k response -func (o *ListServiceTerminatorsOK) SetPayload(payload *rest_model.ListTerminatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceTerminatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceTerminatorsBadRequestCode is the HTTP code returned for type ListServiceTerminatorsBadRequest -const ListServiceTerminatorsBadRequestCode int = 400 - -/*ListServiceTerminatorsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceTerminatorsBadRequest -*/ -type ListServiceTerminatorsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceTerminatorsBadRequest creates ListServiceTerminatorsBadRequest with default headers values -func NewListServiceTerminatorsBadRequest() *ListServiceTerminatorsBadRequest { - - return &ListServiceTerminatorsBadRequest{} -} - -// WithPayload adds the payload to the list service terminators bad request response -func (o *ListServiceTerminatorsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceTerminatorsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service terminators bad request response -func (o *ListServiceTerminatorsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceTerminatorsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceTerminatorsUnauthorizedCode is the HTTP code returned for type ListServiceTerminatorsUnauthorized -const ListServiceTerminatorsUnauthorizedCode int = 401 - -/*ListServiceTerminatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceTerminatorsUnauthorized -*/ -type ListServiceTerminatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceTerminatorsUnauthorized creates ListServiceTerminatorsUnauthorized with default headers values -func NewListServiceTerminatorsUnauthorized() *ListServiceTerminatorsUnauthorized { - - return &ListServiceTerminatorsUnauthorized{} -} - -// WithPayload adds the payload to the list service terminators unauthorized response -func (o *ListServiceTerminatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceTerminatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service terminators unauthorized response -func (o *ListServiceTerminatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceTerminatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_service_terminators_urlbuilder.go b/rest_management_api_server/operations/service/list_service_terminators_urlbuilder.go deleted file mode 100644 index 65b47be04..000000000 --- a/rest_management_api_server/operations/service/list_service_terminators_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServiceTerminatorsURL generates an URL for the list service terminators operation -type ListServiceTerminatorsURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceTerminatorsURL) WithBasePath(bp string) *ListServiceTerminatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceTerminatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceTerminatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}/terminators" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceTerminatorsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceTerminatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceTerminatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceTerminatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceTerminatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceTerminatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceTerminatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/list_services.go b/rest_management_api_server/operations/service/list_services.go deleted file mode 100644 index bda7c15c0..000000000 --- a/rest_management_api_server/operations/service/list_services.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServicesHandlerFunc turns a function with the right signature into a list services handler -type ListServicesHandlerFunc func(ListServicesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServicesHandlerFunc) Handle(params ListServicesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServicesHandler interface for that can handle valid list services params -type ListServicesHandler interface { - Handle(ListServicesParams, interface{}) middleware.Responder -} - -// NewListServices creates a new http.Handler for the list services operation -func NewListServices(ctx *middleware.Context, handler ListServicesHandler) *ListServices { - return &ListServices{Context: ctx, Handler: handler} -} - -/* ListServices swagger:route GET /services Service listServices - -List services - -Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServices struct { - Context *middleware.Context - Handler ListServicesHandler -} - -func (o *ListServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServicesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/list_services_parameters.go b/rest_management_api_server/operations/service/list_services_parameters.go deleted file mode 100644 index 764ba0615..000000000 --- a/rest_management_api_server/operations/service/list_services_parameters.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicesParams creates a new ListServicesParams object -// -// There are no default values defined in the spec. -func NewListServicesParams() ListServicesParams { - - return ListServicesParams{} -} - -// ListServicesParams contains all the bound params for the list services operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServices -type ListServicesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 - /* - In: query - Collection Format: multi - */ - RoleFilter []string - /* - In: query - */ - RoleSemantic *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServicesParams() beforehand. -func (o *ListServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - - qRoleFilter, qhkRoleFilter, _ := qs.GetOK("roleFilter") - if err := o.bindRoleFilter(qRoleFilter, qhkRoleFilter, route.Formats); err != nil { - res = append(res, err) - } - - qRoleSemantic, qhkRoleSemantic, _ := qs.GetOK("roleSemantic") - if err := o.bindRoleSemantic(qRoleSemantic, qhkRoleSemantic, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServicesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServicesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServicesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} - -// bindRoleFilter binds and validates array parameter RoleFilter from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *ListServicesParams) bindRoleFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - roleFilterIC := rawData - if len(roleFilterIC) == 0 { - return nil - } - - var roleFilterIR []string - for _, roleFilterIV := range roleFilterIC { - roleFilterI := roleFilterIV - - roleFilterIR = append(roleFilterIR, roleFilterI) - } - - o.RoleFilter = roleFilterIR - - return nil -} - -// bindRoleSemantic binds and validates parameter RoleSemantic from query. -func (o *ListServicesParams) bindRoleSemantic(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RoleSemantic = &raw - - return nil -} diff --git a/rest_management_api_server/operations/service/list_services_responses.go b/rest_management_api_server/operations/service/list_services_responses.go deleted file mode 100644 index 60198800e..000000000 --- a/rest_management_api_server/operations/service/list_services_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServicesOKCode is the HTTP code returned for type ListServicesOK -const ListServicesOKCode int = 200 - -/*ListServicesOK A list of services - -swagger:response listServicesOK -*/ -type ListServicesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicesEnvelope `json:"body,omitempty"` -} - -// NewListServicesOK creates ListServicesOK with default headers values -func NewListServicesOK() *ListServicesOK { - - return &ListServicesOK{} -} - -// WithPayload adds the payload to the list services o k response -func (o *ListServicesOK) WithPayload(payload *rest_model.ListServicesEnvelope) *ListServicesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list services o k response -func (o *ListServicesOK) SetPayload(payload *rest_model.ListServicesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicesBadRequestCode is the HTTP code returned for type ListServicesBadRequest -const ListServicesBadRequestCode int = 400 - -/*ListServicesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServicesBadRequest -*/ -type ListServicesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicesBadRequest creates ListServicesBadRequest with default headers values -func NewListServicesBadRequest() *ListServicesBadRequest { - - return &ListServicesBadRequest{} -} - -// WithPayload adds the payload to the list services bad request response -func (o *ListServicesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list services bad request response -func (o *ListServicesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicesUnauthorizedCode is the HTTP code returned for type ListServicesUnauthorized -const ListServicesUnauthorizedCode int = 401 - -/*ListServicesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServicesUnauthorized -*/ -type ListServicesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicesUnauthorized creates ListServicesUnauthorized with default headers values -func NewListServicesUnauthorized() *ListServicesUnauthorized { - - return &ListServicesUnauthorized{} -} - -// WithPayload adds the payload to the list services unauthorized response -func (o *ListServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list services unauthorized response -func (o *ListServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/list_services_urlbuilder.go b/rest_management_api_server/operations/service/list_services_urlbuilder.go deleted file mode 100644 index 8d8569cde..000000000 --- a/rest_management_api_server/operations/service/list_services_urlbuilder.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListServicesURL generates an URL for the list services operation -type ListServicesURL struct { - Filter *string - Limit *int64 - Offset *int64 - RoleFilter []string - RoleSemantic *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicesURL) WithBasePath(bp string) *ListServicesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServicesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - var roleFilterIR []string - for _, roleFilterI := range o.RoleFilter { - roleFilterIS := roleFilterI - if roleFilterIS != "" { - roleFilterIR = append(roleFilterIR, roleFilterIS) - } - } - - roleFilter := swag.JoinByFormat(roleFilterIR, "multi") - - for _, qsv := range roleFilter { - qs.Add("roleFilter", qsv) - } - - var roleSemanticQ string - if o.RoleSemantic != nil { - roleSemanticQ = *o.RoleSemantic - } - if roleSemanticQ != "" { - qs.Set("roleSemantic", roleSemanticQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServicesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServicesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServicesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServicesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServicesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServicesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/patch_service.go b/rest_management_api_server/operations/service/patch_service.go deleted file mode 100644 index 688c0549a..000000000 --- a/rest_management_api_server/operations/service/patch_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchServiceHandlerFunc turns a function with the right signature into a patch service handler -type PatchServiceHandlerFunc func(PatchServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchServiceHandlerFunc) Handle(params PatchServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchServiceHandler interface for that can handle valid patch service params -type PatchServiceHandler interface { - Handle(PatchServiceParams, interface{}) middleware.Responder -} - -// NewPatchService creates a new http.Handler for the patch service operation -func NewPatchService(ctx *middleware.Context, handler PatchServiceHandler) *PatchService { - return &PatchService{Context: ctx, Handler: handler} -} - -/* PatchService swagger:route PATCH /services/{id} Service patchService - -Update the supplied fields on a service - -Update the supplied fields on a service. Requires admin access. - -*/ -type PatchService struct { - Context *middleware.Context - Handler PatchServiceHandler -} - -func (o *PatchService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/patch_service_parameters.go b/rest_management_api_server/operations/service/patch_service_parameters.go deleted file mode 100644 index a740fcee3..000000000 --- a/rest_management_api_server/operations/service/patch_service_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServiceParams creates a new PatchServiceParams object -// -// There are no default values defined in the spec. -func NewPatchServiceParams() PatchServiceParams { - - return PatchServiceParams{} -} - -// PatchServiceParams contains all the bound params for the patch service operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchService -type PatchServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service patch object - Required: true - In: body - */ - Service *rest_model.ServicePatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchServiceParams() beforehand. -func (o *PatchServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServicePatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("service", "body", "")) - } else { - res = append(res, errors.NewParseError("service", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Service = &body - } - } - } else { - res = append(res, errors.Required("service", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service/patch_service_responses.go b/rest_management_api_server/operations/service/patch_service_responses.go deleted file mode 100644 index 3af129fb0..000000000 --- a/rest_management_api_server/operations/service/patch_service_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchServiceOKCode is the HTTP code returned for type PatchServiceOK -const PatchServiceOKCode int = 200 - -/*PatchServiceOK The patch request was successful and the resource has been altered - -swagger:response patchServiceOK -*/ -type PatchServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchServiceOK creates PatchServiceOK with default headers values -func NewPatchServiceOK() *PatchServiceOK { - - return &PatchServiceOK{} -} - -// WithPayload adds the payload to the patch service o k response -func (o *PatchServiceOK) WithPayload(payload *rest_model.Empty) *PatchServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service o k response -func (o *PatchServiceOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceBadRequestCode is the HTTP code returned for type PatchServiceBadRequest -const PatchServiceBadRequestCode int = 400 - -/*PatchServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchServiceBadRequest -*/ -type PatchServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceBadRequest creates PatchServiceBadRequest with default headers values -func NewPatchServiceBadRequest() *PatchServiceBadRequest { - - return &PatchServiceBadRequest{} -} - -// WithPayload adds the payload to the patch service bad request response -func (o *PatchServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service bad request response -func (o *PatchServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceUnauthorizedCode is the HTTP code returned for type PatchServiceUnauthorized -const PatchServiceUnauthorizedCode int = 401 - -/*PatchServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchServiceUnauthorized -*/ -type PatchServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceUnauthorized creates PatchServiceUnauthorized with default headers values -func NewPatchServiceUnauthorized() *PatchServiceUnauthorized { - - return &PatchServiceUnauthorized{} -} - -// WithPayload adds the payload to the patch service unauthorized response -func (o *PatchServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service unauthorized response -func (o *PatchServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceNotFoundCode is the HTTP code returned for type PatchServiceNotFound -const PatchServiceNotFoundCode int = 404 - -/*PatchServiceNotFound The requested resource does not exist - -swagger:response patchServiceNotFound -*/ -type PatchServiceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceNotFound creates PatchServiceNotFound with default headers values -func NewPatchServiceNotFound() *PatchServiceNotFound { - - return &PatchServiceNotFound{} -} - -// WithPayload adds the payload to the patch service not found response -func (o *PatchServiceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service not found response -func (o *PatchServiceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/patch_service_urlbuilder.go b/rest_management_api_server/operations/service/patch_service_urlbuilder.go deleted file mode 100644 index 8529fbfc2..000000000 --- a/rest_management_api_server/operations/service/patch_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchServiceURL generates an URL for the patch service operation -type PatchServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceURL) WithBasePath(bp string) *PatchServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service/update_service.go b/rest_management_api_server/operations/service/update_service.go deleted file mode 100644 index 47798263b..000000000 --- a/rest_management_api_server/operations/service/update_service.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateServiceHandlerFunc turns a function with the right signature into a update service handler -type UpdateServiceHandlerFunc func(UpdateServiceParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateServiceHandlerFunc) Handle(params UpdateServiceParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateServiceHandler interface for that can handle valid update service params -type UpdateServiceHandler interface { - Handle(UpdateServiceParams, interface{}) middleware.Responder -} - -// NewUpdateService creates a new http.Handler for the update service operation -func NewUpdateService(ctx *middleware.Context, handler UpdateServiceHandler) *UpdateService { - return &UpdateService{Context: ctx, Handler: handler} -} - -/* UpdateService swagger:route PUT /services/{id} Service updateService - -Update all fields on a service - -Update all fields on a service by id. Requires admin access. - -*/ -type UpdateService struct { - Context *middleware.Context - Handler UpdateServiceHandler -} - -func (o *UpdateService) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateServiceParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service/update_service_parameters.go b/rest_management_api_server/operations/service/update_service_parameters.go deleted file mode 100644 index 586d36082..000000000 --- a/rest_management_api_server/operations/service/update_service_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServiceParams creates a new UpdateServiceParams object -// -// There are no default values defined in the spec. -func NewUpdateServiceParams() UpdateServiceParams { - - return UpdateServiceParams{} -} - -// UpdateServiceParams contains all the bound params for the update service operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateService -type UpdateServiceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service update object - Required: true - In: body - */ - Service *rest_model.ServiceUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateServiceParams() beforehand. -func (o *UpdateServiceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("service", "body", "")) - } else { - res = append(res, errors.NewParseError("service", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Service = &body - } - } - } else { - res = append(res, errors.Required("service", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateServiceParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service/update_service_responses.go b/rest_management_api_server/operations/service/update_service_responses.go deleted file mode 100644 index ae8d559c8..000000000 --- a/rest_management_api_server/operations/service/update_service_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServiceOKCode is the HTTP code returned for type UpdateServiceOK -const UpdateServiceOKCode int = 200 - -/*UpdateServiceOK The update request was successful and the resource has been altered - -swagger:response updateServiceOK -*/ -type UpdateServiceOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateServiceOK creates UpdateServiceOK with default headers values -func NewUpdateServiceOK() *UpdateServiceOK { - - return &UpdateServiceOK{} -} - -// WithPayload adds the payload to the update service o k response -func (o *UpdateServiceOK) WithPayload(payload *rest_model.Empty) *UpdateServiceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service o k response -func (o *UpdateServiceOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceBadRequestCode is the HTTP code returned for type UpdateServiceBadRequest -const UpdateServiceBadRequestCode int = 400 - -/*UpdateServiceBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateServiceBadRequest -*/ -type UpdateServiceBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceBadRequest creates UpdateServiceBadRequest with default headers values -func NewUpdateServiceBadRequest() *UpdateServiceBadRequest { - - return &UpdateServiceBadRequest{} -} - -// WithPayload adds the payload to the update service bad request response -func (o *UpdateServiceBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service bad request response -func (o *UpdateServiceBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceUnauthorizedCode is the HTTP code returned for type UpdateServiceUnauthorized -const UpdateServiceUnauthorizedCode int = 401 - -/*UpdateServiceUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateServiceUnauthorized -*/ -type UpdateServiceUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceUnauthorized creates UpdateServiceUnauthorized with default headers values -func NewUpdateServiceUnauthorized() *UpdateServiceUnauthorized { - - return &UpdateServiceUnauthorized{} -} - -// WithPayload adds the payload to the update service unauthorized response -func (o *UpdateServiceUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service unauthorized response -func (o *UpdateServiceUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceNotFoundCode is the HTTP code returned for type UpdateServiceNotFound -const UpdateServiceNotFoundCode int = 404 - -/*UpdateServiceNotFound The requested resource does not exist - -swagger:response updateServiceNotFound -*/ -type UpdateServiceNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceNotFound creates UpdateServiceNotFound with default headers values -func NewUpdateServiceNotFound() *UpdateServiceNotFound { - - return &UpdateServiceNotFound{} -} - -// WithPayload adds the payload to the update service not found response -func (o *UpdateServiceNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service not found response -func (o *UpdateServiceNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service/update_service_urlbuilder.go b/rest_management_api_server/operations/service/update_service_urlbuilder.go deleted file mode 100644 index 07b1cd4c1..000000000 --- a/rest_management_api_server/operations/service/update_service_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateServiceURL generates an URL for the update service operation -type UpdateServiceURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceURL) WithBasePath(bp string) *UpdateServiceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateServiceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/services/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateServiceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateServiceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateServiceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateServiceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateServiceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateServiceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateServiceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy.go b/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy.go deleted file mode 100644 index a31dc0879..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateServiceEdgeRouterPolicyHandlerFunc turns a function with the right signature into a create service edge router policy handler -type CreateServiceEdgeRouterPolicyHandlerFunc func(CreateServiceEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateServiceEdgeRouterPolicyHandlerFunc) Handle(params CreateServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateServiceEdgeRouterPolicyHandler interface for that can handle valid create service edge router policy params -type CreateServiceEdgeRouterPolicyHandler interface { - Handle(CreateServiceEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewCreateServiceEdgeRouterPolicy creates a new http.Handler for the create service edge router policy operation -func NewCreateServiceEdgeRouterPolicy(ctx *middleware.Context, handler CreateServiceEdgeRouterPolicyHandler) *CreateServiceEdgeRouterPolicy { - return &CreateServiceEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* CreateServiceEdgeRouterPolicy swagger:route POST /service-edge-router-policies Service Edge Router Policy createServiceEdgeRouterPolicy - -Create a service edge router policy resource - -Create a service edge router policy resource. Requires admin access. - -*/ -type CreateServiceEdgeRouterPolicy struct { - Context *middleware.Context - Handler CreateServiceEdgeRouterPolicyHandler -} - -func (o *CreateServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateServiceEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_parameters.go deleted file mode 100644 index 0875c32c1..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateServiceEdgeRouterPolicyParams creates a new CreateServiceEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewCreateServiceEdgeRouterPolicyParams() CreateServiceEdgeRouterPolicyParams { - - return CreateServiceEdgeRouterPolicyParams{} -} - -// CreateServiceEdgeRouterPolicyParams contains all the bound params for the create service edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters createServiceEdgeRouterPolicy -type CreateServiceEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A service edge router policy to create - Required: true - In: body - */ - Policy *rest_model.ServiceEdgeRouterPolicyCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateServiceEdgeRouterPolicyParams() beforehand. -func (o *CreateServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceEdgeRouterPolicyCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_responses.go b/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_responses.go deleted file mode 100644 index 14c02f2cd..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateServiceEdgeRouterPolicyCreatedCode is the HTTP code returned for type CreateServiceEdgeRouterPolicyCreated -const CreateServiceEdgeRouterPolicyCreatedCode int = 201 - -/*CreateServiceEdgeRouterPolicyCreated The create request was successful and the resource has been added at the following location - -swagger:response createServiceEdgeRouterPolicyCreated -*/ -type CreateServiceEdgeRouterPolicyCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateServiceEdgeRouterPolicyCreated creates CreateServiceEdgeRouterPolicyCreated with default headers values -func NewCreateServiceEdgeRouterPolicyCreated() *CreateServiceEdgeRouterPolicyCreated { - - return &CreateServiceEdgeRouterPolicyCreated{} -} - -// WithPayload adds the payload to the create service edge router policy created response -func (o *CreateServiceEdgeRouterPolicyCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateServiceEdgeRouterPolicyCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service edge router policy created response -func (o *CreateServiceEdgeRouterPolicyCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceEdgeRouterPolicyCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceEdgeRouterPolicyBadRequestCode is the HTTP code returned for type CreateServiceEdgeRouterPolicyBadRequest -const CreateServiceEdgeRouterPolicyBadRequestCode int = 400 - -/*CreateServiceEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createServiceEdgeRouterPolicyBadRequest -*/ -type CreateServiceEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateServiceEdgeRouterPolicyBadRequest creates CreateServiceEdgeRouterPolicyBadRequest with default headers values -func NewCreateServiceEdgeRouterPolicyBadRequest() *CreateServiceEdgeRouterPolicyBadRequest { - - return &CreateServiceEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the create service edge router policy bad request response -func (o *CreateServiceEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateServiceEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service edge router policy bad request response -func (o *CreateServiceEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type CreateServiceEdgeRouterPolicyUnauthorized -const CreateServiceEdgeRouterPolicyUnauthorizedCode int = 401 - -/*CreateServiceEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createServiceEdgeRouterPolicyUnauthorized -*/ -type CreateServiceEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateServiceEdgeRouterPolicyUnauthorized creates CreateServiceEdgeRouterPolicyUnauthorized with default headers values -func NewCreateServiceEdgeRouterPolicyUnauthorized() *CreateServiceEdgeRouterPolicyUnauthorized { - - return &CreateServiceEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the create service edge router policy unauthorized response -func (o *CreateServiceEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateServiceEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service edge router policy unauthorized response -func (o *CreateServiceEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_urlbuilder.go deleted file mode 100644 index 08ce1ce9d..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/create_service_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateServiceEdgeRouterPolicyURL generates an URL for the create service edge router policy operation -type CreateServiceEdgeRouterPolicyURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceEdgeRouterPolicyURL) WithBasePath(bp string) *CreateServiceEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateServiceEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateServiceEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateServiceEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateServiceEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateServiceEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateServiceEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy.go b/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy.go deleted file mode 100644 index ceed1371f..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteServiceEdgeRouterPolicyHandlerFunc turns a function with the right signature into a delete service edge router policy handler -type DeleteServiceEdgeRouterPolicyHandlerFunc func(DeleteServiceEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteServiceEdgeRouterPolicyHandlerFunc) Handle(params DeleteServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteServiceEdgeRouterPolicyHandler interface for that can handle valid delete service edge router policy params -type DeleteServiceEdgeRouterPolicyHandler interface { - Handle(DeleteServiceEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewDeleteServiceEdgeRouterPolicy creates a new http.Handler for the delete service edge router policy operation -func NewDeleteServiceEdgeRouterPolicy(ctx *middleware.Context, handler DeleteServiceEdgeRouterPolicyHandler) *DeleteServiceEdgeRouterPolicy { - return &DeleteServiceEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* DeleteServiceEdgeRouterPolicy swagger:route DELETE /service-edge-router-policies/{id} Service Edge Router Policy deleteServiceEdgeRouterPolicy - -Delete a service edge policy - -Delete a service edge policy by id. Requires admin access. - -*/ -type DeleteServiceEdgeRouterPolicy struct { - Context *middleware.Context - Handler DeleteServiceEdgeRouterPolicyHandler -} - -func (o *DeleteServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteServiceEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_parameters.go deleted file mode 100644 index b2bac4f92..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServiceEdgeRouterPolicyParams creates a new DeleteServiceEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewDeleteServiceEdgeRouterPolicyParams() DeleteServiceEdgeRouterPolicyParams { - - return DeleteServiceEdgeRouterPolicyParams{} -} - -// DeleteServiceEdgeRouterPolicyParams contains all the bound params for the delete service edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteServiceEdgeRouterPolicy -type DeleteServiceEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteServiceEdgeRouterPolicyParams() beforehand. -func (o *DeleteServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_responses.go b/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_responses.go deleted file mode 100644 index c9c01b225..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServiceEdgeRouterPolicyOKCode is the HTTP code returned for type DeleteServiceEdgeRouterPolicyOK -const DeleteServiceEdgeRouterPolicyOKCode int = 200 - -/*DeleteServiceEdgeRouterPolicyOK The delete request was successful and the resource has been removed - -swagger:response deleteServiceEdgeRouterPolicyOK -*/ -type DeleteServiceEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteServiceEdgeRouterPolicyOK creates DeleteServiceEdgeRouterPolicyOK with default headers values -func NewDeleteServiceEdgeRouterPolicyOK() *DeleteServiceEdgeRouterPolicyOK { - - return &DeleteServiceEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the delete service edge router policy o k response -func (o *DeleteServiceEdgeRouterPolicyOK) WithPayload(payload *rest_model.Empty) *DeleteServiceEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service edge router policy o k response -func (o *DeleteServiceEdgeRouterPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceEdgeRouterPolicyBadRequestCode is the HTTP code returned for type DeleteServiceEdgeRouterPolicyBadRequest -const DeleteServiceEdgeRouterPolicyBadRequestCode int = 400 - -/*DeleteServiceEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteServiceEdgeRouterPolicyBadRequest -*/ -type DeleteServiceEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceEdgeRouterPolicyBadRequest creates DeleteServiceEdgeRouterPolicyBadRequest with default headers values -func NewDeleteServiceEdgeRouterPolicyBadRequest() *DeleteServiceEdgeRouterPolicyBadRequest { - - return &DeleteServiceEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the delete service edge router policy bad request response -func (o *DeleteServiceEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service edge router policy bad request response -func (o *DeleteServiceEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type DeleteServiceEdgeRouterPolicyUnauthorized -const DeleteServiceEdgeRouterPolicyUnauthorizedCode int = 401 - -/*DeleteServiceEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteServiceEdgeRouterPolicyUnauthorized -*/ -type DeleteServiceEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceEdgeRouterPolicyUnauthorized creates DeleteServiceEdgeRouterPolicyUnauthorized with default headers values -func NewDeleteServiceEdgeRouterPolicyUnauthorized() *DeleteServiceEdgeRouterPolicyUnauthorized { - - return &DeleteServiceEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the delete service edge router policy unauthorized response -func (o *DeleteServiceEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service edge router policy unauthorized response -func (o *DeleteServiceEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServiceEdgeRouterPolicyConflictCode is the HTTP code returned for type DeleteServiceEdgeRouterPolicyConflict -const DeleteServiceEdgeRouterPolicyConflictCode int = 409 - -/*DeleteServiceEdgeRouterPolicyConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteServiceEdgeRouterPolicyConflict -*/ -type DeleteServiceEdgeRouterPolicyConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServiceEdgeRouterPolicyConflict creates DeleteServiceEdgeRouterPolicyConflict with default headers values -func NewDeleteServiceEdgeRouterPolicyConflict() *DeleteServiceEdgeRouterPolicyConflict { - - return &DeleteServiceEdgeRouterPolicyConflict{} -} - -// WithPayload adds the payload to the delete service edge router policy conflict response -func (o *DeleteServiceEdgeRouterPolicyConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServiceEdgeRouterPolicyConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service edge router policy conflict response -func (o *DeleteServiceEdgeRouterPolicyConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServiceEdgeRouterPolicyConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_urlbuilder.go deleted file mode 100644 index 72d15a04c..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/delete_service_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteServiceEdgeRouterPolicyURL generates an URL for the delete service edge router policy operation -type DeleteServiceEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServiceEdgeRouterPolicyURL) WithBasePath(bp string) *DeleteServiceEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServiceEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteServiceEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteServiceEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteServiceEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteServiceEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteServiceEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteServiceEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteServiceEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy.go b/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy.go deleted file mode 100644 index ad8262096..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailServiceEdgeRouterPolicyHandlerFunc turns a function with the right signature into a detail service edge router policy handler -type DetailServiceEdgeRouterPolicyHandlerFunc func(DetailServiceEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailServiceEdgeRouterPolicyHandlerFunc) Handle(params DetailServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailServiceEdgeRouterPolicyHandler interface for that can handle valid detail service edge router policy params -type DetailServiceEdgeRouterPolicyHandler interface { - Handle(DetailServiceEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewDetailServiceEdgeRouterPolicy creates a new http.Handler for the detail service edge router policy operation -func NewDetailServiceEdgeRouterPolicy(ctx *middleware.Context, handler DetailServiceEdgeRouterPolicyHandler) *DetailServiceEdgeRouterPolicy { - return &DetailServiceEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* DetailServiceEdgeRouterPolicy swagger:route GET /service-edge-router-policies/{id} Service Edge Router Policy detailServiceEdgeRouterPolicy - -Retrieves a single service edge policy - -Retrieves a single service edge policy by id. Requires admin access. - -*/ -type DetailServiceEdgeRouterPolicy struct { - Context *middleware.Context - Handler DetailServiceEdgeRouterPolicyHandler -} - -func (o *DetailServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailServiceEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_parameters.go deleted file mode 100644 index 9624940f5..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailServiceEdgeRouterPolicyParams creates a new DetailServiceEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewDetailServiceEdgeRouterPolicyParams() DetailServiceEdgeRouterPolicyParams { - - return DetailServiceEdgeRouterPolicyParams{} -} - -// DetailServiceEdgeRouterPolicyParams contains all the bound params for the detail service edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailServiceEdgeRouterPolicy -type DetailServiceEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailServiceEdgeRouterPolicyParams() beforehand. -func (o *DetailServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_responses.go b/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_responses.go deleted file mode 100644 index d58bcee17..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailServiceEdgeRouterPolicyOKCode is the HTTP code returned for type DetailServiceEdgeRouterPolicyOK -const DetailServiceEdgeRouterPolicyOKCode int = 200 - -/*DetailServiceEdgeRouterPolicyOK A single service edge router policy - -swagger:response detailServiceEdgeRouterPolicyOK -*/ -type DetailServiceEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailServiceEdgePolicyEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceEdgeRouterPolicyOK creates DetailServiceEdgeRouterPolicyOK with default headers values -func NewDetailServiceEdgeRouterPolicyOK() *DetailServiceEdgeRouterPolicyOK { - - return &DetailServiceEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the detail service edge router policy o k response -func (o *DetailServiceEdgeRouterPolicyOK) WithPayload(payload *rest_model.DetailServiceEdgePolicyEnvelope) *DetailServiceEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service edge router policy o k response -func (o *DetailServiceEdgeRouterPolicyOK) SetPayload(payload *rest_model.DetailServiceEdgePolicyEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServiceEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type DetailServiceEdgeRouterPolicyUnauthorized -const DetailServiceEdgeRouterPolicyUnauthorizedCode int = 401 - -/*DetailServiceEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailServiceEdgeRouterPolicyUnauthorized -*/ -type DetailServiceEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceEdgeRouterPolicyUnauthorized creates DetailServiceEdgeRouterPolicyUnauthorized with default headers values -func NewDetailServiceEdgeRouterPolicyUnauthorized() *DetailServiceEdgeRouterPolicyUnauthorized { - - return &DetailServiceEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the detail service edge router policy unauthorized response -func (o *DetailServiceEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServiceEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service edge router policy unauthorized response -func (o *DetailServiceEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServiceEdgeRouterPolicyNotFoundCode is the HTTP code returned for type DetailServiceEdgeRouterPolicyNotFound -const DetailServiceEdgeRouterPolicyNotFoundCode int = 404 - -/*DetailServiceEdgeRouterPolicyNotFound The requested resource does not exist - -swagger:response detailServiceEdgeRouterPolicyNotFound -*/ -type DetailServiceEdgeRouterPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServiceEdgeRouterPolicyNotFound creates DetailServiceEdgeRouterPolicyNotFound with default headers values -func NewDetailServiceEdgeRouterPolicyNotFound() *DetailServiceEdgeRouterPolicyNotFound { - - return &DetailServiceEdgeRouterPolicyNotFound{} -} - -// WithPayload adds the payload to the detail service edge router policy not found response -func (o *DetailServiceEdgeRouterPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServiceEdgeRouterPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service edge router policy not found response -func (o *DetailServiceEdgeRouterPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServiceEdgeRouterPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_urlbuilder.go deleted file mode 100644 index f24ec02c1..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/detail_service_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailServiceEdgeRouterPolicyURL generates an URL for the detail service edge router policy operation -type DetailServiceEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServiceEdgeRouterPolicyURL) WithBasePath(bp string) *DetailServiceEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServiceEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailServiceEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailServiceEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailServiceEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailServiceEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailServiceEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailServiceEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailServiceEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies.go deleted file mode 100644 index a35ca965c..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceEdgeRouterPoliciesHandlerFunc turns a function with the right signature into a list service edge router policies handler -type ListServiceEdgeRouterPoliciesHandlerFunc func(ListServiceEdgeRouterPoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceEdgeRouterPoliciesHandlerFunc) Handle(params ListServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceEdgeRouterPoliciesHandler interface for that can handle valid list service edge router policies params -type ListServiceEdgeRouterPoliciesHandler interface { - Handle(ListServiceEdgeRouterPoliciesParams, interface{}) middleware.Responder -} - -// NewListServiceEdgeRouterPolicies creates a new http.Handler for the list service edge router policies operation -func NewListServiceEdgeRouterPolicies(ctx *middleware.Context, handler ListServiceEdgeRouterPoliciesHandler) *ListServiceEdgeRouterPolicies { - return &ListServiceEdgeRouterPolicies{Context: ctx, Handler: handler} -} - -/* ListServiceEdgeRouterPolicies swagger:route GET /service-edge-router-policies Service Edge Router Policy listServiceEdgeRouterPolicies - -List service edge router policies - -Retrieves a list of service edge router policy resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServiceEdgeRouterPolicies struct { - Context *middleware.Context - Handler ListServiceEdgeRouterPoliciesHandler -} - -func (o *ListServiceEdgeRouterPolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceEdgeRouterPoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_parameters.go deleted file mode 100644 index 82d528f44..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServiceEdgeRouterPoliciesParams creates a new ListServiceEdgeRouterPoliciesParams object -// -// There are no default values defined in the spec. -func NewListServiceEdgeRouterPoliciesParams() ListServiceEdgeRouterPoliciesParams { - - return ListServiceEdgeRouterPoliciesParams{} -} - -// ListServiceEdgeRouterPoliciesParams contains all the bound params for the list service edge router policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceEdgeRouterPolicies -type ListServiceEdgeRouterPoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceEdgeRouterPoliciesParams() beforehand. -func (o *ListServiceEdgeRouterPoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServiceEdgeRouterPoliciesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServiceEdgeRouterPoliciesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServiceEdgeRouterPoliciesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_responses.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_responses.go deleted file mode 100644 index f9924547e..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRouterPoliciesOKCode is the HTTP code returned for type ListServiceEdgeRouterPoliciesOK -const ListServiceEdgeRouterPoliciesOKCode int = 200 - -/*ListServiceEdgeRouterPoliciesOK A list of service edge router policies - -swagger:response listServiceEdgeRouterPoliciesOK -*/ -type ListServiceEdgeRouterPoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPoliciesOK creates ListServiceEdgeRouterPoliciesOK with default headers values -func NewListServiceEdgeRouterPoliciesOK() *ListServiceEdgeRouterPoliciesOK { - - return &ListServiceEdgeRouterPoliciesOK{} -} - -// WithPayload adds the payload to the list service edge router policies o k response -func (o *ListServiceEdgeRouterPoliciesOK) WithPayload(payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope) *ListServiceEdgeRouterPoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policies o k response -func (o *ListServiceEdgeRouterPoliciesOK) SetPayload(payload *rest_model.ListServiceEdgeRouterPoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRouterPoliciesBadRequestCode is the HTTP code returned for type ListServiceEdgeRouterPoliciesBadRequest -const ListServiceEdgeRouterPoliciesBadRequestCode int = 400 - -/*ListServiceEdgeRouterPoliciesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServiceEdgeRouterPoliciesBadRequest -*/ -type ListServiceEdgeRouterPoliciesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPoliciesBadRequest creates ListServiceEdgeRouterPoliciesBadRequest with default headers values -func NewListServiceEdgeRouterPoliciesBadRequest() *ListServiceEdgeRouterPoliciesBadRequest { - - return &ListServiceEdgeRouterPoliciesBadRequest{} -} - -// WithPayload adds the payload to the list service edge router policies bad request response -func (o *ListServiceEdgeRouterPoliciesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRouterPoliciesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policies bad request response -func (o *ListServiceEdgeRouterPoliciesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPoliciesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRouterPoliciesUnauthorizedCode is the HTTP code returned for type ListServiceEdgeRouterPoliciesUnauthorized -const ListServiceEdgeRouterPoliciesUnauthorizedCode int = 401 - -/*ListServiceEdgeRouterPoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceEdgeRouterPoliciesUnauthorized -*/ -type ListServiceEdgeRouterPoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPoliciesUnauthorized creates ListServiceEdgeRouterPoliciesUnauthorized with default headers values -func NewListServiceEdgeRouterPoliciesUnauthorized() *ListServiceEdgeRouterPoliciesUnauthorized { - - return &ListServiceEdgeRouterPoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list service edge router policies unauthorized response -func (o *ListServiceEdgeRouterPoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRouterPoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policies unauthorized response -func (o *ListServiceEdgeRouterPoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_urlbuilder.go deleted file mode 100644 index d782ca809..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policies_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListServiceEdgeRouterPoliciesURL generates an URL for the list service edge router policies operation -type ListServiceEdgeRouterPoliciesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRouterPoliciesURL) WithBasePath(bp string) *ListServiceEdgeRouterPoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRouterPoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceEdgeRouterPoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceEdgeRouterPoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceEdgeRouterPoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceEdgeRouterPoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceEdgeRouterPoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceEdgeRouterPoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceEdgeRouterPoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers.go deleted file mode 100644 index 1a178149a..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc turns a function with the right signature into a list service edge router policy edge routers handler -type ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc func(ListServiceEdgeRouterPolicyEdgeRoutersParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc) Handle(params ListServiceEdgeRouterPolicyEdgeRoutersParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceEdgeRouterPolicyEdgeRoutersHandler interface for that can handle valid list service edge router policy edge routers params -type ListServiceEdgeRouterPolicyEdgeRoutersHandler interface { - Handle(ListServiceEdgeRouterPolicyEdgeRoutersParams, interface{}) middleware.Responder -} - -// NewListServiceEdgeRouterPolicyEdgeRouters creates a new http.Handler for the list service edge router policy edge routers operation -func NewListServiceEdgeRouterPolicyEdgeRouters(ctx *middleware.Context, handler ListServiceEdgeRouterPolicyEdgeRoutersHandler) *ListServiceEdgeRouterPolicyEdgeRouters { - return &ListServiceEdgeRouterPolicyEdgeRouters{Context: ctx, Handler: handler} -} - -/* ListServiceEdgeRouterPolicyEdgeRouters swagger:route GET /service-edge-router-policies/{id}/edge-routers Service Edge Router Policy listServiceEdgeRouterPolicyEdgeRouters - -List the edge routers that a service edge router policy applies to - -List the edge routers that a service edge router policy applies to - -*/ -type ListServiceEdgeRouterPolicyEdgeRouters struct { - Context *middleware.Context - Handler ListServiceEdgeRouterPolicyEdgeRoutersHandler -} - -func (o *ListServiceEdgeRouterPolicyEdgeRouters) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceEdgeRouterPolicyEdgeRoutersParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go deleted file mode 100644 index 43ff137a4..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListServiceEdgeRouterPolicyEdgeRoutersParams creates a new ListServiceEdgeRouterPolicyEdgeRoutersParams object -// -// There are no default values defined in the spec. -func NewListServiceEdgeRouterPolicyEdgeRoutersParams() ListServiceEdgeRouterPolicyEdgeRoutersParams { - - return ListServiceEdgeRouterPolicyEdgeRoutersParams{} -} - -// ListServiceEdgeRouterPolicyEdgeRoutersParams contains all the bound params for the list service edge router policy edge routers operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceEdgeRouterPolicyEdgeRouters -type ListServiceEdgeRouterPolicyEdgeRoutersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceEdgeRouterPolicyEdgeRoutersParams() beforehand. -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceEdgeRouterPolicyEdgeRoutersParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go deleted file mode 100644 index d3f919fec..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRouterPolicyEdgeRoutersOKCode is the HTTP code returned for type ListServiceEdgeRouterPolicyEdgeRoutersOK -const ListServiceEdgeRouterPolicyEdgeRoutersOKCode int = 200 - -/*ListServiceEdgeRouterPolicyEdgeRoutersOK A list of edge routers - -swagger:response listServiceEdgeRouterPolicyEdgeRoutersOK -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersOK struct { - - /* - In: Body - */ - Payload *rest_model.ListEdgeRoutersEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersOK creates ListServiceEdgeRouterPolicyEdgeRoutersOK with default headers values -func NewListServiceEdgeRouterPolicyEdgeRoutersOK() *ListServiceEdgeRouterPolicyEdgeRoutersOK { - - return &ListServiceEdgeRouterPolicyEdgeRoutersOK{} -} - -// WithPayload adds the payload to the list service edge router policy edge routers o k response -func (o *ListServiceEdgeRouterPolicyEdgeRoutersOK) WithPayload(payload *rest_model.ListEdgeRoutersEnvelope) *ListServiceEdgeRouterPolicyEdgeRoutersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policy edge routers o k response -func (o *ListServiceEdgeRouterPolicyEdgeRoutersOK) SetPayload(payload *rest_model.ListEdgeRoutersEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPolicyEdgeRoutersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRouterPolicyEdgeRoutersUnauthorizedCode is the HTTP code returned for type ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized -const ListServiceEdgeRouterPolicyEdgeRoutersUnauthorizedCode int = 401 - -/*ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceEdgeRouterPolicyEdgeRoutersUnauthorized -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersUnauthorized creates ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized with default headers values -func NewListServiceEdgeRouterPolicyEdgeRoutersUnauthorized() *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized { - - return &ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized{} -} - -// WithPayload adds the payload to the list service edge router policy edge routers unauthorized response -func (o *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policy edge routers unauthorized response -func (o *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPolicyEdgeRoutersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRouterPolicyEdgeRoutersNotFoundCode is the HTTP code returned for type ListServiceEdgeRouterPolicyEdgeRoutersNotFound -const ListServiceEdgeRouterPolicyEdgeRoutersNotFoundCode int = 404 - -/*ListServiceEdgeRouterPolicyEdgeRoutersNotFound The requested resource does not exist - -swagger:response listServiceEdgeRouterPolicyEdgeRoutersNotFound -*/ -type ListServiceEdgeRouterPolicyEdgeRoutersNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPolicyEdgeRoutersNotFound creates ListServiceEdgeRouterPolicyEdgeRoutersNotFound with default headers values -func NewListServiceEdgeRouterPolicyEdgeRoutersNotFound() *ListServiceEdgeRouterPolicyEdgeRoutersNotFound { - - return &ListServiceEdgeRouterPolicyEdgeRoutersNotFound{} -} - -// WithPayload adds the payload to the list service edge router policy edge routers not found response -func (o *ListServiceEdgeRouterPolicyEdgeRoutersNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRouterPolicyEdgeRoutersNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policy edge routers not found response -func (o *ListServiceEdgeRouterPolicyEdgeRoutersNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPolicyEdgeRoutersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_urlbuilder.go deleted file mode 100644 index 7ead4a7a2..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_edge_routers_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListServiceEdgeRouterPolicyEdgeRoutersURL generates an URL for the list service edge router policy edge routers operation -type ListServiceEdgeRouterPolicyEdgeRoutersURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) WithBasePath(bp string) *ListServiceEdgeRouterPolicyEdgeRoutersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies/{id}/edge-routers" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceEdgeRouterPolicyEdgeRoutersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceEdgeRouterPolicyEdgeRoutersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceEdgeRouterPolicyEdgeRoutersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceEdgeRouterPolicyEdgeRoutersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services.go deleted file mode 100644 index bb03188fc..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServiceEdgeRouterPolicyServicesHandlerFunc turns a function with the right signature into a list service edge router policy services handler -type ListServiceEdgeRouterPolicyServicesHandlerFunc func(ListServiceEdgeRouterPolicyServicesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServiceEdgeRouterPolicyServicesHandlerFunc) Handle(params ListServiceEdgeRouterPolicyServicesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServiceEdgeRouterPolicyServicesHandler interface for that can handle valid list service edge router policy services params -type ListServiceEdgeRouterPolicyServicesHandler interface { - Handle(ListServiceEdgeRouterPolicyServicesParams, interface{}) middleware.Responder -} - -// NewListServiceEdgeRouterPolicyServices creates a new http.Handler for the list service edge router policy services operation -func NewListServiceEdgeRouterPolicyServices(ctx *middleware.Context, handler ListServiceEdgeRouterPolicyServicesHandler) *ListServiceEdgeRouterPolicyServices { - return &ListServiceEdgeRouterPolicyServices{Context: ctx, Handler: handler} -} - -/* ListServiceEdgeRouterPolicyServices swagger:route GET /service-edge-router-policies/{id}/services Service Edge Router Policy listServiceEdgeRouterPolicyServices - -List the services that a service edge router policy applies to - -List the services that a service edge router policy applies to - -*/ -type ListServiceEdgeRouterPolicyServices struct { - Context *middleware.Context - Handler ListServiceEdgeRouterPolicyServicesHandler -} - -func (o *ListServiceEdgeRouterPolicyServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServiceEdgeRouterPolicyServicesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go deleted file mode 100644 index f51f8d949..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewListServiceEdgeRouterPolicyServicesParams creates a new ListServiceEdgeRouterPolicyServicesParams object -// -// There are no default values defined in the spec. -func NewListServiceEdgeRouterPolicyServicesParams() ListServiceEdgeRouterPolicyServicesParams { - - return ListServiceEdgeRouterPolicyServicesParams{} -} - -// ListServiceEdgeRouterPolicyServicesParams contains all the bound params for the list service edge router policy services operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServiceEdgeRouterPolicyServices -type ListServiceEdgeRouterPolicyServicesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServiceEdgeRouterPolicyServicesParams() beforehand. -func (o *ListServiceEdgeRouterPolicyServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServiceEdgeRouterPolicyServicesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_responses.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_responses.go deleted file mode 100644 index 8fcfbdb44..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServiceEdgeRouterPolicyServicesOKCode is the HTTP code returned for type ListServiceEdgeRouterPolicyServicesOK -const ListServiceEdgeRouterPolicyServicesOKCode int = 200 - -/*ListServiceEdgeRouterPolicyServicesOK A list of services - -swagger:response listServiceEdgeRouterPolicyServicesOK -*/ -type ListServiceEdgeRouterPolicyServicesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicesEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPolicyServicesOK creates ListServiceEdgeRouterPolicyServicesOK with default headers values -func NewListServiceEdgeRouterPolicyServicesOK() *ListServiceEdgeRouterPolicyServicesOK { - - return &ListServiceEdgeRouterPolicyServicesOK{} -} - -// WithPayload adds the payload to the list service edge router policy services o k response -func (o *ListServiceEdgeRouterPolicyServicesOK) WithPayload(payload *rest_model.ListServicesEnvelope) *ListServiceEdgeRouterPolicyServicesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policy services o k response -func (o *ListServiceEdgeRouterPolicyServicesOK) SetPayload(payload *rest_model.ListServicesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPolicyServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRouterPolicyServicesUnauthorizedCode is the HTTP code returned for type ListServiceEdgeRouterPolicyServicesUnauthorized -const ListServiceEdgeRouterPolicyServicesUnauthorizedCode int = 401 - -/*ListServiceEdgeRouterPolicyServicesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServiceEdgeRouterPolicyServicesUnauthorized -*/ -type ListServiceEdgeRouterPolicyServicesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPolicyServicesUnauthorized creates ListServiceEdgeRouterPolicyServicesUnauthorized with default headers values -func NewListServiceEdgeRouterPolicyServicesUnauthorized() *ListServiceEdgeRouterPolicyServicesUnauthorized { - - return &ListServiceEdgeRouterPolicyServicesUnauthorized{} -} - -// WithPayload adds the payload to the list service edge router policy services unauthorized response -func (o *ListServiceEdgeRouterPolicyServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRouterPolicyServicesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policy services unauthorized response -func (o *ListServiceEdgeRouterPolicyServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPolicyServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServiceEdgeRouterPolicyServicesNotFoundCode is the HTTP code returned for type ListServiceEdgeRouterPolicyServicesNotFound -const ListServiceEdgeRouterPolicyServicesNotFoundCode int = 404 - -/*ListServiceEdgeRouterPolicyServicesNotFound The requested resource does not exist - -swagger:response listServiceEdgeRouterPolicyServicesNotFound -*/ -type ListServiceEdgeRouterPolicyServicesNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServiceEdgeRouterPolicyServicesNotFound creates ListServiceEdgeRouterPolicyServicesNotFound with default headers values -func NewListServiceEdgeRouterPolicyServicesNotFound() *ListServiceEdgeRouterPolicyServicesNotFound { - - return &ListServiceEdgeRouterPolicyServicesNotFound{} -} - -// WithPayload adds the payload to the list service edge router policy services not found response -func (o *ListServiceEdgeRouterPolicyServicesNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServiceEdgeRouterPolicyServicesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service edge router policy services not found response -func (o *ListServiceEdgeRouterPolicyServicesNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServiceEdgeRouterPolicyServicesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_urlbuilder.go deleted file mode 100644 index bc106ec8a..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/list_service_edge_router_policy_services_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ListServiceEdgeRouterPolicyServicesURL generates an URL for the list service edge router policy services operation -type ListServiceEdgeRouterPolicyServicesURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRouterPolicyServicesURL) WithBasePath(bp string) *ListServiceEdgeRouterPolicyServicesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServiceEdgeRouterPolicyServicesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServiceEdgeRouterPolicyServicesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies/{id}/services" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServiceEdgeRouterPolicyServicesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServiceEdgeRouterPolicyServicesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServiceEdgeRouterPolicyServicesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServiceEdgeRouterPolicyServicesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServiceEdgeRouterPolicyServicesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServiceEdgeRouterPolicyServicesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServiceEdgeRouterPolicyServicesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy.go b/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy.go deleted file mode 100644 index 117c0ff5e..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchServiceEdgeRouterPolicyHandlerFunc turns a function with the right signature into a patch service edge router policy handler -type PatchServiceEdgeRouterPolicyHandlerFunc func(PatchServiceEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchServiceEdgeRouterPolicyHandlerFunc) Handle(params PatchServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchServiceEdgeRouterPolicyHandler interface for that can handle valid patch service edge router policy params -type PatchServiceEdgeRouterPolicyHandler interface { - Handle(PatchServiceEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewPatchServiceEdgeRouterPolicy creates a new http.Handler for the patch service edge router policy operation -func NewPatchServiceEdgeRouterPolicy(ctx *middleware.Context, handler PatchServiceEdgeRouterPolicyHandler) *PatchServiceEdgeRouterPolicy { - return &PatchServiceEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* PatchServiceEdgeRouterPolicy swagger:route PATCH /service-edge-router-policies/{id} Service Edge Router Policy patchServiceEdgeRouterPolicy - -Update the supplied fields on a service edge policy - -Update the supplied fields on a service edge policy. Requires admin access. - -*/ -type PatchServiceEdgeRouterPolicy struct { - Context *middleware.Context - Handler PatchServiceEdgeRouterPolicyHandler -} - -func (o *PatchServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchServiceEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_parameters.go deleted file mode 100644 index aa3608e82..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServiceEdgeRouterPolicyParams creates a new PatchServiceEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewPatchServiceEdgeRouterPolicyParams() PatchServiceEdgeRouterPolicyParams { - - return PatchServiceEdgeRouterPolicyParams{} -} - -// PatchServiceEdgeRouterPolicyParams contains all the bound params for the patch service edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchServiceEdgeRouterPolicy -type PatchServiceEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service edge router policy patch object - Required: true - In: body - */ - Policy *rest_model.ServiceEdgeRouterPolicyPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchServiceEdgeRouterPolicyParams() beforehand. -func (o *PatchServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceEdgeRouterPolicyPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_responses.go b/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_responses.go deleted file mode 100644 index 904dbbb3e..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchServiceEdgeRouterPolicyOKCode is the HTTP code returned for type PatchServiceEdgeRouterPolicyOK -const PatchServiceEdgeRouterPolicyOKCode int = 200 - -/*PatchServiceEdgeRouterPolicyOK The patch request was successful and the resource has been altered - -swagger:response patchServiceEdgeRouterPolicyOK -*/ -type PatchServiceEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchServiceEdgeRouterPolicyOK creates PatchServiceEdgeRouterPolicyOK with default headers values -func NewPatchServiceEdgeRouterPolicyOK() *PatchServiceEdgeRouterPolicyOK { - - return &PatchServiceEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the patch service edge router policy o k response -func (o *PatchServiceEdgeRouterPolicyOK) WithPayload(payload *rest_model.Empty) *PatchServiceEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service edge router policy o k response -func (o *PatchServiceEdgeRouterPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceEdgeRouterPolicyBadRequestCode is the HTTP code returned for type PatchServiceEdgeRouterPolicyBadRequest -const PatchServiceEdgeRouterPolicyBadRequestCode int = 400 - -/*PatchServiceEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchServiceEdgeRouterPolicyBadRequest -*/ -type PatchServiceEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceEdgeRouterPolicyBadRequest creates PatchServiceEdgeRouterPolicyBadRequest with default headers values -func NewPatchServiceEdgeRouterPolicyBadRequest() *PatchServiceEdgeRouterPolicyBadRequest { - - return &PatchServiceEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the patch service edge router policy bad request response -func (o *PatchServiceEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service edge router policy bad request response -func (o *PatchServiceEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type PatchServiceEdgeRouterPolicyUnauthorized -const PatchServiceEdgeRouterPolicyUnauthorizedCode int = 401 - -/*PatchServiceEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchServiceEdgeRouterPolicyUnauthorized -*/ -type PatchServiceEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceEdgeRouterPolicyUnauthorized creates PatchServiceEdgeRouterPolicyUnauthorized with default headers values -func NewPatchServiceEdgeRouterPolicyUnauthorized() *PatchServiceEdgeRouterPolicyUnauthorized { - - return &PatchServiceEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the patch service edge router policy unauthorized response -func (o *PatchServiceEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service edge router policy unauthorized response -func (o *PatchServiceEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceEdgeRouterPolicyNotFoundCode is the HTTP code returned for type PatchServiceEdgeRouterPolicyNotFound -const PatchServiceEdgeRouterPolicyNotFoundCode int = 404 - -/*PatchServiceEdgeRouterPolicyNotFound The requested resource does not exist - -swagger:response patchServiceEdgeRouterPolicyNotFound -*/ -type PatchServiceEdgeRouterPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServiceEdgeRouterPolicyNotFound creates PatchServiceEdgeRouterPolicyNotFound with default headers values -func NewPatchServiceEdgeRouterPolicyNotFound() *PatchServiceEdgeRouterPolicyNotFound { - - return &PatchServiceEdgeRouterPolicyNotFound{} -} - -// WithPayload adds the payload to the patch service edge router policy not found response -func (o *PatchServiceEdgeRouterPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServiceEdgeRouterPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service edge router policy not found response -func (o *PatchServiceEdgeRouterPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceEdgeRouterPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_urlbuilder.go deleted file mode 100644 index 2eb91892d..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/patch_service_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchServiceEdgeRouterPolicyURL generates an URL for the patch service edge router policy operation -type PatchServiceEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceEdgeRouterPolicyURL) WithBasePath(bp string) *PatchServiceEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchServiceEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchServiceEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchServiceEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchServiceEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchServiceEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchServiceEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchServiceEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy.go b/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy.go deleted file mode 100644 index 558b265bb..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateServiceEdgeRouterPolicyHandlerFunc turns a function with the right signature into a update service edge router policy handler -type UpdateServiceEdgeRouterPolicyHandlerFunc func(UpdateServiceEdgeRouterPolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateServiceEdgeRouterPolicyHandlerFunc) Handle(params UpdateServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateServiceEdgeRouterPolicyHandler interface for that can handle valid update service edge router policy params -type UpdateServiceEdgeRouterPolicyHandler interface { - Handle(UpdateServiceEdgeRouterPolicyParams, interface{}) middleware.Responder -} - -// NewUpdateServiceEdgeRouterPolicy creates a new http.Handler for the update service edge router policy operation -func NewUpdateServiceEdgeRouterPolicy(ctx *middleware.Context, handler UpdateServiceEdgeRouterPolicyHandler) *UpdateServiceEdgeRouterPolicy { - return &UpdateServiceEdgeRouterPolicy{Context: ctx, Handler: handler} -} - -/* UpdateServiceEdgeRouterPolicy swagger:route PUT /service-edge-router-policies/{id} Service Edge Router Policy updateServiceEdgeRouterPolicy - -Update all fields on a service edge policy - -Update all fields on a service edge policy by id. Requires admin access. - -*/ -type UpdateServiceEdgeRouterPolicy struct { - Context *middleware.Context - Handler UpdateServiceEdgeRouterPolicyHandler -} - -func (o *UpdateServiceEdgeRouterPolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateServiceEdgeRouterPolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_parameters.go b/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_parameters.go deleted file mode 100644 index 1ac5a3b08..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServiceEdgeRouterPolicyParams creates a new UpdateServiceEdgeRouterPolicyParams object -// -// There are no default values defined in the spec. -func NewUpdateServiceEdgeRouterPolicyParams() UpdateServiceEdgeRouterPolicyParams { - - return UpdateServiceEdgeRouterPolicyParams{} -} - -// UpdateServiceEdgeRouterPolicyParams contains all the bound params for the update service edge router policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateServiceEdgeRouterPolicy -type UpdateServiceEdgeRouterPolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service edge router policy update object - Required: true - In: body - */ - Policy *rest_model.ServiceEdgeRouterPolicyUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateServiceEdgeRouterPolicyParams() beforehand. -func (o *UpdateServiceEdgeRouterPolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServiceEdgeRouterPolicyUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateServiceEdgeRouterPolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_responses.go b/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_responses.go deleted file mode 100644 index 0f827544b..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServiceEdgeRouterPolicyOKCode is the HTTP code returned for type UpdateServiceEdgeRouterPolicyOK -const UpdateServiceEdgeRouterPolicyOKCode int = 200 - -/*UpdateServiceEdgeRouterPolicyOK The update request was successful and the resource has been altered - -swagger:response updateServiceEdgeRouterPolicyOK -*/ -type UpdateServiceEdgeRouterPolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateServiceEdgeRouterPolicyOK creates UpdateServiceEdgeRouterPolicyOK with default headers values -func NewUpdateServiceEdgeRouterPolicyOK() *UpdateServiceEdgeRouterPolicyOK { - - return &UpdateServiceEdgeRouterPolicyOK{} -} - -// WithPayload adds the payload to the update service edge router policy o k response -func (o *UpdateServiceEdgeRouterPolicyOK) WithPayload(payload *rest_model.Empty) *UpdateServiceEdgeRouterPolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service edge router policy o k response -func (o *UpdateServiceEdgeRouterPolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceEdgeRouterPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceEdgeRouterPolicyBadRequestCode is the HTTP code returned for type UpdateServiceEdgeRouterPolicyBadRequest -const UpdateServiceEdgeRouterPolicyBadRequestCode int = 400 - -/*UpdateServiceEdgeRouterPolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateServiceEdgeRouterPolicyBadRequest -*/ -type UpdateServiceEdgeRouterPolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceEdgeRouterPolicyBadRequest creates UpdateServiceEdgeRouterPolicyBadRequest with default headers values -func NewUpdateServiceEdgeRouterPolicyBadRequest() *UpdateServiceEdgeRouterPolicyBadRequest { - - return &UpdateServiceEdgeRouterPolicyBadRequest{} -} - -// WithPayload adds the payload to the update service edge router policy bad request response -func (o *UpdateServiceEdgeRouterPolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceEdgeRouterPolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service edge router policy bad request response -func (o *UpdateServiceEdgeRouterPolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceEdgeRouterPolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceEdgeRouterPolicyUnauthorizedCode is the HTTP code returned for type UpdateServiceEdgeRouterPolicyUnauthorized -const UpdateServiceEdgeRouterPolicyUnauthorizedCode int = 401 - -/*UpdateServiceEdgeRouterPolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateServiceEdgeRouterPolicyUnauthorized -*/ -type UpdateServiceEdgeRouterPolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceEdgeRouterPolicyUnauthorized creates UpdateServiceEdgeRouterPolicyUnauthorized with default headers values -func NewUpdateServiceEdgeRouterPolicyUnauthorized() *UpdateServiceEdgeRouterPolicyUnauthorized { - - return &UpdateServiceEdgeRouterPolicyUnauthorized{} -} - -// WithPayload adds the payload to the update service edge router policy unauthorized response -func (o *UpdateServiceEdgeRouterPolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceEdgeRouterPolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service edge router policy unauthorized response -func (o *UpdateServiceEdgeRouterPolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceEdgeRouterPolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceEdgeRouterPolicyNotFoundCode is the HTTP code returned for type UpdateServiceEdgeRouterPolicyNotFound -const UpdateServiceEdgeRouterPolicyNotFoundCode int = 404 - -/*UpdateServiceEdgeRouterPolicyNotFound The requested resource does not exist - -swagger:response updateServiceEdgeRouterPolicyNotFound -*/ -type UpdateServiceEdgeRouterPolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServiceEdgeRouterPolicyNotFound creates UpdateServiceEdgeRouterPolicyNotFound with default headers values -func NewUpdateServiceEdgeRouterPolicyNotFound() *UpdateServiceEdgeRouterPolicyNotFound { - - return &UpdateServiceEdgeRouterPolicyNotFound{} -} - -// WithPayload adds the payload to the update service edge router policy not found response -func (o *UpdateServiceEdgeRouterPolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServiceEdgeRouterPolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service edge router policy not found response -func (o *UpdateServiceEdgeRouterPolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceEdgeRouterPolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_urlbuilder.go b/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_urlbuilder.go deleted file mode 100644 index 9fd1b1cc7..000000000 --- a/rest_management_api_server/operations/service_edge_router_policy/update_service_edge_router_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_edge_router_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateServiceEdgeRouterPolicyURL generates an URL for the update service edge router policy operation -type UpdateServiceEdgeRouterPolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceEdgeRouterPolicyURL) WithBasePath(bp string) *UpdateServiceEdgeRouterPolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceEdgeRouterPolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateServiceEdgeRouterPolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-edge-router-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateServiceEdgeRouterPolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateServiceEdgeRouterPolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateServiceEdgeRouterPolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateServiceEdgeRouterPolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateServiceEdgeRouterPolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateServiceEdgeRouterPolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateServiceEdgeRouterPolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/create_service_policy.go b/rest_management_api_server/operations/service_policy/create_service_policy.go deleted file mode 100644 index 525e7fe10..000000000 --- a/rest_management_api_server/operations/service_policy/create_service_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateServicePolicyHandlerFunc turns a function with the right signature into a create service policy handler -type CreateServicePolicyHandlerFunc func(CreateServicePolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateServicePolicyHandlerFunc) Handle(params CreateServicePolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateServicePolicyHandler interface for that can handle valid create service policy params -type CreateServicePolicyHandler interface { - Handle(CreateServicePolicyParams, interface{}) middleware.Responder -} - -// NewCreateServicePolicy creates a new http.Handler for the create service policy operation -func NewCreateServicePolicy(ctx *middleware.Context, handler CreateServicePolicyHandler) *CreateServicePolicy { - return &CreateServicePolicy{Context: ctx, Handler: handler} -} - -/* CreateServicePolicy swagger:route POST /service-policies Service Policy createServicePolicy - -Create a service policy resource - -Create a service policy resource. Requires admin access. - -*/ -type CreateServicePolicy struct { - Context *middleware.Context - Handler CreateServicePolicyHandler -} - -func (o *CreateServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateServicePolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/create_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/create_service_policy_parameters.go deleted file mode 100644 index 05dfbb692..000000000 --- a/rest_management_api_server/operations/service_policy/create_service_policy_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateServicePolicyParams creates a new CreateServicePolicyParams object -// -// There are no default values defined in the spec. -func NewCreateServicePolicyParams() CreateServicePolicyParams { - - return CreateServicePolicyParams{} -} - -// CreateServicePolicyParams contains all the bound params for the create service policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters createServicePolicy -type CreateServicePolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A service policy to create - Required: true - In: body - */ - Policy *rest_model.ServicePolicyCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateServicePolicyParams() beforehand. -func (o *CreateServicePolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServicePolicyCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/service_policy/create_service_policy_responses.go b/rest_management_api_server/operations/service_policy/create_service_policy_responses.go deleted file mode 100644 index 997db059f..000000000 --- a/rest_management_api_server/operations/service_policy/create_service_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateServicePolicyCreatedCode is the HTTP code returned for type CreateServicePolicyCreated -const CreateServicePolicyCreatedCode int = 201 - -/*CreateServicePolicyCreated The create request was successful and the resource has been added at the following location - -swagger:response createServicePolicyCreated -*/ -type CreateServicePolicyCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateServicePolicyCreated creates CreateServicePolicyCreated with default headers values -func NewCreateServicePolicyCreated() *CreateServicePolicyCreated { - - return &CreateServicePolicyCreated{} -} - -// WithPayload adds the payload to the create service policy created response -func (o *CreateServicePolicyCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateServicePolicyCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service policy created response -func (o *CreateServicePolicyCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServicePolicyCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServicePolicyBadRequestCode is the HTTP code returned for type CreateServicePolicyBadRequest -const CreateServicePolicyBadRequestCode int = 400 - -/*CreateServicePolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createServicePolicyBadRequest -*/ -type CreateServicePolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateServicePolicyBadRequest creates CreateServicePolicyBadRequest with default headers values -func NewCreateServicePolicyBadRequest() *CreateServicePolicyBadRequest { - - return &CreateServicePolicyBadRequest{} -} - -// WithPayload adds the payload to the create service policy bad request response -func (o *CreateServicePolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateServicePolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service policy bad request response -func (o *CreateServicePolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServicePolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServicePolicyUnauthorizedCode is the HTTP code returned for type CreateServicePolicyUnauthorized -const CreateServicePolicyUnauthorizedCode int = 401 - -/*CreateServicePolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createServicePolicyUnauthorized -*/ -type CreateServicePolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateServicePolicyUnauthorized creates CreateServicePolicyUnauthorized with default headers values -func NewCreateServicePolicyUnauthorized() *CreateServicePolicyUnauthorized { - - return &CreateServicePolicyUnauthorized{} -} - -// WithPayload adds the payload to the create service policy unauthorized response -func (o *CreateServicePolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateServicePolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service policy unauthorized response -func (o *CreateServicePolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServicePolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/create_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/create_service_policy_urlbuilder.go deleted file mode 100644 index 765b16c1b..000000000 --- a/rest_management_api_server/operations/service_policy/create_service_policy_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateServicePolicyURL generates an URL for the create service policy operation -type CreateServicePolicyURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServicePolicyURL) WithBasePath(bp string) *CreateServicePolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServicePolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateServicePolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateServicePolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateServicePolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateServicePolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateServicePolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateServicePolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateServicePolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/delete_service_policy.go b/rest_management_api_server/operations/service_policy/delete_service_policy.go deleted file mode 100644 index c033ccf76..000000000 --- a/rest_management_api_server/operations/service_policy/delete_service_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteServicePolicyHandlerFunc turns a function with the right signature into a delete service policy handler -type DeleteServicePolicyHandlerFunc func(DeleteServicePolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteServicePolicyHandlerFunc) Handle(params DeleteServicePolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteServicePolicyHandler interface for that can handle valid delete service policy params -type DeleteServicePolicyHandler interface { - Handle(DeleteServicePolicyParams, interface{}) middleware.Responder -} - -// NewDeleteServicePolicy creates a new http.Handler for the delete service policy operation -func NewDeleteServicePolicy(ctx *middleware.Context, handler DeleteServicePolicyHandler) *DeleteServicePolicy { - return &DeleteServicePolicy{Context: ctx, Handler: handler} -} - -/* DeleteServicePolicy swagger:route DELETE /service-policies/{id} Service Policy deleteServicePolicy - -Delete a service policy - -Delete a service policy by id. Requires admin access. - -*/ -type DeleteServicePolicy struct { - Context *middleware.Context - Handler DeleteServicePolicyHandler -} - -func (o *DeleteServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteServicePolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/delete_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/delete_service_policy_parameters.go deleted file mode 100644 index d8b414801..000000000 --- a/rest_management_api_server/operations/service_policy/delete_service_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteServicePolicyParams creates a new DeleteServicePolicyParams object -// -// There are no default values defined in the spec. -func NewDeleteServicePolicyParams() DeleteServicePolicyParams { - - return DeleteServicePolicyParams{} -} - -// DeleteServicePolicyParams contains all the bound params for the delete service policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteServicePolicy -type DeleteServicePolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteServicePolicyParams() beforehand. -func (o *DeleteServicePolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteServicePolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/delete_service_policy_responses.go b/rest_management_api_server/operations/service_policy/delete_service_policy_responses.go deleted file mode 100644 index 9bae61457..000000000 --- a/rest_management_api_server/operations/service_policy/delete_service_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteServicePolicyOKCode is the HTTP code returned for type DeleteServicePolicyOK -const DeleteServicePolicyOKCode int = 200 - -/*DeleteServicePolicyOK The delete request was successful and the resource has been removed - -swagger:response deleteServicePolicyOK -*/ -type DeleteServicePolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteServicePolicyOK creates DeleteServicePolicyOK with default headers values -func NewDeleteServicePolicyOK() *DeleteServicePolicyOK { - - return &DeleteServicePolicyOK{} -} - -// WithPayload adds the payload to the delete service policy o k response -func (o *DeleteServicePolicyOK) WithPayload(payload *rest_model.Empty) *DeleteServicePolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service policy o k response -func (o *DeleteServicePolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServicePolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServicePolicyBadRequestCode is the HTTP code returned for type DeleteServicePolicyBadRequest -const DeleteServicePolicyBadRequestCode int = 400 - -/*DeleteServicePolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteServicePolicyBadRequest -*/ -type DeleteServicePolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServicePolicyBadRequest creates DeleteServicePolicyBadRequest with default headers values -func NewDeleteServicePolicyBadRequest() *DeleteServicePolicyBadRequest { - - return &DeleteServicePolicyBadRequest{} -} - -// WithPayload adds the payload to the delete service policy bad request response -func (o *DeleteServicePolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServicePolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service policy bad request response -func (o *DeleteServicePolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServicePolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServicePolicyUnauthorizedCode is the HTTP code returned for type DeleteServicePolicyUnauthorized -const DeleteServicePolicyUnauthorizedCode int = 401 - -/*DeleteServicePolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteServicePolicyUnauthorized -*/ -type DeleteServicePolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServicePolicyUnauthorized creates DeleteServicePolicyUnauthorized with default headers values -func NewDeleteServicePolicyUnauthorized() *DeleteServicePolicyUnauthorized { - - return &DeleteServicePolicyUnauthorized{} -} - -// WithPayload adds the payload to the delete service policy unauthorized response -func (o *DeleteServicePolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServicePolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service policy unauthorized response -func (o *DeleteServicePolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServicePolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteServicePolicyConflictCode is the HTTP code returned for type DeleteServicePolicyConflict -const DeleteServicePolicyConflictCode int = 409 - -/*DeleteServicePolicyConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteServicePolicyConflict -*/ -type DeleteServicePolicyConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteServicePolicyConflict creates DeleteServicePolicyConflict with default headers values -func NewDeleteServicePolicyConflict() *DeleteServicePolicyConflict { - - return &DeleteServicePolicyConflict{} -} - -// WithPayload adds the payload to the delete service policy conflict response -func (o *DeleteServicePolicyConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteServicePolicyConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete service policy conflict response -func (o *DeleteServicePolicyConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteServicePolicyConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/delete_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/delete_service_policy_urlbuilder.go deleted file mode 100644 index 355dbdd7e..000000000 --- a/rest_management_api_server/operations/service_policy/delete_service_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteServicePolicyURL generates an URL for the delete service policy operation -type DeleteServicePolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServicePolicyURL) WithBasePath(bp string) *DeleteServicePolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteServicePolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteServicePolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteServicePolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteServicePolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteServicePolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteServicePolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteServicePolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteServicePolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteServicePolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/detail_service_policy.go b/rest_management_api_server/operations/service_policy/detail_service_policy.go deleted file mode 100644 index 14da4ce11..000000000 --- a/rest_management_api_server/operations/service_policy/detail_service_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailServicePolicyHandlerFunc turns a function with the right signature into a detail service policy handler -type DetailServicePolicyHandlerFunc func(DetailServicePolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailServicePolicyHandlerFunc) Handle(params DetailServicePolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailServicePolicyHandler interface for that can handle valid detail service policy params -type DetailServicePolicyHandler interface { - Handle(DetailServicePolicyParams, interface{}) middleware.Responder -} - -// NewDetailServicePolicy creates a new http.Handler for the detail service policy operation -func NewDetailServicePolicy(ctx *middleware.Context, handler DetailServicePolicyHandler) *DetailServicePolicy { - return &DetailServicePolicy{Context: ctx, Handler: handler} -} - -/* DetailServicePolicy swagger:route GET /service-policies/{id} Service Policy detailServicePolicy - -Retrieves a single service policy - -Retrieves a single service policy by id. Requires admin access. - -*/ -type DetailServicePolicy struct { - Context *middleware.Context - Handler DetailServicePolicyHandler -} - -func (o *DetailServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailServicePolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/detail_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/detail_service_policy_parameters.go deleted file mode 100644 index 888e5d20f..000000000 --- a/rest_management_api_server/operations/service_policy/detail_service_policy_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailServicePolicyParams creates a new DetailServicePolicyParams object -// -// There are no default values defined in the spec. -func NewDetailServicePolicyParams() DetailServicePolicyParams { - - return DetailServicePolicyParams{} -} - -// DetailServicePolicyParams contains all the bound params for the detail service policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailServicePolicy -type DetailServicePolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailServicePolicyParams() beforehand. -func (o *DetailServicePolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailServicePolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/detail_service_policy_responses.go b/rest_management_api_server/operations/service_policy/detail_service_policy_responses.go deleted file mode 100644 index 58bac2e7b..000000000 --- a/rest_management_api_server/operations/service_policy/detail_service_policy_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailServicePolicyOKCode is the HTTP code returned for type DetailServicePolicyOK -const DetailServicePolicyOKCode int = 200 - -/*DetailServicePolicyOK A single service policy - -swagger:response detailServicePolicyOK -*/ -type DetailServicePolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailServicePolicyEnvelop `json:"body,omitempty"` -} - -// NewDetailServicePolicyOK creates DetailServicePolicyOK with default headers values -func NewDetailServicePolicyOK() *DetailServicePolicyOK { - - return &DetailServicePolicyOK{} -} - -// WithPayload adds the payload to the detail service policy o k response -func (o *DetailServicePolicyOK) WithPayload(payload *rest_model.DetailServicePolicyEnvelop) *DetailServicePolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service policy o k response -func (o *DetailServicePolicyOK) SetPayload(payload *rest_model.DetailServicePolicyEnvelop) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServicePolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServicePolicyUnauthorizedCode is the HTTP code returned for type DetailServicePolicyUnauthorized -const DetailServicePolicyUnauthorizedCode int = 401 - -/*DetailServicePolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailServicePolicyUnauthorized -*/ -type DetailServicePolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServicePolicyUnauthorized creates DetailServicePolicyUnauthorized with default headers values -func NewDetailServicePolicyUnauthorized() *DetailServicePolicyUnauthorized { - - return &DetailServicePolicyUnauthorized{} -} - -// WithPayload adds the payload to the detail service policy unauthorized response -func (o *DetailServicePolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServicePolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service policy unauthorized response -func (o *DetailServicePolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServicePolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailServicePolicyNotFoundCode is the HTTP code returned for type DetailServicePolicyNotFound -const DetailServicePolicyNotFoundCode int = 404 - -/*DetailServicePolicyNotFound The requested resource does not exist - -swagger:response detailServicePolicyNotFound -*/ -type DetailServicePolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailServicePolicyNotFound creates DetailServicePolicyNotFound with default headers values -func NewDetailServicePolicyNotFound() *DetailServicePolicyNotFound { - - return &DetailServicePolicyNotFound{} -} - -// WithPayload adds the payload to the detail service policy not found response -func (o *DetailServicePolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailServicePolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail service policy not found response -func (o *DetailServicePolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailServicePolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/detail_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/detail_service_policy_urlbuilder.go deleted file mode 100644 index 088b922a4..000000000 --- a/rest_management_api_server/operations/service_policy/detail_service_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailServicePolicyURL generates an URL for the detail service policy operation -type DetailServicePolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServicePolicyURL) WithBasePath(bp string) *DetailServicePolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailServicePolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailServicePolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailServicePolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailServicePolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailServicePolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailServicePolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailServicePolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailServicePolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailServicePolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policies.go b/rest_management_api_server/operations/service_policy/list_service_policies.go deleted file mode 100644 index 97bd1674d..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policies.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServicePoliciesHandlerFunc turns a function with the right signature into a list service policies handler -type ListServicePoliciesHandlerFunc func(ListServicePoliciesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServicePoliciesHandlerFunc) Handle(params ListServicePoliciesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServicePoliciesHandler interface for that can handle valid list service policies params -type ListServicePoliciesHandler interface { - Handle(ListServicePoliciesParams, interface{}) middleware.Responder -} - -// NewListServicePolicies creates a new http.Handler for the list service policies operation -func NewListServicePolicies(ctx *middleware.Context, handler ListServicePoliciesHandler) *ListServicePolicies { - return &ListServicePolicies{Context: ctx, Handler: handler} -} - -/* ListServicePolicies swagger:route GET /service-policies Service Policy listServicePolicies - -List service policies - -Retrieves a list of service policy resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServicePolicies struct { - Context *middleware.Context - Handler ListServicePoliciesHandler -} - -func (o *ListServicePolicies) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServicePoliciesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policies_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policies_parameters.go deleted file mode 100644 index bd6e4d31e..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policies_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePoliciesParams creates a new ListServicePoliciesParams object -// -// There are no default values defined in the spec. -func NewListServicePoliciesParams() ListServicePoliciesParams { - - return ListServicePoliciesParams{} -} - -// ListServicePoliciesParams contains all the bound params for the list service policies operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServicePolicies -type ListServicePoliciesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServicePoliciesParams() beforehand. -func (o *ListServicePoliciesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServicePoliciesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServicePoliciesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServicePoliciesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policies_responses.go b/rest_management_api_server/operations/service_policy/list_service_policies_responses.go deleted file mode 100644 index 80ce55363..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policies_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePoliciesOKCode is the HTTP code returned for type ListServicePoliciesOK -const ListServicePoliciesOKCode int = 200 - -/*ListServicePoliciesOK A list of service policies - -swagger:response listServicePoliciesOK -*/ -type ListServicePoliciesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicePoliciesEnvelope `json:"body,omitempty"` -} - -// NewListServicePoliciesOK creates ListServicePoliciesOK with default headers values -func NewListServicePoliciesOK() *ListServicePoliciesOK { - - return &ListServicePoliciesOK{} -} - -// WithPayload adds the payload to the list service policies o k response -func (o *ListServicePoliciesOK) WithPayload(payload *rest_model.ListServicePoliciesEnvelope) *ListServicePoliciesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policies o k response -func (o *ListServicePoliciesOK) SetPayload(payload *rest_model.ListServicePoliciesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePoliciesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePoliciesBadRequestCode is the HTTP code returned for type ListServicePoliciesBadRequest -const ListServicePoliciesBadRequestCode int = 400 - -/*ListServicePoliciesBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listServicePoliciesBadRequest -*/ -type ListServicePoliciesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePoliciesBadRequest creates ListServicePoliciesBadRequest with default headers values -func NewListServicePoliciesBadRequest() *ListServicePoliciesBadRequest { - - return &ListServicePoliciesBadRequest{} -} - -// WithPayload adds the payload to the list service policies bad request response -func (o *ListServicePoliciesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePoliciesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policies bad request response -func (o *ListServicePoliciesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePoliciesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePoliciesUnauthorizedCode is the HTTP code returned for type ListServicePoliciesUnauthorized -const ListServicePoliciesUnauthorizedCode int = 401 - -/*ListServicePoliciesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServicePoliciesUnauthorized -*/ -type ListServicePoliciesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePoliciesUnauthorized creates ListServicePoliciesUnauthorized with default headers values -func NewListServicePoliciesUnauthorized() *ListServicePoliciesUnauthorized { - - return &ListServicePoliciesUnauthorized{} -} - -// WithPayload adds the payload to the list service policies unauthorized response -func (o *ListServicePoliciesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePoliciesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policies unauthorized response -func (o *ListServicePoliciesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePoliciesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policies_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policies_urlbuilder.go deleted file mode 100644 index 5263b2f09..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policies_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListServicePoliciesURL generates an URL for the list service policies operation -type ListServicePoliciesURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePoliciesURL) WithBasePath(bp string) *ListServicePoliciesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePoliciesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServicePoliciesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServicePoliciesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServicePoliciesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServicePoliciesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServicePoliciesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServicePoliciesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServicePoliciesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_identities.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities.go deleted file mode 100644 index 23517f721..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_identities.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServicePolicyIdentitiesHandlerFunc turns a function with the right signature into a list service policy identities handler -type ListServicePolicyIdentitiesHandlerFunc func(ListServicePolicyIdentitiesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServicePolicyIdentitiesHandlerFunc) Handle(params ListServicePolicyIdentitiesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServicePolicyIdentitiesHandler interface for that can handle valid list service policy identities params -type ListServicePolicyIdentitiesHandler interface { - Handle(ListServicePolicyIdentitiesParams, interface{}) middleware.Responder -} - -// NewListServicePolicyIdentities creates a new http.Handler for the list service policy identities operation -func NewListServicePolicyIdentities(ctx *middleware.Context, handler ListServicePolicyIdentitiesHandler) *ListServicePolicyIdentities { - return &ListServicePolicyIdentities{Context: ctx, Handler: handler} -} - -/* ListServicePolicyIdentities swagger:route GET /service-policies/{id}/identities Service Policy listServicePolicyIdentities - -List identities a service policy affects - -Retrieves a list of identity resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServicePolicyIdentities struct { - Context *middleware.Context - Handler ListServicePolicyIdentitiesHandler -} - -func (o *ListServicePolicyIdentities) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServicePolicyIdentitiesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_identities_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities_parameters.go deleted file mode 100644 index 6e49c7285..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_identities_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePolicyIdentitiesParams creates a new ListServicePolicyIdentitiesParams object -// -// There are no default values defined in the spec. -func NewListServicePolicyIdentitiesParams() ListServicePolicyIdentitiesParams { - - return ListServicePolicyIdentitiesParams{} -} - -// ListServicePolicyIdentitiesParams contains all the bound params for the list service policy identities operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServicePolicyIdentities -type ListServicePolicyIdentitiesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServicePolicyIdentitiesParams() beforehand. -func (o *ListServicePolicyIdentitiesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServicePolicyIdentitiesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServicePolicyIdentitiesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServicePolicyIdentitiesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServicePolicyIdentitiesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_identities_responses.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities_responses.go deleted file mode 100644 index 973deb7ea..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_identities_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePolicyIdentitiesOKCode is the HTTP code returned for type ListServicePolicyIdentitiesOK -const ListServicePolicyIdentitiesOKCode int = 200 - -/*ListServicePolicyIdentitiesOK A list of identities - -swagger:response listServicePolicyIdentitiesOK -*/ -type ListServicePolicyIdentitiesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListIdentitiesEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyIdentitiesOK creates ListServicePolicyIdentitiesOK with default headers values -func NewListServicePolicyIdentitiesOK() *ListServicePolicyIdentitiesOK { - - return &ListServicePolicyIdentitiesOK{} -} - -// WithPayload adds the payload to the list service policy identities o k response -func (o *ListServicePolicyIdentitiesOK) WithPayload(payload *rest_model.ListIdentitiesEnvelope) *ListServicePolicyIdentitiesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy identities o k response -func (o *ListServicePolicyIdentitiesOK) SetPayload(payload *rest_model.ListIdentitiesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyIdentitiesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePolicyIdentitiesBadRequestCode is the HTTP code returned for type ListServicePolicyIdentitiesBadRequest -const ListServicePolicyIdentitiesBadRequestCode int = 400 - -/*ListServicePolicyIdentitiesBadRequest The requested resource does not exist - -swagger:response listServicePolicyIdentitiesBadRequest -*/ -type ListServicePolicyIdentitiesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyIdentitiesBadRequest creates ListServicePolicyIdentitiesBadRequest with default headers values -func NewListServicePolicyIdentitiesBadRequest() *ListServicePolicyIdentitiesBadRequest { - - return &ListServicePolicyIdentitiesBadRequest{} -} - -// WithPayload adds the payload to the list service policy identities bad request response -func (o *ListServicePolicyIdentitiesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePolicyIdentitiesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy identities bad request response -func (o *ListServicePolicyIdentitiesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyIdentitiesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePolicyIdentitiesUnauthorizedCode is the HTTP code returned for type ListServicePolicyIdentitiesUnauthorized -const ListServicePolicyIdentitiesUnauthorizedCode int = 401 - -/*ListServicePolicyIdentitiesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServicePolicyIdentitiesUnauthorized -*/ -type ListServicePolicyIdentitiesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyIdentitiesUnauthorized creates ListServicePolicyIdentitiesUnauthorized with default headers values -func NewListServicePolicyIdentitiesUnauthorized() *ListServicePolicyIdentitiesUnauthorized { - - return &ListServicePolicyIdentitiesUnauthorized{} -} - -// WithPayload adds the payload to the list service policy identities unauthorized response -func (o *ListServicePolicyIdentitiesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePolicyIdentitiesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy identities unauthorized response -func (o *ListServicePolicyIdentitiesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyIdentitiesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_identities_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policy_identities_urlbuilder.go deleted file mode 100644 index 261af889d..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_identities_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServicePolicyIdentitiesURL generates an URL for the list service policy identities operation -type ListServicePolicyIdentitiesURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePolicyIdentitiesURL) WithBasePath(bp string) *ListServicePolicyIdentitiesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePolicyIdentitiesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServicePolicyIdentitiesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}/identities" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServicePolicyIdentitiesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServicePolicyIdentitiesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServicePolicyIdentitiesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServicePolicyIdentitiesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServicePolicyIdentitiesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServicePolicyIdentitiesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServicePolicyIdentitiesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks.go b/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks.go deleted file mode 100644 index 81eea080e..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServicePolicyPostureChecksHandlerFunc turns a function with the right signature into a list service policy posture checks handler -type ListServicePolicyPostureChecksHandlerFunc func(ListServicePolicyPostureChecksParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServicePolicyPostureChecksHandlerFunc) Handle(params ListServicePolicyPostureChecksParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServicePolicyPostureChecksHandler interface for that can handle valid list service policy posture checks params -type ListServicePolicyPostureChecksHandler interface { - Handle(ListServicePolicyPostureChecksParams, interface{}) middleware.Responder -} - -// NewListServicePolicyPostureChecks creates a new http.Handler for the list service policy posture checks operation -func NewListServicePolicyPostureChecks(ctx *middleware.Context, handler ListServicePolicyPostureChecksHandler) *ListServicePolicyPostureChecks { - return &ListServicePolicyPostureChecks{Context: ctx, Handler: handler} -} - -/* ListServicePolicyPostureChecks swagger:route GET /service-policies/{id}/posture-checks Service Policy listServicePolicyPostureChecks - -List posture check a service policy includes - -Retrieves a list of posture check resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServicePolicyPostureChecks struct { - Context *middleware.Context - Handler ListServicePolicyPostureChecksHandler -} - -func (o *ListServicePolicyPostureChecks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServicePolicyPostureChecksParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_parameters.go deleted file mode 100644 index eabb88fef..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePolicyPostureChecksParams creates a new ListServicePolicyPostureChecksParams object -// -// There are no default values defined in the spec. -func NewListServicePolicyPostureChecksParams() ListServicePolicyPostureChecksParams { - - return ListServicePolicyPostureChecksParams{} -} - -// ListServicePolicyPostureChecksParams contains all the bound params for the list service policy posture checks operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServicePolicyPostureChecks -type ListServicePolicyPostureChecksParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServicePolicyPostureChecksParams() beforehand. -func (o *ListServicePolicyPostureChecksParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServicePolicyPostureChecksParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServicePolicyPostureChecksParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServicePolicyPostureChecksParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServicePolicyPostureChecksParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_responses.go b/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_responses.go deleted file mode 100644 index c48c74173..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePolicyPostureChecksOKCode is the HTTP code returned for type ListServicePolicyPostureChecksOK -const ListServicePolicyPostureChecksOKCode int = 200 - -/*ListServicePolicyPostureChecksOK A list of posture checks - -swagger:response listServicePolicyPostureChecksOK -*/ -type ListServicePolicyPostureChecksOK struct { - - /* - In: Body - */ - Payload *rest_model.ListPostureCheckEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyPostureChecksOK creates ListServicePolicyPostureChecksOK with default headers values -func NewListServicePolicyPostureChecksOK() *ListServicePolicyPostureChecksOK { - - return &ListServicePolicyPostureChecksOK{} -} - -// WithPayload adds the payload to the list service policy posture checks o k response -func (o *ListServicePolicyPostureChecksOK) WithPayload(payload *rest_model.ListPostureCheckEnvelope) *ListServicePolicyPostureChecksOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy posture checks o k response -func (o *ListServicePolicyPostureChecksOK) SetPayload(payload *rest_model.ListPostureCheckEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyPostureChecksOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePolicyPostureChecksBadRequestCode is the HTTP code returned for type ListServicePolicyPostureChecksBadRequest -const ListServicePolicyPostureChecksBadRequestCode int = 400 - -/*ListServicePolicyPostureChecksBadRequest The requested resource does not exist - -swagger:response listServicePolicyPostureChecksBadRequest -*/ -type ListServicePolicyPostureChecksBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyPostureChecksBadRequest creates ListServicePolicyPostureChecksBadRequest with default headers values -func NewListServicePolicyPostureChecksBadRequest() *ListServicePolicyPostureChecksBadRequest { - - return &ListServicePolicyPostureChecksBadRequest{} -} - -// WithPayload adds the payload to the list service policy posture checks bad request response -func (o *ListServicePolicyPostureChecksBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePolicyPostureChecksBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy posture checks bad request response -func (o *ListServicePolicyPostureChecksBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyPostureChecksBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePolicyPostureChecksUnauthorizedCode is the HTTP code returned for type ListServicePolicyPostureChecksUnauthorized -const ListServicePolicyPostureChecksUnauthorizedCode int = 401 - -/*ListServicePolicyPostureChecksUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServicePolicyPostureChecksUnauthorized -*/ -type ListServicePolicyPostureChecksUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyPostureChecksUnauthorized creates ListServicePolicyPostureChecksUnauthorized with default headers values -func NewListServicePolicyPostureChecksUnauthorized() *ListServicePolicyPostureChecksUnauthorized { - - return &ListServicePolicyPostureChecksUnauthorized{} -} - -// WithPayload adds the payload to the list service policy posture checks unauthorized response -func (o *ListServicePolicyPostureChecksUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePolicyPostureChecksUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy posture checks unauthorized response -func (o *ListServicePolicyPostureChecksUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyPostureChecksUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_urlbuilder.go deleted file mode 100644 index 2afab4cae..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_posture_checks_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServicePolicyPostureChecksURL generates an URL for the list service policy posture checks operation -type ListServicePolicyPostureChecksURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePolicyPostureChecksURL) WithBasePath(bp string) *ListServicePolicyPostureChecksURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePolicyPostureChecksURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServicePolicyPostureChecksURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}/posture-checks" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServicePolicyPostureChecksURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServicePolicyPostureChecksURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServicePolicyPostureChecksURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServicePolicyPostureChecksURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServicePolicyPostureChecksURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServicePolicyPostureChecksURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServicePolicyPostureChecksURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_services.go b/rest_management_api_server/operations/service_policy/list_service_policy_services.go deleted file mode 100644 index eb2eb76bd..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_services.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListServicePolicyServicesHandlerFunc turns a function with the right signature into a list service policy services handler -type ListServicePolicyServicesHandlerFunc func(ListServicePolicyServicesParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListServicePolicyServicesHandlerFunc) Handle(params ListServicePolicyServicesParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListServicePolicyServicesHandler interface for that can handle valid list service policy services params -type ListServicePolicyServicesHandler interface { - Handle(ListServicePolicyServicesParams, interface{}) middleware.Responder -} - -// NewListServicePolicyServices creates a new http.Handler for the list service policy services operation -func NewListServicePolicyServices(ctx *middleware.Context, handler ListServicePolicyServicesHandler) *ListServicePolicyServices { - return &ListServicePolicyServices{Context: ctx, Handler: handler} -} - -/* ListServicePolicyServices swagger:route GET /service-policies/{id}/services Service Policy listServicePolicyServices - -List services a service policy affects - -Retrieves a list of service resources that are affected by a service policy; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListServicePolicyServices struct { - Context *middleware.Context - Handler ListServicePolicyServicesHandler -} - -func (o *ListServicePolicyServices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListServicePolicyServicesParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_services_parameters.go b/rest_management_api_server/operations/service_policy/list_service_policy_services_parameters.go deleted file mode 100644 index 30cacd0e6..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_services_parameters.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListServicePolicyServicesParams creates a new ListServicePolicyServicesParams object -// -// There are no default values defined in the spec. -func NewListServicePolicyServicesParams() ListServicePolicyServicesParams { - - return ListServicePolicyServicesParams{} -} - -// ListServicePolicyServicesParams contains all the bound params for the list service policy services operation -// typically these are obtained from a http.Request -// -// swagger:parameters listServicePolicyServices -type ListServicePolicyServicesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /*The id of the requested resource - Required: true - In: path - */ - ID string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListServicePolicyServicesParams() beforehand. -func (o *ListServicePolicyServicesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListServicePolicyServicesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *ListServicePolicyServicesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListServicePolicyServicesParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListServicePolicyServicesParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_services_responses.go b/rest_management_api_server/operations/service_policy/list_service_policy_services_responses.go deleted file mode 100644 index 847766195..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_services_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListServicePolicyServicesOKCode is the HTTP code returned for type ListServicePolicyServicesOK -const ListServicePolicyServicesOKCode int = 200 - -/*ListServicePolicyServicesOK A list of services - -swagger:response listServicePolicyServicesOK -*/ -type ListServicePolicyServicesOK struct { - - /* - In: Body - */ - Payload *rest_model.ListServicesEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyServicesOK creates ListServicePolicyServicesOK with default headers values -func NewListServicePolicyServicesOK() *ListServicePolicyServicesOK { - - return &ListServicePolicyServicesOK{} -} - -// WithPayload adds the payload to the list service policy services o k response -func (o *ListServicePolicyServicesOK) WithPayload(payload *rest_model.ListServicesEnvelope) *ListServicePolicyServicesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy services o k response -func (o *ListServicePolicyServicesOK) SetPayload(payload *rest_model.ListServicesEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyServicesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePolicyServicesBadRequestCode is the HTTP code returned for type ListServicePolicyServicesBadRequest -const ListServicePolicyServicesBadRequestCode int = 400 - -/*ListServicePolicyServicesBadRequest The requested resource does not exist - -swagger:response listServicePolicyServicesBadRequest -*/ -type ListServicePolicyServicesBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyServicesBadRequest creates ListServicePolicyServicesBadRequest with default headers values -func NewListServicePolicyServicesBadRequest() *ListServicePolicyServicesBadRequest { - - return &ListServicePolicyServicesBadRequest{} -} - -// WithPayload adds the payload to the list service policy services bad request response -func (o *ListServicePolicyServicesBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePolicyServicesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy services bad request response -func (o *ListServicePolicyServicesBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyServicesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListServicePolicyServicesUnauthorizedCode is the HTTP code returned for type ListServicePolicyServicesUnauthorized -const ListServicePolicyServicesUnauthorizedCode int = 401 - -/*ListServicePolicyServicesUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listServicePolicyServicesUnauthorized -*/ -type ListServicePolicyServicesUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListServicePolicyServicesUnauthorized creates ListServicePolicyServicesUnauthorized with default headers values -func NewListServicePolicyServicesUnauthorized() *ListServicePolicyServicesUnauthorized { - - return &ListServicePolicyServicesUnauthorized{} -} - -// WithPayload adds the payload to the list service policy services unauthorized response -func (o *ListServicePolicyServicesUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListServicePolicyServicesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list service policy services unauthorized response -func (o *ListServicePolicyServicesUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListServicePolicyServicesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/list_service_policy_services_urlbuilder.go b/rest_management_api_server/operations/service_policy/list_service_policy_services_urlbuilder.go deleted file mode 100644 index 344eba96f..000000000 --- a/rest_management_api_server/operations/service_policy/list_service_policy_services_urlbuilder.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// ListServicePolicyServicesURL generates an URL for the list service policy services operation -type ListServicePolicyServicesURL struct { - ID string - - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePolicyServicesURL) WithBasePath(bp string) *ListServicePolicyServicesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListServicePolicyServicesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListServicePolicyServicesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}/services" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on ListServicePolicyServicesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListServicePolicyServicesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListServicePolicyServicesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListServicePolicyServicesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListServicePolicyServicesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListServicePolicyServicesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListServicePolicyServicesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/patch_service_policy.go b/rest_management_api_server/operations/service_policy/patch_service_policy.go deleted file mode 100644 index 63025bf41..000000000 --- a/rest_management_api_server/operations/service_policy/patch_service_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchServicePolicyHandlerFunc turns a function with the right signature into a patch service policy handler -type PatchServicePolicyHandlerFunc func(PatchServicePolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchServicePolicyHandlerFunc) Handle(params PatchServicePolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchServicePolicyHandler interface for that can handle valid patch service policy params -type PatchServicePolicyHandler interface { - Handle(PatchServicePolicyParams, interface{}) middleware.Responder -} - -// NewPatchServicePolicy creates a new http.Handler for the patch service policy operation -func NewPatchServicePolicy(ctx *middleware.Context, handler PatchServicePolicyHandler) *PatchServicePolicy { - return &PatchServicePolicy{Context: ctx, Handler: handler} -} - -/* PatchServicePolicy swagger:route PATCH /service-policies/{id} Service Policy patchServicePolicy - -Update the supplied fields on a service policy - -Update the supplied fields on a service policy. Requires admin access. - -*/ -type PatchServicePolicy struct { - Context *middleware.Context - Handler PatchServicePolicyHandler -} - -func (o *PatchServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchServicePolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/patch_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/patch_service_policy_parameters.go deleted file mode 100644 index 292558ef0..000000000 --- a/rest_management_api_server/operations/service_policy/patch_service_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchServicePolicyParams creates a new PatchServicePolicyParams object -// -// There are no default values defined in the spec. -func NewPatchServicePolicyParams() PatchServicePolicyParams { - - return PatchServicePolicyParams{} -} - -// PatchServicePolicyParams contains all the bound params for the patch service policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchServicePolicy -type PatchServicePolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service policy patch object - Required: true - In: body - */ - Policy *rest_model.ServicePolicyPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchServicePolicyParams() beforehand. -func (o *PatchServicePolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServicePolicyPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchServicePolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/patch_service_policy_responses.go b/rest_management_api_server/operations/service_policy/patch_service_policy_responses.go deleted file mode 100644 index 91503a243..000000000 --- a/rest_management_api_server/operations/service_policy/patch_service_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchServicePolicyOKCode is the HTTP code returned for type PatchServicePolicyOK -const PatchServicePolicyOKCode int = 200 - -/*PatchServicePolicyOK The patch request was successful and the resource has been altered - -swagger:response patchServicePolicyOK -*/ -type PatchServicePolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchServicePolicyOK creates PatchServicePolicyOK with default headers values -func NewPatchServicePolicyOK() *PatchServicePolicyOK { - - return &PatchServicePolicyOK{} -} - -// WithPayload adds the payload to the patch service policy o k response -func (o *PatchServicePolicyOK) WithPayload(payload *rest_model.Empty) *PatchServicePolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service policy o k response -func (o *PatchServicePolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServicePolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServicePolicyBadRequestCode is the HTTP code returned for type PatchServicePolicyBadRequest -const PatchServicePolicyBadRequestCode int = 400 - -/*PatchServicePolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchServicePolicyBadRequest -*/ -type PatchServicePolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServicePolicyBadRequest creates PatchServicePolicyBadRequest with default headers values -func NewPatchServicePolicyBadRequest() *PatchServicePolicyBadRequest { - - return &PatchServicePolicyBadRequest{} -} - -// WithPayload adds the payload to the patch service policy bad request response -func (o *PatchServicePolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServicePolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service policy bad request response -func (o *PatchServicePolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServicePolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServicePolicyUnauthorizedCode is the HTTP code returned for type PatchServicePolicyUnauthorized -const PatchServicePolicyUnauthorizedCode int = 401 - -/*PatchServicePolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchServicePolicyUnauthorized -*/ -type PatchServicePolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServicePolicyUnauthorized creates PatchServicePolicyUnauthorized with default headers values -func NewPatchServicePolicyUnauthorized() *PatchServicePolicyUnauthorized { - - return &PatchServicePolicyUnauthorized{} -} - -// WithPayload adds the payload to the patch service policy unauthorized response -func (o *PatchServicePolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServicePolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service policy unauthorized response -func (o *PatchServicePolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServicePolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServicePolicyNotFoundCode is the HTTP code returned for type PatchServicePolicyNotFound -const PatchServicePolicyNotFoundCode int = 404 - -/*PatchServicePolicyNotFound The requested resource does not exist - -swagger:response patchServicePolicyNotFound -*/ -type PatchServicePolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchServicePolicyNotFound creates PatchServicePolicyNotFound with default headers values -func NewPatchServicePolicyNotFound() *PatchServicePolicyNotFound { - - return &PatchServicePolicyNotFound{} -} - -// WithPayload adds the payload to the patch service policy not found response -func (o *PatchServicePolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchServicePolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service policy not found response -func (o *PatchServicePolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServicePolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/patch_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/patch_service_policy_urlbuilder.go deleted file mode 100644 index b45e5f853..000000000 --- a/rest_management_api_server/operations/service_policy/patch_service_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchServicePolicyURL generates an URL for the patch service policy operation -type PatchServicePolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServicePolicyURL) WithBasePath(bp string) *PatchServicePolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServicePolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchServicePolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchServicePolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchServicePolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchServicePolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchServicePolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchServicePolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchServicePolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchServicePolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/service_policy/update_service_policy.go b/rest_management_api_server/operations/service_policy/update_service_policy.go deleted file mode 100644 index d48b42080..000000000 --- a/rest_management_api_server/operations/service_policy/update_service_policy.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateServicePolicyHandlerFunc turns a function with the right signature into a update service policy handler -type UpdateServicePolicyHandlerFunc func(UpdateServicePolicyParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateServicePolicyHandlerFunc) Handle(params UpdateServicePolicyParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateServicePolicyHandler interface for that can handle valid update service policy params -type UpdateServicePolicyHandler interface { - Handle(UpdateServicePolicyParams, interface{}) middleware.Responder -} - -// NewUpdateServicePolicy creates a new http.Handler for the update service policy operation -func NewUpdateServicePolicy(ctx *middleware.Context, handler UpdateServicePolicyHandler) *UpdateServicePolicy { - return &UpdateServicePolicy{Context: ctx, Handler: handler} -} - -/* UpdateServicePolicy swagger:route PUT /service-policies/{id} Service Policy updateServicePolicy - -Update all fields on a service policy - -Update all fields on a service policy by id. Requires admin access. - -*/ -type UpdateServicePolicy struct { - Context *middleware.Context - Handler UpdateServicePolicyHandler -} - -func (o *UpdateServicePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateServicePolicyParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/service_policy/update_service_policy_parameters.go b/rest_management_api_server/operations/service_policy/update_service_policy_parameters.go deleted file mode 100644 index 50e0d0564..000000000 --- a/rest_management_api_server/operations/service_policy/update_service_policy_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateServicePolicyParams creates a new UpdateServicePolicyParams object -// -// There are no default values defined in the spec. -func NewUpdateServicePolicyParams() UpdateServicePolicyParams { - - return UpdateServicePolicyParams{} -} - -// UpdateServicePolicyParams contains all the bound params for the update service policy operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateServicePolicy -type UpdateServicePolicyParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A service policy update object - Required: true - In: body - */ - Policy *rest_model.ServicePolicyUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateServicePolicyParams() beforehand. -func (o *UpdateServicePolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.ServicePolicyUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("policy", "body", "")) - } else { - res = append(res, errors.NewParseError("policy", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Policy = &body - } - } - } else { - res = append(res, errors.Required("policy", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateServicePolicyParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/service_policy/update_service_policy_responses.go b/rest_management_api_server/operations/service_policy/update_service_policy_responses.go deleted file mode 100644 index 38b0128a6..000000000 --- a/rest_management_api_server/operations/service_policy/update_service_policy_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateServicePolicyOKCode is the HTTP code returned for type UpdateServicePolicyOK -const UpdateServicePolicyOKCode int = 200 - -/*UpdateServicePolicyOK The update request was successful and the resource has been altered - -swagger:response updateServicePolicyOK -*/ -type UpdateServicePolicyOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateServicePolicyOK creates UpdateServicePolicyOK with default headers values -func NewUpdateServicePolicyOK() *UpdateServicePolicyOK { - - return &UpdateServicePolicyOK{} -} - -// WithPayload adds the payload to the update service policy o k response -func (o *UpdateServicePolicyOK) WithPayload(payload *rest_model.Empty) *UpdateServicePolicyOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service policy o k response -func (o *UpdateServicePolicyOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServicePolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServicePolicyBadRequestCode is the HTTP code returned for type UpdateServicePolicyBadRequest -const UpdateServicePolicyBadRequestCode int = 400 - -/*UpdateServicePolicyBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateServicePolicyBadRequest -*/ -type UpdateServicePolicyBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServicePolicyBadRequest creates UpdateServicePolicyBadRequest with default headers values -func NewUpdateServicePolicyBadRequest() *UpdateServicePolicyBadRequest { - - return &UpdateServicePolicyBadRequest{} -} - -// WithPayload adds the payload to the update service policy bad request response -func (o *UpdateServicePolicyBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServicePolicyBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service policy bad request response -func (o *UpdateServicePolicyBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServicePolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServicePolicyUnauthorizedCode is the HTTP code returned for type UpdateServicePolicyUnauthorized -const UpdateServicePolicyUnauthorizedCode int = 401 - -/*UpdateServicePolicyUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateServicePolicyUnauthorized -*/ -type UpdateServicePolicyUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServicePolicyUnauthorized creates UpdateServicePolicyUnauthorized with default headers values -func NewUpdateServicePolicyUnauthorized() *UpdateServicePolicyUnauthorized { - - return &UpdateServicePolicyUnauthorized{} -} - -// WithPayload adds the payload to the update service policy unauthorized response -func (o *UpdateServicePolicyUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServicePolicyUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service policy unauthorized response -func (o *UpdateServicePolicyUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServicePolicyUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServicePolicyNotFoundCode is the HTTP code returned for type UpdateServicePolicyNotFound -const UpdateServicePolicyNotFoundCode int = 404 - -/*UpdateServicePolicyNotFound The requested resource does not exist - -swagger:response updateServicePolicyNotFound -*/ -type UpdateServicePolicyNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateServicePolicyNotFound creates UpdateServicePolicyNotFound with default headers values -func NewUpdateServicePolicyNotFound() *UpdateServicePolicyNotFound { - - return &UpdateServicePolicyNotFound{} -} - -// WithPayload adds the payload to the update service policy not found response -func (o *UpdateServicePolicyNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateServicePolicyNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service policy not found response -func (o *UpdateServicePolicyNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServicePolicyNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/service_policy/update_service_policy_urlbuilder.go b/rest_management_api_server/operations/service_policy/update_service_policy_urlbuilder.go deleted file mode 100644 index ead690128..000000000 --- a/rest_management_api_server/operations/service_policy/update_service_policy_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package service_policy - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateServicePolicyURL generates an URL for the update service policy operation -type UpdateServicePolicyURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServicePolicyURL) WithBasePath(bp string) *UpdateServicePolicyURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServicePolicyURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateServicePolicyURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-policies/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateServicePolicyURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateServicePolicyURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateServicePolicyURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateServicePolicyURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateServicePolicyURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateServicePolicyURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateServicePolicyURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/session/delete_session.go b/rest_management_api_server/operations/session/delete_session.go deleted file mode 100644 index 9caaa2428..000000000 --- a/rest_management_api_server/operations/session/delete_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteSessionHandlerFunc turns a function with the right signature into a delete session handler -type DeleteSessionHandlerFunc func(DeleteSessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteSessionHandlerFunc) Handle(params DeleteSessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteSessionHandler interface for that can handle valid delete session params -type DeleteSessionHandler interface { - Handle(DeleteSessionParams, interface{}) middleware.Responder -} - -// NewDeleteSession creates a new http.Handler for the delete session operation -func NewDeleteSession(ctx *middleware.Context, handler DeleteSessionHandler) *DeleteSession { - return &DeleteSession{Context: ctx, Handler: handler} -} - -/* DeleteSession swagger:route DELETE /sessions/{id} Session deleteSession - -Delete a session - -Delete a session by id. Requires admin access. - -*/ -type DeleteSession struct { - Context *middleware.Context - Handler DeleteSessionHandler -} - -func (o *DeleteSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteSessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/session/delete_session_parameters.go b/rest_management_api_server/operations/session/delete_session_parameters.go deleted file mode 100644 index 89278b349..000000000 --- a/rest_management_api_server/operations/session/delete_session_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteSessionParams creates a new DeleteSessionParams object -// -// There are no default values defined in the spec. -func NewDeleteSessionParams() DeleteSessionParams { - - return DeleteSessionParams{} -} - -// DeleteSessionParams contains all the bound params for the delete session operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteSession -type DeleteSessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteSessionParams() beforehand. -func (o *DeleteSessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteSessionParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/session/delete_session_responses.go b/rest_management_api_server/operations/session/delete_session_responses.go deleted file mode 100644 index 3b9d8156d..000000000 --- a/rest_management_api_server/operations/session/delete_session_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteSessionOKCode is the HTTP code returned for type DeleteSessionOK -const DeleteSessionOKCode int = 200 - -/*DeleteSessionOK The delete request was successful and the resource has been removed - -swagger:response deleteSessionOK -*/ -type DeleteSessionOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteSessionOK creates DeleteSessionOK with default headers values -func NewDeleteSessionOK() *DeleteSessionOK { - - return &DeleteSessionOK{} -} - -// WithPayload adds the payload to the delete session o k response -func (o *DeleteSessionOK) WithPayload(payload *rest_model.Empty) *DeleteSessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session o k response -func (o *DeleteSessionOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteSessionBadRequestCode is the HTTP code returned for type DeleteSessionBadRequest -const DeleteSessionBadRequestCode int = 400 - -/*DeleteSessionBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteSessionBadRequest -*/ -type DeleteSessionBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteSessionBadRequest creates DeleteSessionBadRequest with default headers values -func NewDeleteSessionBadRequest() *DeleteSessionBadRequest { - - return &DeleteSessionBadRequest{} -} - -// WithPayload adds the payload to the delete session bad request response -func (o *DeleteSessionBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteSessionBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session bad request response -func (o *DeleteSessionBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteSessionUnauthorizedCode is the HTTP code returned for type DeleteSessionUnauthorized -const DeleteSessionUnauthorizedCode int = 401 - -/*DeleteSessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteSessionUnauthorized -*/ -type DeleteSessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteSessionUnauthorized creates DeleteSessionUnauthorized with default headers values -func NewDeleteSessionUnauthorized() *DeleteSessionUnauthorized { - - return &DeleteSessionUnauthorized{} -} - -// WithPayload adds the payload to the delete session unauthorized response -func (o *DeleteSessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteSessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session unauthorized response -func (o *DeleteSessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteSessionConflictCode is the HTTP code returned for type DeleteSessionConflict -const DeleteSessionConflictCode int = 409 - -/*DeleteSessionConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteSessionConflict -*/ -type DeleteSessionConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteSessionConflict creates DeleteSessionConflict with default headers values -func NewDeleteSessionConflict() *DeleteSessionConflict { - - return &DeleteSessionConflict{} -} - -// WithPayload adds the payload to the delete session conflict response -func (o *DeleteSessionConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteSessionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete session conflict response -func (o *DeleteSessionConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteSessionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/session/delete_session_urlbuilder.go b/rest_management_api_server/operations/session/delete_session_urlbuilder.go deleted file mode 100644 index 7a23a3ef4..000000000 --- a/rest_management_api_server/operations/session/delete_session_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteSessionURL generates an URL for the delete session operation -type DeleteSessionURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteSessionURL) WithBasePath(bp string) *DeleteSessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteSessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteSessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteSessionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteSessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteSessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteSessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteSessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteSessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteSessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/session/detail_session.go b/rest_management_api_server/operations/session/detail_session.go deleted file mode 100644 index 07d21759e..000000000 --- a/rest_management_api_server/operations/session/detail_session.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSessionHandlerFunc turns a function with the right signature into a detail session handler -type DetailSessionHandlerFunc func(DetailSessionParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSessionHandlerFunc) Handle(params DetailSessionParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailSessionHandler interface for that can handle valid detail session params -type DetailSessionHandler interface { - Handle(DetailSessionParams, interface{}) middleware.Responder -} - -// NewDetailSession creates a new http.Handler for the detail session operation -func NewDetailSession(ctx *middleware.Context, handler DetailSessionHandler) *DetailSession { - return &DetailSession{Context: ctx, Handler: handler} -} - -/* DetailSession swagger:route GET /sessions/{id} Session detailSession - -Retrieves a single session - -Retrieves a single session by id. Requires admin access. - -*/ -type DetailSession struct { - Context *middleware.Context - Handler DetailSessionHandler -} - -func (o *DetailSession) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSessionParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/session/detail_session_parameters.go b/rest_management_api_server/operations/session/detail_session_parameters.go deleted file mode 100644 index 3d15a3c8a..000000000 --- a/rest_management_api_server/operations/session/detail_session_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSessionParams creates a new DetailSessionParams object -// -// There are no default values defined in the spec. -func NewDetailSessionParams() DetailSessionParams { - - return DetailSessionParams{} -} - -// DetailSessionParams contains all the bound params for the detail session operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSession -type DetailSessionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSessionParams() beforehand. -func (o *DetailSessionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSessionParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/session/detail_session_responses.go b/rest_management_api_server/operations/session/detail_session_responses.go deleted file mode 100644 index fb6db04bb..000000000 --- a/rest_management_api_server/operations/session/detail_session_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSessionOKCode is the HTTP code returned for type DetailSessionOK -const DetailSessionOKCode int = 200 - -/*DetailSessionOK A single session - -swagger:response detailSessionOK -*/ -type DetailSessionOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSessionManagementEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionOK creates DetailSessionOK with default headers values -func NewDetailSessionOK() *DetailSessionOK { - - return &DetailSessionOK{} -} - -// WithPayload adds the payload to the detail session o k response -func (o *DetailSessionOK) WithPayload(payload *rest_model.DetailSessionManagementEnvelope) *DetailSessionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session o k response -func (o *DetailSessionOK) SetPayload(payload *rest_model.DetailSessionManagementEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailSessionUnauthorizedCode is the HTTP code returned for type DetailSessionUnauthorized -const DetailSessionUnauthorizedCode int = 401 - -/*DetailSessionUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailSessionUnauthorized -*/ -type DetailSessionUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionUnauthorized creates DetailSessionUnauthorized with default headers values -func NewDetailSessionUnauthorized() *DetailSessionUnauthorized { - - return &DetailSessionUnauthorized{} -} - -// WithPayload adds the payload to the detail session unauthorized response -func (o *DetailSessionUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailSessionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session unauthorized response -func (o *DetailSessionUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailSessionNotFoundCode is the HTTP code returned for type DetailSessionNotFound -const DetailSessionNotFoundCode int = 404 - -/*DetailSessionNotFound The requested resource does not exist - -swagger:response detailSessionNotFound -*/ -type DetailSessionNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionNotFound creates DetailSessionNotFound with default headers values -func NewDetailSessionNotFound() *DetailSessionNotFound { - - return &DetailSessionNotFound{} -} - -// WithPayload adds the payload to the detail session not found response -func (o *DetailSessionNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailSessionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session not found response -func (o *DetailSessionNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/session/detail_session_route_path.go b/rest_management_api_server/operations/session/detail_session_route_path.go deleted file mode 100644 index 275cc1d49..000000000 --- a/rest_management_api_server/operations/session/detail_session_route_path.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailSessionRoutePathHandlerFunc turns a function with the right signature into a detail session route path handler -type DetailSessionRoutePathHandlerFunc func(DetailSessionRoutePathParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailSessionRoutePathHandlerFunc) Handle(params DetailSessionRoutePathParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailSessionRoutePathHandler interface for that can handle valid detail session route path params -type DetailSessionRoutePathHandler interface { - Handle(DetailSessionRoutePathParams, interface{}) middleware.Responder -} - -// NewDetailSessionRoutePath creates a new http.Handler for the detail session route path operation -func NewDetailSessionRoutePath(ctx *middleware.Context, handler DetailSessionRoutePathHandler) *DetailSessionRoutePath { - return &DetailSessionRoutePath{Context: ctx, Handler: handler} -} - -/* DetailSessionRoutePath swagger:route GET /sessions/{id}/route-path Session detailSessionRoutePath - -Retrieves a single session's router path - -Retrieves a single session's route path by id. Requires admin access. - -*/ -type DetailSessionRoutePath struct { - Context *middleware.Context - Handler DetailSessionRoutePathHandler -} - -func (o *DetailSessionRoutePath) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailSessionRoutePathParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/session/detail_session_route_path_parameters.go b/rest_management_api_server/operations/session/detail_session_route_path_parameters.go deleted file mode 100644 index dd22eec6b..000000000 --- a/rest_management_api_server/operations/session/detail_session_route_path_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailSessionRoutePathParams creates a new DetailSessionRoutePathParams object -// -// There are no default values defined in the spec. -func NewDetailSessionRoutePathParams() DetailSessionRoutePathParams { - - return DetailSessionRoutePathParams{} -} - -// DetailSessionRoutePathParams contains all the bound params for the detail session route path operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailSessionRoutePath -type DetailSessionRoutePathParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailSessionRoutePathParams() beforehand. -func (o *DetailSessionRoutePathParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailSessionRoutePathParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/session/detail_session_route_path_responses.go b/rest_management_api_server/operations/session/detail_session_route_path_responses.go deleted file mode 100644 index fd084bc2d..000000000 --- a/rest_management_api_server/operations/session/detail_session_route_path_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailSessionRoutePathOKCode is the HTTP code returned for type DetailSessionRoutePathOK -const DetailSessionRoutePathOKCode int = 200 - -/*DetailSessionRoutePathOK A single session's route path - -swagger:response detailSessionRoutePathOK -*/ -type DetailSessionRoutePathOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailSessionRoutePathEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionRoutePathOK creates DetailSessionRoutePathOK with default headers values -func NewDetailSessionRoutePathOK() *DetailSessionRoutePathOK { - - return &DetailSessionRoutePathOK{} -} - -// WithPayload adds the payload to the detail session route path o k response -func (o *DetailSessionRoutePathOK) WithPayload(payload *rest_model.DetailSessionRoutePathEnvelope) *DetailSessionRoutePathOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session route path o k response -func (o *DetailSessionRoutePathOK) SetPayload(payload *rest_model.DetailSessionRoutePathEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionRoutePathOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailSessionRoutePathUnauthorizedCode is the HTTP code returned for type DetailSessionRoutePathUnauthorized -const DetailSessionRoutePathUnauthorizedCode int = 401 - -/*DetailSessionRoutePathUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailSessionRoutePathUnauthorized -*/ -type DetailSessionRoutePathUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionRoutePathUnauthorized creates DetailSessionRoutePathUnauthorized with default headers values -func NewDetailSessionRoutePathUnauthorized() *DetailSessionRoutePathUnauthorized { - - return &DetailSessionRoutePathUnauthorized{} -} - -// WithPayload adds the payload to the detail session route path unauthorized response -func (o *DetailSessionRoutePathUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailSessionRoutePathUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session route path unauthorized response -func (o *DetailSessionRoutePathUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionRoutePathUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailSessionRoutePathNotFoundCode is the HTTP code returned for type DetailSessionRoutePathNotFound -const DetailSessionRoutePathNotFoundCode int = 404 - -/*DetailSessionRoutePathNotFound The requested resource does not exist - -swagger:response detailSessionRoutePathNotFound -*/ -type DetailSessionRoutePathNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailSessionRoutePathNotFound creates DetailSessionRoutePathNotFound with default headers values -func NewDetailSessionRoutePathNotFound() *DetailSessionRoutePathNotFound { - - return &DetailSessionRoutePathNotFound{} -} - -// WithPayload adds the payload to the detail session route path not found response -func (o *DetailSessionRoutePathNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailSessionRoutePathNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail session route path not found response -func (o *DetailSessionRoutePathNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailSessionRoutePathNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/session/detail_session_route_path_urlbuilder.go b/rest_management_api_server/operations/session/detail_session_route_path_urlbuilder.go deleted file mode 100644 index 5413ec632..000000000 --- a/rest_management_api_server/operations/session/detail_session_route_path_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSessionRoutePathURL generates an URL for the detail session route path operation -type DetailSessionRoutePathURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSessionRoutePathURL) WithBasePath(bp string) *DetailSessionRoutePathURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSessionRoutePathURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSessionRoutePathURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions/{id}/route-path" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSessionRoutePathURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSessionRoutePathURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSessionRoutePathURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSessionRoutePathURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSessionRoutePathURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSessionRoutePathURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSessionRoutePathURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/session/detail_session_urlbuilder.go b/rest_management_api_server/operations/session/detail_session_urlbuilder.go deleted file mode 100644 index e4438d5cb..000000000 --- a/rest_management_api_server/operations/session/detail_session_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailSessionURL generates an URL for the detail session operation -type DetailSessionURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSessionURL) WithBasePath(bp string) *DetailSessionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailSessionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailSessionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailSessionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailSessionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailSessionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailSessionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailSessionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailSessionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailSessionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/session/list_sessions.go b/rest_management_api_server/operations/session/list_sessions.go deleted file mode 100644 index bb55fee9f..000000000 --- a/rest_management_api_server/operations/session/list_sessions.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListSessionsHandlerFunc turns a function with the right signature into a list sessions handler -type ListSessionsHandlerFunc func(ListSessionsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListSessionsHandlerFunc) Handle(params ListSessionsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListSessionsHandler interface for that can handle valid list sessions params -type ListSessionsHandler interface { - Handle(ListSessionsParams, interface{}) middleware.Responder -} - -// NewListSessions creates a new http.Handler for the list sessions operation -func NewListSessions(ctx *middleware.Context, handler ListSessionsHandler) *ListSessions { - return &ListSessions{Context: ctx, Handler: handler} -} - -/* ListSessions swagger:route GET /sessions Session listSessions - -List sessions - -Retrieves a list of active sessions resources; supports filtering, sorting, and pagination. Requires admin access. - -Sessions are tied to an API session and are moved when an API session times out or logs out. Active sessions -(i.e. Ziti SDK connected to an edge router) will keep the session and API session marked as active. - - -*/ -type ListSessions struct { - Context *middleware.Context - Handler ListSessionsHandler -} - -func (o *ListSessions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListSessionsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/session/list_sessions_parameters.go b/rest_management_api_server/operations/session/list_sessions_parameters.go deleted file mode 100644 index 02d7cfd02..000000000 --- a/rest_management_api_server/operations/session/list_sessions_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListSessionsParams creates a new ListSessionsParams object -// -// There are no default values defined in the spec. -func NewListSessionsParams() ListSessionsParams { - - return ListSessionsParams{} -} - -// ListSessionsParams contains all the bound params for the list sessions operation -// typically these are obtained from a http.Request -// -// swagger:parameters listSessions -type ListSessionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListSessionsParams() beforehand. -func (o *ListSessionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListSessionsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListSessionsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListSessionsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/session/list_sessions_responses.go b/rest_management_api_server/operations/session/list_sessions_responses.go deleted file mode 100644 index 9eeeeb928..000000000 --- a/rest_management_api_server/operations/session/list_sessions_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListSessionsOKCode is the HTTP code returned for type ListSessionsOK -const ListSessionsOKCode int = 200 - -/*ListSessionsOK A list of sessions - -swagger:response listSessionsOK -*/ -type ListSessionsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListSessionsManagementEnvelope `json:"body,omitempty"` -} - -// NewListSessionsOK creates ListSessionsOK with default headers values -func NewListSessionsOK() *ListSessionsOK { - - return &ListSessionsOK{} -} - -// WithPayload adds the payload to the list sessions o k response -func (o *ListSessionsOK) WithPayload(payload *rest_model.ListSessionsManagementEnvelope) *ListSessionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list sessions o k response -func (o *ListSessionsOK) SetPayload(payload *rest_model.ListSessionsManagementEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSessionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListSessionsBadRequestCode is the HTTP code returned for type ListSessionsBadRequest -const ListSessionsBadRequestCode int = 400 - -/*ListSessionsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listSessionsBadRequest -*/ -type ListSessionsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListSessionsBadRequest creates ListSessionsBadRequest with default headers values -func NewListSessionsBadRequest() *ListSessionsBadRequest { - - return &ListSessionsBadRequest{} -} - -// WithPayload adds the payload to the list sessions bad request response -func (o *ListSessionsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListSessionsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list sessions bad request response -func (o *ListSessionsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSessionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListSessionsUnauthorizedCode is the HTTP code returned for type ListSessionsUnauthorized -const ListSessionsUnauthorizedCode int = 401 - -/*ListSessionsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listSessionsUnauthorized -*/ -type ListSessionsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListSessionsUnauthorized creates ListSessionsUnauthorized with default headers values -func NewListSessionsUnauthorized() *ListSessionsUnauthorized { - - return &ListSessionsUnauthorized{} -} - -// WithPayload adds the payload to the list sessions unauthorized response -func (o *ListSessionsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListSessionsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list sessions unauthorized response -func (o *ListSessionsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListSessionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/session/list_sessions_urlbuilder.go b/rest_management_api_server/operations/session/list_sessions_urlbuilder.go deleted file mode 100644 index f311d3746..000000000 --- a/rest_management_api_server/operations/session/list_sessions_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package session - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListSessionsURL generates an URL for the list sessions operation -type ListSessionsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSessionsURL) WithBasePath(bp string) *ListSessionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListSessionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListSessionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/sessions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListSessionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListSessionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListSessionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListSessionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListSessionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListSessionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/terminator/create_terminator.go b/rest_management_api_server/operations/terminator/create_terminator.go deleted file mode 100644 index f657442a0..000000000 --- a/rest_management_api_server/operations/terminator/create_terminator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateTerminatorHandlerFunc turns a function with the right signature into a create terminator handler -type CreateTerminatorHandlerFunc func(CreateTerminatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateTerminatorHandlerFunc) Handle(params CreateTerminatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// CreateTerminatorHandler interface for that can handle valid create terminator params -type CreateTerminatorHandler interface { - Handle(CreateTerminatorParams, interface{}) middleware.Responder -} - -// NewCreateTerminator creates a new http.Handler for the create terminator operation -func NewCreateTerminator(ctx *middleware.Context, handler CreateTerminatorHandler) *CreateTerminator { - return &CreateTerminator{Context: ctx, Handler: handler} -} - -/* CreateTerminator swagger:route POST /terminators Terminator createTerminator - -Create a terminator resource - -Create a terminator resource. Requires admin access. - -*/ -type CreateTerminator struct { - Context *middleware.Context - Handler CreateTerminatorHandler -} - -func (o *CreateTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateTerminatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/terminator/create_terminator_parameters.go b/rest_management_api_server/operations/terminator/create_terminator_parameters.go deleted file mode 100644 index 44b37c99c..000000000 --- a/rest_management_api_server/operations/terminator/create_terminator_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewCreateTerminatorParams creates a new CreateTerminatorParams object -// -// There are no default values defined in the spec. -func NewCreateTerminatorParams() CreateTerminatorParams { - - return CreateTerminatorParams{} -} - -// CreateTerminatorParams contains all the bound params for the create terminator operation -// typically these are obtained from a http.Request -// -// swagger:parameters createTerminator -type CreateTerminatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A terminator to create - Required: true - In: body - */ - Terminator *rest_model.TerminatorCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateTerminatorParams() beforehand. -func (o *CreateTerminatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.TerminatorCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("terminator", "body", "")) - } else { - res = append(res, errors.NewParseError("terminator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Terminator = &body - } - } - } else { - res = append(res, errors.Required("terminator", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_management_api_server/operations/terminator/create_terminator_responses.go b/rest_management_api_server/operations/terminator/create_terminator_responses.go deleted file mode 100644 index dceedb44a..000000000 --- a/rest_management_api_server/operations/terminator/create_terminator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// CreateTerminatorCreatedCode is the HTTP code returned for type CreateTerminatorCreated -const CreateTerminatorCreatedCode int = 201 - -/*CreateTerminatorCreated The create request was successful and the resource has been added at the following location - -swagger:response createTerminatorCreated -*/ -type CreateTerminatorCreated struct { - - /* - In: Body - */ - Payload *rest_model.CreateEnvelope `json:"body,omitempty"` -} - -// NewCreateTerminatorCreated creates CreateTerminatorCreated with default headers values -func NewCreateTerminatorCreated() *CreateTerminatorCreated { - - return &CreateTerminatorCreated{} -} - -// WithPayload adds the payload to the create terminator created response -func (o *CreateTerminatorCreated) WithPayload(payload *rest_model.CreateEnvelope) *CreateTerminatorCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create terminator created response -func (o *CreateTerminatorCreated) SetPayload(payload *rest_model.CreateEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateTerminatorCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateTerminatorBadRequestCode is the HTTP code returned for type CreateTerminatorBadRequest -const CreateTerminatorBadRequestCode int = 400 - -/*CreateTerminatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response createTerminatorBadRequest -*/ -type CreateTerminatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateTerminatorBadRequest creates CreateTerminatorBadRequest with default headers values -func NewCreateTerminatorBadRequest() *CreateTerminatorBadRequest { - - return &CreateTerminatorBadRequest{} -} - -// WithPayload adds the payload to the create terminator bad request response -func (o *CreateTerminatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateTerminatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create terminator bad request response -func (o *CreateTerminatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateTerminatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateTerminatorUnauthorizedCode is the HTTP code returned for type CreateTerminatorUnauthorized -const CreateTerminatorUnauthorizedCode int = 401 - -/*CreateTerminatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response createTerminatorUnauthorized -*/ -type CreateTerminatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewCreateTerminatorUnauthorized creates CreateTerminatorUnauthorized with default headers values -func NewCreateTerminatorUnauthorized() *CreateTerminatorUnauthorized { - - return &CreateTerminatorUnauthorized{} -} - -// WithPayload adds the payload to the create terminator unauthorized response -func (o *CreateTerminatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *CreateTerminatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create terminator unauthorized response -func (o *CreateTerminatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateTerminatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/terminator/create_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/create_terminator_urlbuilder.go deleted file mode 100644 index d6401d61e..000000000 --- a/rest_management_api_server/operations/terminator/create_terminator_urlbuilder.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateTerminatorURL generates an URL for the create terminator operation -type CreateTerminatorURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateTerminatorURL) WithBasePath(bp string) *CreateTerminatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateTerminatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateTerminatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/terminators" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateTerminatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateTerminatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateTerminatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateTerminatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateTerminatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateTerminatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/terminator/delete_terminator.go b/rest_management_api_server/operations/terminator/delete_terminator.go deleted file mode 100644 index f7ec3d380..000000000 --- a/rest_management_api_server/operations/terminator/delete_terminator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteTerminatorHandlerFunc turns a function with the right signature into a delete terminator handler -type DeleteTerminatorHandlerFunc func(DeleteTerminatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteTerminatorHandlerFunc) Handle(params DeleteTerminatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DeleteTerminatorHandler interface for that can handle valid delete terminator params -type DeleteTerminatorHandler interface { - Handle(DeleteTerminatorParams, interface{}) middleware.Responder -} - -// NewDeleteTerminator creates a new http.Handler for the delete terminator operation -func NewDeleteTerminator(ctx *middleware.Context, handler DeleteTerminatorHandler) *DeleteTerminator { - return &DeleteTerminator{Context: ctx, Handler: handler} -} - -/* DeleteTerminator swagger:route DELETE /terminators/{id} Terminator deleteTerminator - -Delete a terminator - -Delete a terminator by id. Requires admin access. - -*/ -type DeleteTerminator struct { - Context *middleware.Context - Handler DeleteTerminatorHandler -} - -func (o *DeleteTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteTerminatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/terminator/delete_terminator_parameters.go b/rest_management_api_server/operations/terminator/delete_terminator_parameters.go deleted file mode 100644 index 25e697f5c..000000000 --- a/rest_management_api_server/operations/terminator/delete_terminator_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDeleteTerminatorParams creates a new DeleteTerminatorParams object -// -// There are no default values defined in the spec. -func NewDeleteTerminatorParams() DeleteTerminatorParams { - - return DeleteTerminatorParams{} -} - -// DeleteTerminatorParams contains all the bound params for the delete terminator operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteTerminator -type DeleteTerminatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteTerminatorParams() beforehand. -func (o *DeleteTerminatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DeleteTerminatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/terminator/delete_terminator_responses.go b/rest_management_api_server/operations/terminator/delete_terminator_responses.go deleted file mode 100644 index aee0e5f33..000000000 --- a/rest_management_api_server/operations/terminator/delete_terminator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DeleteTerminatorOKCode is the HTTP code returned for type DeleteTerminatorOK -const DeleteTerminatorOKCode int = 200 - -/*DeleteTerminatorOK The delete request was successful and the resource has been removed - -swagger:response deleteTerminatorOK -*/ -type DeleteTerminatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewDeleteTerminatorOK creates DeleteTerminatorOK with default headers values -func NewDeleteTerminatorOK() *DeleteTerminatorOK { - - return &DeleteTerminatorOK{} -} - -// WithPayload adds the payload to the delete terminator o k response -func (o *DeleteTerminatorOK) WithPayload(payload *rest_model.Empty) *DeleteTerminatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete terminator o k response -func (o *DeleteTerminatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTerminatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteTerminatorBadRequestCode is the HTTP code returned for type DeleteTerminatorBadRequest -const DeleteTerminatorBadRequestCode int = 400 - -/*DeleteTerminatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response deleteTerminatorBadRequest -*/ -type DeleteTerminatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteTerminatorBadRequest creates DeleteTerminatorBadRequest with default headers values -func NewDeleteTerminatorBadRequest() *DeleteTerminatorBadRequest { - - return &DeleteTerminatorBadRequest{} -} - -// WithPayload adds the payload to the delete terminator bad request response -func (o *DeleteTerminatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteTerminatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete terminator bad request response -func (o *DeleteTerminatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTerminatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteTerminatorUnauthorizedCode is the HTTP code returned for type DeleteTerminatorUnauthorized -const DeleteTerminatorUnauthorizedCode int = 401 - -/*DeleteTerminatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response deleteTerminatorUnauthorized -*/ -type DeleteTerminatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteTerminatorUnauthorized creates DeleteTerminatorUnauthorized with default headers values -func NewDeleteTerminatorUnauthorized() *DeleteTerminatorUnauthorized { - - return &DeleteTerminatorUnauthorized{} -} - -// WithPayload adds the payload to the delete terminator unauthorized response -func (o *DeleteTerminatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteTerminatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete terminator unauthorized response -func (o *DeleteTerminatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTerminatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteTerminatorConflictCode is the HTTP code returned for type DeleteTerminatorConflict -const DeleteTerminatorConflictCode int = 409 - -/*DeleteTerminatorConflict The resource requested to be removed/altered cannot be as it is referenced by another object. - -swagger:response deleteTerminatorConflict -*/ -type DeleteTerminatorConflict struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDeleteTerminatorConflict creates DeleteTerminatorConflict with default headers values -func NewDeleteTerminatorConflict() *DeleteTerminatorConflict { - - return &DeleteTerminatorConflict{} -} - -// WithPayload adds the payload to the delete terminator conflict response -func (o *DeleteTerminatorConflict) WithPayload(payload *rest_model.APIErrorEnvelope) *DeleteTerminatorConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete terminator conflict response -func (o *DeleteTerminatorConflict) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteTerminatorConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/terminator/delete_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/delete_terminator_urlbuilder.go deleted file mode 100644 index d7306ba4b..000000000 --- a/rest_management_api_server/operations/terminator/delete_terminator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DeleteTerminatorURL generates an URL for the delete terminator operation -type DeleteTerminatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteTerminatorURL) WithBasePath(bp string) *DeleteTerminatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteTerminatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteTerminatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/terminators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DeleteTerminatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteTerminatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteTerminatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteTerminatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteTerminatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteTerminatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteTerminatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/terminator/detail_terminator.go b/rest_management_api_server/operations/terminator/detail_terminator.go deleted file mode 100644 index 0a9a1e847..000000000 --- a/rest_management_api_server/operations/terminator/detail_terminator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DetailTerminatorHandlerFunc turns a function with the right signature into a detail terminator handler -type DetailTerminatorHandlerFunc func(DetailTerminatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn DetailTerminatorHandlerFunc) Handle(params DetailTerminatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// DetailTerminatorHandler interface for that can handle valid detail terminator params -type DetailTerminatorHandler interface { - Handle(DetailTerminatorParams, interface{}) middleware.Responder -} - -// NewDetailTerminator creates a new http.Handler for the detail terminator operation -func NewDetailTerminator(ctx *middleware.Context, handler DetailTerminatorHandler) *DetailTerminator { - return &DetailTerminator{Context: ctx, Handler: handler} -} - -/* DetailTerminator swagger:route GET /terminators/{id} Terminator detailTerminator - -Retrieves a single terminator - -Retrieves a single terminator by id. Requires admin access. - -*/ -type DetailTerminator struct { - Context *middleware.Context - Handler DetailTerminatorHandler -} - -func (o *DetailTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDetailTerminatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/terminator/detail_terminator_parameters.go b/rest_management_api_server/operations/terminator/detail_terminator_parameters.go deleted file mode 100644 index 1df8cd1e9..000000000 --- a/rest_management_api_server/operations/terminator/detail_terminator_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewDetailTerminatorParams creates a new DetailTerminatorParams object -// -// There are no default values defined in the spec. -func NewDetailTerminatorParams() DetailTerminatorParams { - - return DetailTerminatorParams{} -} - -// DetailTerminatorParams contains all the bound params for the detail terminator operation -// typically these are obtained from a http.Request -// -// swagger:parameters detailTerminator -type DetailTerminatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDetailTerminatorParams() beforehand. -func (o *DetailTerminatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *DetailTerminatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/terminator/detail_terminator_responses.go b/rest_management_api_server/operations/terminator/detail_terminator_responses.go deleted file mode 100644 index d21540057..000000000 --- a/rest_management_api_server/operations/terminator/detail_terminator_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// DetailTerminatorOKCode is the HTTP code returned for type DetailTerminatorOK -const DetailTerminatorOKCode int = 200 - -/*DetailTerminatorOK A single terminator - -swagger:response detailTerminatorOK -*/ -type DetailTerminatorOK struct { - - /* - In: Body - */ - Payload *rest_model.DetailTerminatorEnvelope `json:"body,omitempty"` -} - -// NewDetailTerminatorOK creates DetailTerminatorOK with default headers values -func NewDetailTerminatorOK() *DetailTerminatorOK { - - return &DetailTerminatorOK{} -} - -// WithPayload adds the payload to the detail terminator o k response -func (o *DetailTerminatorOK) WithPayload(payload *rest_model.DetailTerminatorEnvelope) *DetailTerminatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail terminator o k response -func (o *DetailTerminatorOK) SetPayload(payload *rest_model.DetailTerminatorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailTerminatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailTerminatorUnauthorizedCode is the HTTP code returned for type DetailTerminatorUnauthorized -const DetailTerminatorUnauthorizedCode int = 401 - -/*DetailTerminatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response detailTerminatorUnauthorized -*/ -type DetailTerminatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailTerminatorUnauthorized creates DetailTerminatorUnauthorized with default headers values -func NewDetailTerminatorUnauthorized() *DetailTerminatorUnauthorized { - - return &DetailTerminatorUnauthorized{} -} - -// WithPayload adds the payload to the detail terminator unauthorized response -func (o *DetailTerminatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailTerminatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail terminator unauthorized response -func (o *DetailTerminatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailTerminatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DetailTerminatorNotFoundCode is the HTTP code returned for type DetailTerminatorNotFound -const DetailTerminatorNotFoundCode int = 404 - -/*DetailTerminatorNotFound The requested resource does not exist - -swagger:response detailTerminatorNotFound -*/ -type DetailTerminatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewDetailTerminatorNotFound creates DetailTerminatorNotFound with default headers values -func NewDetailTerminatorNotFound() *DetailTerminatorNotFound { - - return &DetailTerminatorNotFound{} -} - -// WithPayload adds the payload to the detail terminator not found response -func (o *DetailTerminatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *DetailTerminatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the detail terminator not found response -func (o *DetailTerminatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DetailTerminatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/terminator/detail_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/detail_terminator_urlbuilder.go deleted file mode 100644 index 5f280e71c..000000000 --- a/rest_management_api_server/operations/terminator/detail_terminator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DetailTerminatorURL generates an URL for the detail terminator operation -type DetailTerminatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailTerminatorURL) WithBasePath(bp string) *DetailTerminatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DetailTerminatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DetailTerminatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/terminators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on DetailTerminatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DetailTerminatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DetailTerminatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DetailTerminatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DetailTerminatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DetailTerminatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DetailTerminatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/terminator/list_terminators.go b/rest_management_api_server/operations/terminator/list_terminators.go deleted file mode 100644 index 37b51d3b1..000000000 --- a/rest_management_api_server/operations/terminator/list_terminators.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListTerminatorsHandlerFunc turns a function with the right signature into a list terminators handler -type ListTerminatorsHandlerFunc func(ListTerminatorsParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListTerminatorsHandlerFunc) Handle(params ListTerminatorsParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// ListTerminatorsHandler interface for that can handle valid list terminators params -type ListTerminatorsHandler interface { - Handle(ListTerminatorsParams, interface{}) middleware.Responder -} - -// NewListTerminators creates a new http.Handler for the list terminators operation -func NewListTerminators(ctx *middleware.Context, handler ListTerminatorsHandler) *ListTerminators { - return &ListTerminators{Context: ctx, Handler: handler} -} - -/* ListTerminators swagger:route GET /terminators Terminator listTerminators - -List terminators - -Retrieves a list of terminator resources; supports filtering, sorting, and pagination. Requires admin access. - - -*/ -type ListTerminators struct { - Context *middleware.Context - Handler ListTerminatorsHandler -} - -func (o *ListTerminators) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListTerminatorsParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/terminator/list_terminators_parameters.go b/rest_management_api_server/operations/terminator/list_terminators_parameters.go deleted file mode 100644 index 356a72c7f..000000000 --- a/rest_management_api_server/operations/terminator/list_terminators_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListTerminatorsParams creates a new ListTerminatorsParams object -// -// There are no default values defined in the spec. -func NewListTerminatorsParams() ListTerminatorsParams { - - return ListTerminatorsParams{} -} - -// ListTerminatorsParams contains all the bound params for the list terminators operation -// typically these are obtained from a http.Request -// -// swagger:parameters listTerminators -type ListTerminatorsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Limit *int64 - /* - In: query - */ - Offset *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListTerminatorsParams() beforehand. -func (o *ListTerminatorsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qLimit, qhkLimit, _ := qs.GetOK("limit") - if err := o.bindLimit(qLimit, qhkLimit, route.Formats); err != nil { - res = append(res, err) - } - - qOffset, qhkOffset, _ := qs.GetOK("offset") - if err := o.bindOffset(qOffset, qhkOffset, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *ListTerminatorsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindLimit binds and validates parameter Limit from query. -func (o *ListTerminatorsParams) bindLimit(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("limit", "query", "int64", raw) - } - o.Limit = &value - - return nil -} - -// bindOffset binds and validates parameter Offset from query. -func (o *ListTerminatorsParams) bindOffset(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("offset", "query", "int64", raw) - } - o.Offset = &value - - return nil -} diff --git a/rest_management_api_server/operations/terminator/list_terminators_responses.go b/rest_management_api_server/operations/terminator/list_terminators_responses.go deleted file mode 100644 index 0d4d34c51..000000000 --- a/rest_management_api_server/operations/terminator/list_terminators_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// ListTerminatorsOKCode is the HTTP code returned for type ListTerminatorsOK -const ListTerminatorsOKCode int = 200 - -/*ListTerminatorsOK A list of terminators - -swagger:response listTerminatorsOK -*/ -type ListTerminatorsOK struct { - - /* - In: Body - */ - Payload *rest_model.ListTerminatorsEnvelope `json:"body,omitempty"` -} - -// NewListTerminatorsOK creates ListTerminatorsOK with default headers values -func NewListTerminatorsOK() *ListTerminatorsOK { - - return &ListTerminatorsOK{} -} - -// WithPayload adds the payload to the list terminators o k response -func (o *ListTerminatorsOK) WithPayload(payload *rest_model.ListTerminatorsEnvelope) *ListTerminatorsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list terminators o k response -func (o *ListTerminatorsOK) SetPayload(payload *rest_model.ListTerminatorsEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListTerminatorsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListTerminatorsBadRequestCode is the HTTP code returned for type ListTerminatorsBadRequest -const ListTerminatorsBadRequestCode int = 400 - -/*ListTerminatorsBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response listTerminatorsBadRequest -*/ -type ListTerminatorsBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListTerminatorsBadRequest creates ListTerminatorsBadRequest with default headers values -func NewListTerminatorsBadRequest() *ListTerminatorsBadRequest { - - return &ListTerminatorsBadRequest{} -} - -// WithPayload adds the payload to the list terminators bad request response -func (o *ListTerminatorsBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *ListTerminatorsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list terminators bad request response -func (o *ListTerminatorsBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListTerminatorsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListTerminatorsUnauthorizedCode is the HTTP code returned for type ListTerminatorsUnauthorized -const ListTerminatorsUnauthorizedCode int = 401 - -/*ListTerminatorsUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response listTerminatorsUnauthorized -*/ -type ListTerminatorsUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewListTerminatorsUnauthorized creates ListTerminatorsUnauthorized with default headers values -func NewListTerminatorsUnauthorized() *ListTerminatorsUnauthorized { - - return &ListTerminatorsUnauthorized{} -} - -// WithPayload adds the payload to the list terminators unauthorized response -func (o *ListTerminatorsUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *ListTerminatorsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list terminators unauthorized response -func (o *ListTerminatorsUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListTerminatorsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/terminator/list_terminators_urlbuilder.go b/rest_management_api_server/operations/terminator/list_terminators_urlbuilder.go deleted file mode 100644 index d340dc692..000000000 --- a/rest_management_api_server/operations/terminator/list_terminators_urlbuilder.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListTerminatorsURL generates an URL for the list terminators operation -type ListTerminatorsURL struct { - Filter *string - Limit *int64 - Offset *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListTerminatorsURL) WithBasePath(bp string) *ListTerminatorsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListTerminatorsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListTerminatorsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/terminators" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var limitQ string - if o.Limit != nil { - limitQ = swag.FormatInt64(*o.Limit) - } - if limitQ != "" { - qs.Set("limit", limitQ) - } - - var offsetQ string - if o.Offset != nil { - offsetQ = swag.FormatInt64(*o.Offset) - } - if offsetQ != "" { - qs.Set("offset", offsetQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListTerminatorsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListTerminatorsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListTerminatorsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListTerminatorsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListTerminatorsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListTerminatorsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/terminator/patch_terminator.go b/rest_management_api_server/operations/terminator/patch_terminator.go deleted file mode 100644 index 75867388e..000000000 --- a/rest_management_api_server/operations/terminator/patch_terminator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchTerminatorHandlerFunc turns a function with the right signature into a patch terminator handler -type PatchTerminatorHandlerFunc func(PatchTerminatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchTerminatorHandlerFunc) Handle(params PatchTerminatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// PatchTerminatorHandler interface for that can handle valid patch terminator params -type PatchTerminatorHandler interface { - Handle(PatchTerminatorParams, interface{}) middleware.Responder -} - -// NewPatchTerminator creates a new http.Handler for the patch terminator operation -func NewPatchTerminator(ctx *middleware.Context, handler PatchTerminatorHandler) *PatchTerminator { - return &PatchTerminator{Context: ctx, Handler: handler} -} - -/* PatchTerminator swagger:route PATCH /terminators/{id} Terminator patchTerminator - -Update the supplied fields on a terminator - -Update the supplied fields on a terminator. Requires admin access. - -*/ -type PatchTerminator struct { - Context *middleware.Context - Handler PatchTerminatorHandler -} - -func (o *PatchTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchTerminatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/terminator/patch_terminator_parameters.go b/rest_management_api_server/operations/terminator/patch_terminator_parameters.go deleted file mode 100644 index e6ed9ac2c..000000000 --- a/rest_management_api_server/operations/terminator/patch_terminator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewPatchTerminatorParams creates a new PatchTerminatorParams object -// -// There are no default values defined in the spec. -func NewPatchTerminatorParams() PatchTerminatorParams { - - return PatchTerminatorParams{} -} - -// PatchTerminatorParams contains all the bound params for the patch terminator operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchTerminator -type PatchTerminatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A terminator patch object - Required: true - In: body - */ - Terminator *rest_model.TerminatorPatch -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchTerminatorParams() beforehand. -func (o *PatchTerminatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.TerminatorPatch - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("terminator", "body", "")) - } else { - res = append(res, errors.NewParseError("terminator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Terminator = &body - } - } - } else { - res = append(res, errors.Required("terminator", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *PatchTerminatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/terminator/patch_terminator_responses.go b/rest_management_api_server/operations/terminator/patch_terminator_responses.go deleted file mode 100644 index c55fe7a9c..000000000 --- a/rest_management_api_server/operations/terminator/patch_terminator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// PatchTerminatorOKCode is the HTTP code returned for type PatchTerminatorOK -const PatchTerminatorOKCode int = 200 - -/*PatchTerminatorOK The patch request was successful and the resource has been altered - -swagger:response patchTerminatorOK -*/ -type PatchTerminatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewPatchTerminatorOK creates PatchTerminatorOK with default headers values -func NewPatchTerminatorOK() *PatchTerminatorOK { - - return &PatchTerminatorOK{} -} - -// WithPayload adds the payload to the patch terminator o k response -func (o *PatchTerminatorOK) WithPayload(payload *rest_model.Empty) *PatchTerminatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch terminator o k response -func (o *PatchTerminatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTerminatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchTerminatorBadRequestCode is the HTTP code returned for type PatchTerminatorBadRequest -const PatchTerminatorBadRequestCode int = 400 - -/*PatchTerminatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response patchTerminatorBadRequest -*/ -type PatchTerminatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchTerminatorBadRequest creates PatchTerminatorBadRequest with default headers values -func NewPatchTerminatorBadRequest() *PatchTerminatorBadRequest { - - return &PatchTerminatorBadRequest{} -} - -// WithPayload adds the payload to the patch terminator bad request response -func (o *PatchTerminatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchTerminatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch terminator bad request response -func (o *PatchTerminatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTerminatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchTerminatorUnauthorizedCode is the HTTP code returned for type PatchTerminatorUnauthorized -const PatchTerminatorUnauthorizedCode int = 401 - -/*PatchTerminatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response patchTerminatorUnauthorized -*/ -type PatchTerminatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchTerminatorUnauthorized creates PatchTerminatorUnauthorized with default headers values -func NewPatchTerminatorUnauthorized() *PatchTerminatorUnauthorized { - - return &PatchTerminatorUnauthorized{} -} - -// WithPayload adds the payload to the patch terminator unauthorized response -func (o *PatchTerminatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchTerminatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch terminator unauthorized response -func (o *PatchTerminatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTerminatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchTerminatorNotFoundCode is the HTTP code returned for type PatchTerminatorNotFound -const PatchTerminatorNotFoundCode int = 404 - -/*PatchTerminatorNotFound The requested resource does not exist - -swagger:response patchTerminatorNotFound -*/ -type PatchTerminatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewPatchTerminatorNotFound creates PatchTerminatorNotFound with default headers values -func NewPatchTerminatorNotFound() *PatchTerminatorNotFound { - - return &PatchTerminatorNotFound{} -} - -// WithPayload adds the payload to the patch terminator not found response -func (o *PatchTerminatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *PatchTerminatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch terminator not found response -func (o *PatchTerminatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchTerminatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/terminator/patch_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/patch_terminator_urlbuilder.go deleted file mode 100644 index 713ca08b7..000000000 --- a/rest_management_api_server/operations/terminator/patch_terminator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// PatchTerminatorURL generates an URL for the patch terminator operation -type PatchTerminatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchTerminatorURL) WithBasePath(bp string) *PatchTerminatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchTerminatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchTerminatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/terminators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on PatchTerminatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchTerminatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchTerminatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchTerminatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchTerminatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchTerminatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchTerminatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/terminator/update_terminator.go b/rest_management_api_server/operations/terminator/update_terminator.go deleted file mode 100644 index da874bac4..000000000 --- a/rest_management_api_server/operations/terminator/update_terminator.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateTerminatorHandlerFunc turns a function with the right signature into a update terminator handler -type UpdateTerminatorHandlerFunc func(UpdateTerminatorParams, interface{}) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateTerminatorHandlerFunc) Handle(params UpdateTerminatorParams, principal interface{}) middleware.Responder { - return fn(params, principal) -} - -// UpdateTerminatorHandler interface for that can handle valid update terminator params -type UpdateTerminatorHandler interface { - Handle(UpdateTerminatorParams, interface{}) middleware.Responder -} - -// NewUpdateTerminator creates a new http.Handler for the update terminator operation -func NewUpdateTerminator(ctx *middleware.Context, handler UpdateTerminatorHandler) *UpdateTerminator { - return &UpdateTerminator{Context: ctx, Handler: handler} -} - -/* UpdateTerminator swagger:route PUT /terminators/{id} Terminator updateTerminator - -Update all fields on a terminator - -Update all fields on a terminator by id. Requires admin access. - -*/ -type UpdateTerminator struct { - Context *middleware.Context - Handler UpdateTerminatorHandler -} - -func (o *UpdateTerminator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateTerminatorParams() - uprinc, aCtx, err := o.Context.Authorize(r, route) - if err != nil { - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - if aCtx != nil { - *r = *aCtx - } - var principal interface{} - if uprinc != nil { - principal = uprinc.(interface{}) // this is really a interface{}, I promise - } - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params, principal) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/rest_management_api_server/operations/terminator/update_terminator_parameters.go b/rest_management_api_server/operations/terminator/update_terminator_parameters.go deleted file mode 100644 index 20a67211d..000000000 --- a/rest_management_api_server/operations/terminator/update_terminator_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/openziti/edge/rest_model" -) - -// NewUpdateTerminatorParams creates a new UpdateTerminatorParams object -// -// There are no default values defined in the spec. -func NewUpdateTerminatorParams() UpdateTerminatorParams { - - return UpdateTerminatorParams{} -} - -// UpdateTerminatorParams contains all the bound params for the update terminator operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateTerminator -type UpdateTerminatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The id of the requested resource - Required: true - In: path - */ - ID string - /*A terminator update object - Required: true - In: body - */ - Terminator *rest_model.TerminatorUpdate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateTerminatorParams() beforehand. -func (o *UpdateTerminatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body rest_model.TerminatorUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("terminator", "body", "")) - } else { - res = append(res, errors.NewParseError("terminator", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(context.Background()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Terminator = &body - } - } - } else { - res = append(res, errors.Required("terminator", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from path. -func (o *UpdateTerminatorParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ID = raw - - return nil -} diff --git a/rest_management_api_server/operations/terminator/update_terminator_responses.go b/rest_management_api_server/operations/terminator/update_terminator_responses.go deleted file mode 100644 index 42095e53d..000000000 --- a/rest_management_api_server/operations/terminator/update_terminator_responses.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/openziti/edge/rest_model" -) - -// UpdateTerminatorOKCode is the HTTP code returned for type UpdateTerminatorOK -const UpdateTerminatorOKCode int = 200 - -/*UpdateTerminatorOK The update request was successful and the resource has been altered - -swagger:response updateTerminatorOK -*/ -type UpdateTerminatorOK struct { - - /* - In: Body - */ - Payload *rest_model.Empty `json:"body,omitempty"` -} - -// NewUpdateTerminatorOK creates UpdateTerminatorOK with default headers values -func NewUpdateTerminatorOK() *UpdateTerminatorOK { - - return &UpdateTerminatorOK{} -} - -// WithPayload adds the payload to the update terminator o k response -func (o *UpdateTerminatorOK) WithPayload(payload *rest_model.Empty) *UpdateTerminatorOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update terminator o k response -func (o *UpdateTerminatorOK) SetPayload(payload *rest_model.Empty) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTerminatorOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateTerminatorBadRequestCode is the HTTP code returned for type UpdateTerminatorBadRequest -const UpdateTerminatorBadRequestCode int = 400 - -/*UpdateTerminatorBadRequest The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information - -swagger:response updateTerminatorBadRequest -*/ -type UpdateTerminatorBadRequest struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateTerminatorBadRequest creates UpdateTerminatorBadRequest with default headers values -func NewUpdateTerminatorBadRequest() *UpdateTerminatorBadRequest { - - return &UpdateTerminatorBadRequest{} -} - -// WithPayload adds the payload to the update terminator bad request response -func (o *UpdateTerminatorBadRequest) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateTerminatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update terminator bad request response -func (o *UpdateTerminatorBadRequest) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTerminatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateTerminatorUnauthorizedCode is the HTTP code returned for type UpdateTerminatorUnauthorized -const UpdateTerminatorUnauthorizedCode int = 401 - -/*UpdateTerminatorUnauthorized The currently supplied session does not have the correct access rights to request this resource - -swagger:response updateTerminatorUnauthorized -*/ -type UpdateTerminatorUnauthorized struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateTerminatorUnauthorized creates UpdateTerminatorUnauthorized with default headers values -func NewUpdateTerminatorUnauthorized() *UpdateTerminatorUnauthorized { - - return &UpdateTerminatorUnauthorized{} -} - -// WithPayload adds the payload to the update terminator unauthorized response -func (o *UpdateTerminatorUnauthorized) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateTerminatorUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update terminator unauthorized response -func (o *UpdateTerminatorUnauthorized) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTerminatorUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateTerminatorNotFoundCode is the HTTP code returned for type UpdateTerminatorNotFound -const UpdateTerminatorNotFoundCode int = 404 - -/*UpdateTerminatorNotFound The requested resource does not exist - -swagger:response updateTerminatorNotFound -*/ -type UpdateTerminatorNotFound struct { - - /* - In: Body - */ - Payload *rest_model.APIErrorEnvelope `json:"body,omitempty"` -} - -// NewUpdateTerminatorNotFound creates UpdateTerminatorNotFound with default headers values -func NewUpdateTerminatorNotFound() *UpdateTerminatorNotFound { - - return &UpdateTerminatorNotFound{} -} - -// WithPayload adds the payload to the update terminator not found response -func (o *UpdateTerminatorNotFound) WithPayload(payload *rest_model.APIErrorEnvelope) *UpdateTerminatorNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update terminator not found response -func (o *UpdateTerminatorNotFound) SetPayload(payload *rest_model.APIErrorEnvelope) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateTerminatorNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/rest_management_api_server/operations/terminator/update_terminator_urlbuilder.go b/rest_management_api_server/operations/terminator/update_terminator_urlbuilder.go deleted file mode 100644 index 7bce52fa6..000000000 --- a/rest_management_api_server/operations/terminator/update_terminator_urlbuilder.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package terminator - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateTerminatorURL generates an URL for the update terminator operation -type UpdateTerminatorURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateTerminatorURL) WithBasePath(bp string) *UpdateTerminatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateTerminatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateTerminatorURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/terminators/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("id is required on UpdateTerminatorURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/edge/management/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateTerminatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateTerminatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateTerminatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateTerminatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateTerminatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateTerminatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/rest_management_api_server/operations/ziti_edge_management_api.go b/rest_management_api_server/operations/ziti_edge_management_api.go deleted file mode 100644 index 43be67e46..000000000 --- a/rest_management_api_server/operations/ziti_edge_management_api.go +++ /dev/null @@ -1,2577 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/openziti/edge/rest_management_api_server/operations/api_session" - "github.com/openziti/edge/rest_management_api_server/operations/auth_policy" - "github.com/openziti/edge/rest_management_api_server/operations/authentication" - "github.com/openziti/edge/rest_management_api_server/operations/authenticator" - "github.com/openziti/edge/rest_management_api_server/operations/certificate_authority" - "github.com/openziti/edge/rest_management_api_server/operations/config" - "github.com/openziti/edge/rest_management_api_server/operations/current_api_session" - "github.com/openziti/edge/rest_management_api_server/operations/current_identity" - "github.com/openziti/edge/rest_management_api_server/operations/database" - "github.com/openziti/edge/rest_management_api_server/operations/edge_router" - "github.com/openziti/edge/rest_management_api_server/operations/edge_router_policy" - "github.com/openziti/edge/rest_management_api_server/operations/enrollment" - "github.com/openziti/edge/rest_management_api_server/operations/external_jwt_signer" - "github.com/openziti/edge/rest_management_api_server/operations/identity" - "github.com/openziti/edge/rest_management_api_server/operations/informational" - "github.com/openziti/edge/rest_management_api_server/operations/posture_checks" - "github.com/openziti/edge/rest_management_api_server/operations/role_attributes" - "github.com/openziti/edge/rest_management_api_server/operations/router" - "github.com/openziti/edge/rest_management_api_server/operations/service" - "github.com/openziti/edge/rest_management_api_server/operations/service_edge_router_policy" - "github.com/openziti/edge/rest_management_api_server/operations/service_policy" - "github.com/openziti/edge/rest_management_api_server/operations/session" - "github.com/openziti/edge/rest_management_api_server/operations/terminator" -) - -// NewZitiEdgeManagementAPI creates a new ZitiEdgeManagement instance -func NewZitiEdgeManagementAPI(spec *loads.Document) *ZitiEdgeManagementAPI { - return &ZitiEdgeManagementAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - TxtConsumer: runtime.TextConsumer(), - - ApplicationJWTProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("applicationJwt producer has not yet been implemented") - }), - BinProducer: runtime.ByteStreamProducer(), - JSONProducer: runtime.JSONProducer(), - TextYamlProducer: runtime.ProducerFunc(func(w io.Writer, data interface{}) error { - return errors.NotImplemented("textYaml producer has not yet been implemented") - }), - - CurrentAPISessionDeleteCurrentAPISessionHandler: current_api_session.DeleteCurrentAPISessionHandlerFunc(func(params current_api_session.DeleteCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DeleteCurrentAPISession has not yet been implemented") - }), - IdentityAssociateIdentitysServiceConfigsHandler: identity.AssociateIdentitysServiceConfigsHandlerFunc(func(params identity.AssociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.AssociateIdentitysServiceConfigs has not yet been implemented") - }), - AuthenticationAuthenticateHandler: authentication.AuthenticateHandlerFunc(func(params authentication.AuthenticateParams) middleware.Responder { - return middleware.NotImplemented("operation authentication.Authenticate has not yet been implemented") - }), - AuthenticationAuthenticateMfaHandler: authentication.AuthenticateMfaHandlerFunc(func(params authentication.AuthenticateMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authentication.AuthenticateMfa has not yet been implemented") - }), - DatabaseCheckDataIntegrityHandler: database.CheckDataIntegrityHandlerFunc(func(params database.CheckDataIntegrityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.CheckDataIntegrity has not yet been implemented") - }), - AuthPolicyCreateAuthPolicyHandler: auth_policy.CreateAuthPolicyHandlerFunc(func(params auth_policy.CreateAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.CreateAuthPolicy has not yet been implemented") - }), - AuthenticatorCreateAuthenticatorHandler: authenticator.CreateAuthenticatorHandlerFunc(func(params authenticator.CreateAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.CreateAuthenticator has not yet been implemented") - }), - CertificateAuthorityCreateCaHandler: certificate_authority.CreateCaHandlerFunc(func(params certificate_authority.CreateCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.CreateCa has not yet been implemented") - }), - ConfigCreateConfigHandler: config.CreateConfigHandlerFunc(func(params config.CreateConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.CreateConfig has not yet been implemented") - }), - ConfigCreateConfigTypeHandler: config.CreateConfigTypeHandlerFunc(func(params config.CreateConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.CreateConfigType has not yet been implemented") - }), - DatabaseCreateDatabaseSnapshotHandler: database.CreateDatabaseSnapshotHandlerFunc(func(params database.CreateDatabaseSnapshotParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.CreateDatabaseSnapshot has not yet been implemented") - }), - EdgeRouterCreateEdgeRouterHandler: edge_router.CreateEdgeRouterHandlerFunc(func(params edge_router.CreateEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.CreateEdgeRouter has not yet been implemented") - }), - EdgeRouterPolicyCreateEdgeRouterPolicyHandler: edge_router_policy.CreateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.CreateEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.CreateEdgeRouterPolicy has not yet been implemented") - }), - EnrollmentCreateEnrollmentHandler: enrollment.CreateEnrollmentHandlerFunc(func(params enrollment.CreateEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.CreateEnrollment has not yet been implemented") - }), - ExternalJWTSignerCreateExternalJWTSignerHandler: external_jwt_signer.CreateExternalJWTSignerHandlerFunc(func(params external_jwt_signer.CreateExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.CreateExternalJWTSigner has not yet been implemented") - }), - IdentityCreateIdentityHandler: identity.CreateIdentityHandlerFunc(func(params identity.CreateIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.CreateIdentity has not yet been implemented") - }), - CurrentIdentityCreateMfaRecoveryCodesHandler: current_identity.CreateMfaRecoveryCodesHandlerFunc(func(params current_identity.CreateMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.CreateMfaRecoveryCodes has not yet been implemented") - }), - PostureChecksCreatePostureCheckHandler: posture_checks.CreatePostureCheckHandlerFunc(func(params posture_checks.CreatePostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.CreatePostureCheck has not yet been implemented") - }), - RouterCreateRouterHandler: router.CreateRouterHandlerFunc(func(params router.CreateRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.CreateRouter has not yet been implemented") - }), - ServiceCreateServiceHandler: service.CreateServiceHandlerFunc(func(params service.CreateServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.CreateService has not yet been implemented") - }), - ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler: service_edge_router_policy.CreateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.CreateServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.CreateServiceEdgeRouterPolicy has not yet been implemented") - }), - ServicePolicyCreateServicePolicyHandler: service_policy.CreateServicePolicyHandlerFunc(func(params service_policy.CreateServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.CreateServicePolicy has not yet been implemented") - }), - TerminatorCreateTerminatorHandler: terminator.CreateTerminatorHandlerFunc(func(params terminator.CreateTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.CreateTerminator has not yet been implemented") - }), - RouterCreateTransitRouterHandler: router.CreateTransitRouterHandlerFunc(func(params router.CreateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.CreateTransitRouter has not yet been implemented") - }), - DatabaseDataIntegrityResultsHandler: database.DataIntegrityResultsHandlerFunc(func(params database.DataIntegrityResultsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.DataIntegrityResults has not yet been implemented") - }), - APISessionDeleteAPISessionsHandler: api_session.DeleteAPISessionsHandlerFunc(func(params api_session.DeleteAPISessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation api_session.DeleteAPISessions has not yet been implemented") - }), - AuthPolicyDeleteAuthPolicyHandler: auth_policy.DeleteAuthPolicyHandlerFunc(func(params auth_policy.DeleteAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.DeleteAuthPolicy has not yet been implemented") - }), - AuthenticatorDeleteAuthenticatorHandler: authenticator.DeleteAuthenticatorHandlerFunc(func(params authenticator.DeleteAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.DeleteAuthenticator has not yet been implemented") - }), - CertificateAuthorityDeleteCaHandler: certificate_authority.DeleteCaHandlerFunc(func(params certificate_authority.DeleteCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.DeleteCa has not yet been implemented") - }), - ConfigDeleteConfigHandler: config.DeleteConfigHandlerFunc(func(params config.DeleteConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DeleteConfig has not yet been implemented") - }), - ConfigDeleteConfigTypeHandler: config.DeleteConfigTypeHandlerFunc(func(params config.DeleteConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DeleteConfigType has not yet been implemented") - }), - EdgeRouterDeleteEdgeRouterHandler: edge_router.DeleteEdgeRouterHandlerFunc(func(params edge_router.DeleteEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.DeleteEdgeRouter has not yet been implemented") - }), - EdgeRouterPolicyDeleteEdgeRouterPolicyHandler: edge_router_policy.DeleteEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DeleteEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.DeleteEdgeRouterPolicy has not yet been implemented") - }), - EnrollmentDeleteEnrollmentHandler: enrollment.DeleteEnrollmentHandlerFunc(func(params enrollment.DeleteEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.DeleteEnrollment has not yet been implemented") - }), - ExternalJWTSignerDeleteExternalJWTSignerHandler: external_jwt_signer.DeleteExternalJWTSignerHandlerFunc(func(params external_jwt_signer.DeleteExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.DeleteExternalJWTSigner has not yet been implemented") - }), - IdentityDeleteIdentityHandler: identity.DeleteIdentityHandlerFunc(func(params identity.DeleteIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DeleteIdentity has not yet been implemented") - }), - CurrentIdentityDeleteMfaHandler: current_identity.DeleteMfaHandlerFunc(func(params current_identity.DeleteMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DeleteMfa has not yet been implemented") - }), - PostureChecksDeletePostureCheckHandler: posture_checks.DeletePostureCheckHandlerFunc(func(params posture_checks.DeletePostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.DeletePostureCheck has not yet been implemented") - }), - RouterDeleteRouterHandler: router.DeleteRouterHandlerFunc(func(params router.DeleteRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DeleteRouter has not yet been implemented") - }), - ServiceDeleteServiceHandler: service.DeleteServiceHandlerFunc(func(params service.DeleteServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DeleteService has not yet been implemented") - }), - ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler: service_edge_router_policy.DeleteServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DeleteServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.DeleteServiceEdgeRouterPolicy has not yet been implemented") - }), - ServicePolicyDeleteServicePolicyHandler: service_policy.DeleteServicePolicyHandlerFunc(func(params service_policy.DeleteServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.DeleteServicePolicy has not yet been implemented") - }), - SessionDeleteSessionHandler: session.DeleteSessionHandlerFunc(func(params session.DeleteSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DeleteSession has not yet been implemented") - }), - TerminatorDeleteTerminatorHandler: terminator.DeleteTerminatorHandlerFunc(func(params terminator.DeleteTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.DeleteTerminator has not yet been implemented") - }), - RouterDeleteTransitRouterHandler: router.DeleteTransitRouterHandlerFunc(func(params router.DeleteTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DeleteTransitRouter has not yet been implemented") - }), - APISessionDetailAPISessionsHandler: api_session.DetailAPISessionsHandlerFunc(func(params api_session.DetailAPISessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation api_session.DetailAPISessions has not yet been implemented") - }), - AuthPolicyDetailAuthPolicyHandler: auth_policy.DetailAuthPolicyHandlerFunc(func(params auth_policy.DetailAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.DetailAuthPolicy has not yet been implemented") - }), - AuthenticatorDetailAuthenticatorHandler: authenticator.DetailAuthenticatorHandlerFunc(func(params authenticator.DetailAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.DetailAuthenticator has not yet been implemented") - }), - CertificateAuthorityDetailCaHandler: certificate_authority.DetailCaHandlerFunc(func(params certificate_authority.DetailCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.DetailCa has not yet been implemented") - }), - ConfigDetailConfigHandler: config.DetailConfigHandlerFunc(func(params config.DetailConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DetailConfig has not yet been implemented") - }), - ConfigDetailConfigTypeHandler: config.DetailConfigTypeHandlerFunc(func(params config.DetailConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.DetailConfigType has not yet been implemented") - }), - CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler: current_api_session.DetailCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.DetailCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.DetailCurrentIdentityAuthenticator has not yet been implemented") - }), - EdgeRouterDetailEdgeRouterHandler: edge_router.DetailEdgeRouterHandlerFunc(func(params edge_router.DetailEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.DetailEdgeRouter has not yet been implemented") - }), - EdgeRouterPolicyDetailEdgeRouterPolicyHandler: edge_router_policy.DetailEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.DetailEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.DetailEdgeRouterPolicy has not yet been implemented") - }), - EnrollmentDetailEnrollmentHandler: enrollment.DetailEnrollmentHandlerFunc(func(params enrollment.DetailEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.DetailEnrollment has not yet been implemented") - }), - ExternalJWTSignerDetailExternalJWTSignerHandler: external_jwt_signer.DetailExternalJWTSignerHandlerFunc(func(params external_jwt_signer.DetailExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.DetailExternalJWTSigner has not yet been implemented") - }), - IdentityDetailIdentityHandler: identity.DetailIdentityHandlerFunc(func(params identity.DetailIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DetailIdentity has not yet been implemented") - }), - IdentityDetailIdentityTypeHandler: identity.DetailIdentityTypeHandlerFunc(func(params identity.DetailIdentityTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DetailIdentityType has not yet been implemented") - }), - CurrentIdentityDetailMfaHandler: current_identity.DetailMfaHandlerFunc(func(params current_identity.DetailMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfa has not yet been implemented") - }), - CurrentIdentityDetailMfaQrCodeHandler: current_identity.DetailMfaQrCodeHandlerFunc(func(params current_identity.DetailMfaQrCodeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaQrCode has not yet been implemented") - }), - CurrentIdentityDetailMfaRecoveryCodesHandler: current_identity.DetailMfaRecoveryCodesHandlerFunc(func(params current_identity.DetailMfaRecoveryCodesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.DetailMfaRecoveryCodes has not yet been implemented") - }), - PostureChecksDetailPostureCheckHandler: posture_checks.DetailPostureCheckHandlerFunc(func(params posture_checks.DetailPostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.DetailPostureCheck has not yet been implemented") - }), - PostureChecksDetailPostureCheckTypeHandler: posture_checks.DetailPostureCheckTypeHandlerFunc(func(params posture_checks.DetailPostureCheckTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.DetailPostureCheckType has not yet been implemented") - }), - RouterDetailRouterHandler: router.DetailRouterHandlerFunc(func(params router.DetailRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DetailRouter has not yet been implemented") - }), - ServiceDetailServiceHandler: service.DetailServiceHandlerFunc(func(params service.DetailServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.DetailService has not yet been implemented") - }), - ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler: service_edge_router_policy.DetailServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.DetailServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.DetailServiceEdgeRouterPolicy has not yet been implemented") - }), - ServicePolicyDetailServicePolicyHandler: service_policy.DetailServicePolicyHandlerFunc(func(params service_policy.DetailServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.DetailServicePolicy has not yet been implemented") - }), - SessionDetailSessionHandler: session.DetailSessionHandlerFunc(func(params session.DetailSessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DetailSession has not yet been implemented") - }), - SessionDetailSessionRoutePathHandler: session.DetailSessionRoutePathHandlerFunc(func(params session.DetailSessionRoutePathParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.DetailSessionRoutePath has not yet been implemented") - }), - InformationalDetailSpecHandler: informational.DetailSpecHandlerFunc(func(params informational.DetailSpecParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpec has not yet been implemented") - }), - InformationalDetailSpecBodyHandler: informational.DetailSpecBodyHandlerFunc(func(params informational.DetailSpecBodyParams) middleware.Responder { - return middleware.NotImplemented("operation informational.DetailSpecBody has not yet been implemented") - }), - TerminatorDetailTerminatorHandler: terminator.DetailTerminatorHandlerFunc(func(params terminator.DetailTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.DetailTerminator has not yet been implemented") - }), - RouterDetailTransitRouterHandler: router.DetailTransitRouterHandlerFunc(func(params router.DetailTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.DetailTransitRouter has not yet been implemented") - }), - IdentityDisableIdentityHandler: identity.DisableIdentityHandlerFunc(func(params identity.DisableIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DisableIdentity has not yet been implemented") - }), - IdentityDisassociateIdentitysServiceConfigsHandler: identity.DisassociateIdentitysServiceConfigsHandlerFunc(func(params identity.DisassociateIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.DisassociateIdentitysServiceConfigs has not yet been implemented") - }), - IdentityEnableIdentityHandler: identity.EnableIdentityHandlerFunc(func(params identity.EnableIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.EnableIdentity has not yet been implemented") - }), - CurrentIdentityEnrollMfaHandler: current_identity.EnrollMfaHandlerFunc(func(params current_identity.EnrollMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.EnrollMfa has not yet been implemented") - }), - CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler: current_api_session.ExtendCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendCurrentIdentityAuthenticator has not yet been implemented") - }), - CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler: current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.ExtendVerifyCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ExtendVerifyCurrentIdentityAuthenticator has not yet been implemented") - }), - DatabaseFixDataIntegrityHandler: database.FixDataIntegrityHandlerFunc(func(params database.FixDataIntegrityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation database.FixDataIntegrity has not yet been implemented") - }), - CertificateAuthorityGetCaJWTHandler: certificate_authority.GetCaJWTHandlerFunc(func(params certificate_authority.GetCaJWTParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.GetCaJWT has not yet been implemented") - }), - CurrentAPISessionGetCurrentAPISessionHandler: current_api_session.GetCurrentAPISessionHandlerFunc(func(params current_api_session.GetCurrentAPISessionParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.GetCurrentAPISession has not yet been implemented") - }), - CurrentIdentityGetCurrentIdentityHandler: current_identity.GetCurrentIdentityHandlerFunc(func(params current_identity.GetCurrentIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.GetCurrentIdentity has not yet been implemented") - }), - IdentityGetIdentityAuthenticatorsHandler: identity.GetIdentityAuthenticatorsHandlerFunc(func(params identity.GetIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityAuthenticators has not yet been implemented") - }), - IdentityGetIdentityEnrollmentsHandler: identity.GetIdentityEnrollmentsHandlerFunc(func(params identity.GetIdentityEnrollmentsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityEnrollments has not yet been implemented") - }), - IdentityGetIdentityFailedServiceRequestsHandler: identity.GetIdentityFailedServiceRequestsHandlerFunc(func(params identity.GetIdentityFailedServiceRequestsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityFailedServiceRequests has not yet been implemented") - }), - IdentityGetIdentityPolicyAdviceHandler: identity.GetIdentityPolicyAdviceHandlerFunc(func(params identity.GetIdentityPolicyAdviceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityPolicyAdvice has not yet been implemented") - }), - IdentityGetIdentityPostureDataHandler: identity.GetIdentityPostureDataHandlerFunc(func(params identity.GetIdentityPostureDataParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.GetIdentityPostureData has not yet been implemented") - }), - APISessionListAPISessionsHandler: api_session.ListAPISessionsHandlerFunc(func(params api_session.ListAPISessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation api_session.ListAPISessions has not yet been implemented") - }), - AuthPolicyListAuthPoliciesHandler: auth_policy.ListAuthPoliciesHandlerFunc(func(params auth_policy.ListAuthPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.ListAuthPolicies has not yet been implemented") - }), - AuthenticatorListAuthenticatorsHandler: authenticator.ListAuthenticatorsHandlerFunc(func(params authenticator.ListAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.ListAuthenticators has not yet been implemented") - }), - CertificateAuthorityListCasHandler: certificate_authority.ListCasHandlerFunc(func(params certificate_authority.ListCasParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.ListCas has not yet been implemented") - }), - ConfigListConfigTypesHandler: config.ListConfigTypesHandlerFunc(func(params config.ListConfigTypesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.ListConfigTypes has not yet been implemented") - }), - ConfigListConfigsHandler: config.ListConfigsHandlerFunc(func(params config.ListConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.ListConfigs has not yet been implemented") - }), - ConfigListConfigsForConfigTypeHandler: config.ListConfigsForConfigTypeHandlerFunc(func(params config.ListConfigsForConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.ListConfigsForConfigType has not yet been implemented") - }), - CurrentAPISessionListCurrentIdentityAuthenticatorsHandler: current_api_session.ListCurrentIdentityAuthenticatorsHandlerFunc(func(params current_api_session.ListCurrentIdentityAuthenticatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.ListCurrentIdentityAuthenticators has not yet been implemented") - }), - EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler: edge_router.ListEdgeRouterEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterEdgeRouterPolicies has not yet been implemented") - }), - EdgeRouterListEdgeRouterIdentitiesHandler: edge_router.ListEdgeRouterIdentitiesHandlerFunc(func(params edge_router.ListEdgeRouterIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterIdentities has not yet been implemented") - }), - EdgeRouterPolicyListEdgeRouterPoliciesHandler: edge_router_policy.ListEdgeRouterPoliciesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.ListEdgeRouterPolicies has not yet been implemented") - }), - EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler: edge_router_policy.ListEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.ListEdgeRouterPolicyEdgeRouters has not yet been implemented") - }), - EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler: edge_router_policy.ListEdgeRouterPolicyIdentitiesHandlerFunc(func(params edge_router_policy.ListEdgeRouterPolicyIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.ListEdgeRouterPolicyIdentities has not yet been implemented") - }), - RoleAttributesListEdgeRouterRoleAttributesHandler: role_attributes.ListEdgeRouterRoleAttributesHandlerFunc(func(params role_attributes.ListEdgeRouterRoleAttributesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation role_attributes.ListEdgeRouterRoleAttributes has not yet been implemented") - }), - EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler: edge_router.ListEdgeRouterServiceEdgeRouterPoliciesHandlerFunc(func(params edge_router.ListEdgeRouterServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterServiceEdgeRouterPolicies has not yet been implemented") - }), - EdgeRouterListEdgeRouterServicesHandler: edge_router.ListEdgeRouterServicesHandlerFunc(func(params edge_router.ListEdgeRouterServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouterServices has not yet been implemented") - }), - EdgeRouterListEdgeRoutersHandler: edge_router.ListEdgeRoutersHandlerFunc(func(params edge_router.ListEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ListEdgeRouters has not yet been implemented") - }), - EnrollmentListEnrollmentsHandler: enrollment.ListEnrollmentsHandlerFunc(func(params enrollment.ListEnrollmentsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.ListEnrollments has not yet been implemented") - }), - ExternalJWTSignerListExternalJWTSignersHandler: external_jwt_signer.ListExternalJWTSignersHandlerFunc(func(params external_jwt_signer.ListExternalJWTSignersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.ListExternalJWTSigners has not yet been implemented") - }), - IdentityListIdentitiesHandler: identity.ListIdentitiesHandlerFunc(func(params identity.ListIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentities has not yet been implemented") - }), - IdentityListIdentityEdgeRoutersHandler: identity.ListIdentityEdgeRoutersHandlerFunc(func(params identity.ListIdentityEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityEdgeRouters has not yet been implemented") - }), - RoleAttributesListIdentityRoleAttributesHandler: role_attributes.ListIdentityRoleAttributesHandlerFunc(func(params role_attributes.ListIdentityRoleAttributesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation role_attributes.ListIdentityRoleAttributes has not yet been implemented") - }), - IdentityListIdentityServicePoliciesHandler: identity.ListIdentityServicePoliciesHandlerFunc(func(params identity.ListIdentityServicePoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityServicePolicies has not yet been implemented") - }), - IdentityListIdentityServicesHandler: identity.ListIdentityServicesHandlerFunc(func(params identity.ListIdentityServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityServices has not yet been implemented") - }), - IdentityListIdentityTypesHandler: identity.ListIdentityTypesHandlerFunc(func(params identity.ListIdentityTypesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentityTypes has not yet been implemented") - }), - IdentityListIdentitysEdgeRouterPoliciesHandler: identity.ListIdentitysEdgeRouterPoliciesHandlerFunc(func(params identity.ListIdentitysEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentitysEdgeRouterPolicies has not yet been implemented") - }), - IdentityListIdentitysServiceConfigsHandler: identity.ListIdentitysServiceConfigsHandlerFunc(func(params identity.ListIdentitysServiceConfigsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.ListIdentitysServiceConfigs has not yet been implemented") - }), - PostureChecksListPostureCheckTypesHandler: posture_checks.ListPostureCheckTypesHandlerFunc(func(params posture_checks.ListPostureCheckTypesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.ListPostureCheckTypes has not yet been implemented") - }), - PostureChecksListPostureChecksHandler: posture_checks.ListPostureChecksHandlerFunc(func(params posture_checks.ListPostureChecksParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.ListPostureChecks has not yet been implemented") - }), - InformationalListRootHandler: informational.ListRootHandlerFunc(func(params informational.ListRootParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListRoot has not yet been implemented") - }), - RouterListRoutersHandler: router.ListRoutersHandlerFunc(func(params router.ListRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.ListRouters has not yet been implemented") - }), - ServiceListServiceConfigHandler: service.ListServiceConfigHandlerFunc(func(params service.ListServiceConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceConfig has not yet been implemented") - }), - ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler: service_edge_router_policy.ListServiceEdgeRouterPoliciesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.ListServiceEdgeRouterPolicies has not yet been implemented") - }), - ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler: service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRouters has not yet been implemented") - }), - ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler: service_edge_router_policy.ListServiceEdgeRouterPolicyServicesHandlerFunc(func(params service_edge_router_policy.ListServiceEdgeRouterPolicyServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.ListServiceEdgeRouterPolicyServices has not yet been implemented") - }), - ServiceListServiceEdgeRoutersHandler: service.ListServiceEdgeRoutersHandlerFunc(func(params service.ListServiceEdgeRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceEdgeRouters has not yet been implemented") - }), - ServiceListServiceIdentitiesHandler: service.ListServiceIdentitiesHandlerFunc(func(params service.ListServiceIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceIdentities has not yet been implemented") - }), - ServicePolicyListServicePoliciesHandler: service_policy.ListServicePoliciesHandlerFunc(func(params service_policy.ListServicePoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicies has not yet been implemented") - }), - ServicePolicyListServicePolicyIdentitiesHandler: service_policy.ListServicePolicyIdentitiesHandlerFunc(func(params service_policy.ListServicePolicyIdentitiesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicyIdentities has not yet been implemented") - }), - ServicePolicyListServicePolicyPostureChecksHandler: service_policy.ListServicePolicyPostureChecksHandlerFunc(func(params service_policy.ListServicePolicyPostureChecksParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicyPostureChecks has not yet been implemented") - }), - ServicePolicyListServicePolicyServicesHandler: service_policy.ListServicePolicyServicesHandlerFunc(func(params service_policy.ListServicePolicyServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.ListServicePolicyServices has not yet been implemented") - }), - RoleAttributesListServiceRoleAttributesHandler: role_attributes.ListServiceRoleAttributesHandlerFunc(func(params role_attributes.ListServiceRoleAttributesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation role_attributes.ListServiceRoleAttributes has not yet been implemented") - }), - ServiceListServiceServiceEdgeRouterPoliciesHandler: service.ListServiceServiceEdgeRouterPoliciesHandlerFunc(func(params service.ListServiceServiceEdgeRouterPoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceServiceEdgeRouterPolicies has not yet been implemented") - }), - ServiceListServiceServicePoliciesHandler: service.ListServiceServicePoliciesHandlerFunc(func(params service.ListServiceServicePoliciesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceServicePolicies has not yet been implemented") - }), - ServiceListServiceTerminatorsHandler: service.ListServiceTerminatorsHandlerFunc(func(params service.ListServiceTerminatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServiceTerminators has not yet been implemented") - }), - ServiceListServicesHandler: service.ListServicesHandlerFunc(func(params service.ListServicesParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.ListServices has not yet been implemented") - }), - SessionListSessionsHandler: session.ListSessionsHandlerFunc(func(params session.ListSessionsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation session.ListSessions has not yet been implemented") - }), - InformationalListSpecsHandler: informational.ListSpecsHandlerFunc(func(params informational.ListSpecsParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListSpecs has not yet been implemented") - }), - InformationalListSummaryHandler: informational.ListSummaryHandlerFunc(func(params informational.ListSummaryParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation informational.ListSummary has not yet been implemented") - }), - TerminatorListTerminatorsHandler: terminator.ListTerminatorsHandlerFunc(func(params terminator.ListTerminatorsParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.ListTerminators has not yet been implemented") - }), - RouterListTransitRoutersHandler: router.ListTransitRoutersHandlerFunc(func(params router.ListTransitRoutersParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.ListTransitRouters has not yet been implemented") - }), - InformationalListVersionHandler: informational.ListVersionHandlerFunc(func(params informational.ListVersionParams) middleware.Responder { - return middleware.NotImplemented("operation informational.ListVersion has not yet been implemented") - }), - AuthPolicyPatchAuthPolicyHandler: auth_policy.PatchAuthPolicyHandlerFunc(func(params auth_policy.PatchAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.PatchAuthPolicy has not yet been implemented") - }), - AuthenticatorPatchAuthenticatorHandler: authenticator.PatchAuthenticatorHandlerFunc(func(params authenticator.PatchAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.PatchAuthenticator has not yet been implemented") - }), - CertificateAuthorityPatchCaHandler: certificate_authority.PatchCaHandlerFunc(func(params certificate_authority.PatchCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.PatchCa has not yet been implemented") - }), - ConfigPatchConfigHandler: config.PatchConfigHandlerFunc(func(params config.PatchConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.PatchConfig has not yet been implemented") - }), - ConfigPatchConfigTypeHandler: config.PatchConfigTypeHandlerFunc(func(params config.PatchConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.PatchConfigType has not yet been implemented") - }), - CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler: current_api_session.PatchCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.PatchCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.PatchCurrentIdentityAuthenticator has not yet been implemented") - }), - EdgeRouterPatchEdgeRouterHandler: edge_router.PatchEdgeRouterHandlerFunc(func(params edge_router.PatchEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.PatchEdgeRouter has not yet been implemented") - }), - EdgeRouterPolicyPatchEdgeRouterPolicyHandler: edge_router_policy.PatchEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.PatchEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.PatchEdgeRouterPolicy has not yet been implemented") - }), - ExternalJWTSignerPatchExternalJWTSignerHandler: external_jwt_signer.PatchExternalJWTSignerHandlerFunc(func(params external_jwt_signer.PatchExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.PatchExternalJWTSigner has not yet been implemented") - }), - IdentityPatchIdentityHandler: identity.PatchIdentityHandlerFunc(func(params identity.PatchIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.PatchIdentity has not yet been implemented") - }), - PostureChecksPatchPostureCheckHandler: posture_checks.PatchPostureCheckHandlerFunc(func(params posture_checks.PatchPostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.PatchPostureCheck has not yet been implemented") - }), - RouterPatchRouterHandler: router.PatchRouterHandlerFunc(func(params router.PatchRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.PatchRouter has not yet been implemented") - }), - ServicePatchServiceHandler: service.PatchServiceHandlerFunc(func(params service.PatchServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.PatchService has not yet been implemented") - }), - ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler: service_edge_router_policy.PatchServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.PatchServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.PatchServiceEdgeRouterPolicy has not yet been implemented") - }), - ServicePolicyPatchServicePolicyHandler: service_policy.PatchServicePolicyHandlerFunc(func(params service_policy.PatchServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.PatchServicePolicy has not yet been implemented") - }), - TerminatorPatchTerminatorHandler: terminator.PatchTerminatorHandlerFunc(func(params terminator.PatchTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.PatchTerminator has not yet been implemented") - }), - RouterPatchTransitRouterHandler: router.PatchTransitRouterHandlerFunc(func(params router.PatchTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.PatchTransitRouter has not yet been implemented") - }), - AuthenticatorReEnrollAuthenticatorHandler: authenticator.ReEnrollAuthenticatorHandlerFunc(func(params authenticator.ReEnrollAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.ReEnrollAuthenticator has not yet been implemented") - }), - EdgeRouterReEnrollEdgeRouterHandler: edge_router.ReEnrollEdgeRouterHandlerFunc(func(params edge_router.ReEnrollEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.ReEnrollEdgeRouter has not yet been implemented") - }), - EnrollmentRefreshEnrollmentHandler: enrollment.RefreshEnrollmentHandlerFunc(func(params enrollment.RefreshEnrollmentParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation enrollment.RefreshEnrollment has not yet been implemented") - }), - IdentityRemoveIdentityMfaHandler: identity.RemoveIdentityMfaHandlerFunc(func(params identity.RemoveIdentityMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.RemoveIdentityMfa has not yet been implemented") - }), - AuthPolicyUpdateAuthPolicyHandler: auth_policy.UpdateAuthPolicyHandlerFunc(func(params auth_policy.UpdateAuthPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation auth_policy.UpdateAuthPolicy has not yet been implemented") - }), - AuthenticatorUpdateAuthenticatorHandler: authenticator.UpdateAuthenticatorHandlerFunc(func(params authenticator.UpdateAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation authenticator.UpdateAuthenticator has not yet been implemented") - }), - CertificateAuthorityUpdateCaHandler: certificate_authority.UpdateCaHandlerFunc(func(params certificate_authority.UpdateCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.UpdateCa has not yet been implemented") - }), - ConfigUpdateConfigHandler: config.UpdateConfigHandlerFunc(func(params config.UpdateConfigParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.UpdateConfig has not yet been implemented") - }), - ConfigUpdateConfigTypeHandler: config.UpdateConfigTypeHandlerFunc(func(params config.UpdateConfigTypeParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation config.UpdateConfigType has not yet been implemented") - }), - CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler: current_api_session.UpdateCurrentIdentityAuthenticatorHandlerFunc(func(params current_api_session.UpdateCurrentIdentityAuthenticatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_api_session.UpdateCurrentIdentityAuthenticator has not yet been implemented") - }), - EdgeRouterUpdateEdgeRouterHandler: edge_router.UpdateEdgeRouterHandlerFunc(func(params edge_router.UpdateEdgeRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router.UpdateEdgeRouter has not yet been implemented") - }), - EdgeRouterPolicyUpdateEdgeRouterPolicyHandler: edge_router_policy.UpdateEdgeRouterPolicyHandlerFunc(func(params edge_router_policy.UpdateEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation edge_router_policy.UpdateEdgeRouterPolicy has not yet been implemented") - }), - ExternalJWTSignerUpdateExternalJWTSignerHandler: external_jwt_signer.UpdateExternalJWTSignerHandlerFunc(func(params external_jwt_signer.UpdateExternalJWTSignerParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation external_jwt_signer.UpdateExternalJWTSigner has not yet been implemented") - }), - IdentityUpdateIdentityHandler: identity.UpdateIdentityHandlerFunc(func(params identity.UpdateIdentityParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.UpdateIdentity has not yet been implemented") - }), - IdentityUpdateIdentityTracingHandler: identity.UpdateIdentityTracingHandlerFunc(func(params identity.UpdateIdentityTracingParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation identity.UpdateIdentityTracing has not yet been implemented") - }), - PostureChecksUpdatePostureCheckHandler: posture_checks.UpdatePostureCheckHandlerFunc(func(params posture_checks.UpdatePostureCheckParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation posture_checks.UpdatePostureCheck has not yet been implemented") - }), - RouterUpdateRouterHandler: router.UpdateRouterHandlerFunc(func(params router.UpdateRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.UpdateRouter has not yet been implemented") - }), - ServiceUpdateServiceHandler: service.UpdateServiceHandlerFunc(func(params service.UpdateServiceParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service.UpdateService has not yet been implemented") - }), - ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler: service_edge_router_policy.UpdateServiceEdgeRouterPolicyHandlerFunc(func(params service_edge_router_policy.UpdateServiceEdgeRouterPolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_edge_router_policy.UpdateServiceEdgeRouterPolicy has not yet been implemented") - }), - ServicePolicyUpdateServicePolicyHandler: service_policy.UpdateServicePolicyHandlerFunc(func(params service_policy.UpdateServicePolicyParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation service_policy.UpdateServicePolicy has not yet been implemented") - }), - TerminatorUpdateTerminatorHandler: terminator.UpdateTerminatorHandlerFunc(func(params terminator.UpdateTerminatorParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation terminator.UpdateTerminator has not yet been implemented") - }), - RouterUpdateTransitRouterHandler: router.UpdateTransitRouterHandlerFunc(func(params router.UpdateTransitRouterParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation router.UpdateTransitRouter has not yet been implemented") - }), - CertificateAuthorityVerifyCaHandler: certificate_authority.VerifyCaHandlerFunc(func(params certificate_authority.VerifyCaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation certificate_authority.VerifyCa has not yet been implemented") - }), - CurrentIdentityVerifyMfaHandler: current_identity.VerifyMfaHandlerFunc(func(params current_identity.VerifyMfaParams, principal interface{}) middleware.Responder { - return middleware.NotImplemented("operation current_identity.VerifyMfa has not yet been implemented") - }), - - // Applies when the "zt-session" header is set - ZtSessionAuth: func(token string) (interface{}, error) { - return nil, errors.NotImplemented("api key auth (ztSession) zt-session from header param [zt-session] has not yet been implemented") - }, - // default authorizer is authorized meaning no requests are blocked - APIAuthorizer: security.Authorized(), - } -} - -/*ZitiEdgeManagementAPI OpenZiti Edge Management API */ -type ZitiEdgeManagementAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - // TxtConsumer registers a consumer for the following mime types: - // - text/plain - TxtConsumer runtime.Consumer - - // ApplicationJWTProducer registers a producer for the following mime types: - // - application/jwt - ApplicationJWTProducer runtime.Producer - // BinProducer registers a producer for the following mime types: - // - image/png - BinProducer runtime.Producer - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - // TextYamlProducer registers a producer for the following mime types: - // - text/yaml - TextYamlProducer runtime.Producer - - // ZtSessionAuth registers a function that takes a token and returns a principal - // it performs authentication based on an api key zt-session provided in the header - ZtSessionAuth func(string) (interface{}, error) - - // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal - APIAuthorizer runtime.Authorizer - - // CurrentAPISessionDeleteCurrentAPISessionHandler sets the operation handler for the delete current API session operation - CurrentAPISessionDeleteCurrentAPISessionHandler current_api_session.DeleteCurrentAPISessionHandler - // IdentityAssociateIdentitysServiceConfigsHandler sets the operation handler for the associate identitys service configs operation - IdentityAssociateIdentitysServiceConfigsHandler identity.AssociateIdentitysServiceConfigsHandler - // AuthenticationAuthenticateHandler sets the operation handler for the authenticate operation - AuthenticationAuthenticateHandler authentication.AuthenticateHandler - // AuthenticationAuthenticateMfaHandler sets the operation handler for the authenticate mfa operation - AuthenticationAuthenticateMfaHandler authentication.AuthenticateMfaHandler - // DatabaseCheckDataIntegrityHandler sets the operation handler for the check data integrity operation - DatabaseCheckDataIntegrityHandler database.CheckDataIntegrityHandler - // AuthPolicyCreateAuthPolicyHandler sets the operation handler for the create auth policy operation - AuthPolicyCreateAuthPolicyHandler auth_policy.CreateAuthPolicyHandler - // AuthenticatorCreateAuthenticatorHandler sets the operation handler for the create authenticator operation - AuthenticatorCreateAuthenticatorHandler authenticator.CreateAuthenticatorHandler - // CertificateAuthorityCreateCaHandler sets the operation handler for the create ca operation - CertificateAuthorityCreateCaHandler certificate_authority.CreateCaHandler - // ConfigCreateConfigHandler sets the operation handler for the create config operation - ConfigCreateConfigHandler config.CreateConfigHandler - // ConfigCreateConfigTypeHandler sets the operation handler for the create config type operation - ConfigCreateConfigTypeHandler config.CreateConfigTypeHandler - // DatabaseCreateDatabaseSnapshotHandler sets the operation handler for the create database snapshot operation - DatabaseCreateDatabaseSnapshotHandler database.CreateDatabaseSnapshotHandler - // EdgeRouterCreateEdgeRouterHandler sets the operation handler for the create edge router operation - EdgeRouterCreateEdgeRouterHandler edge_router.CreateEdgeRouterHandler - // EdgeRouterPolicyCreateEdgeRouterPolicyHandler sets the operation handler for the create edge router policy operation - EdgeRouterPolicyCreateEdgeRouterPolicyHandler edge_router_policy.CreateEdgeRouterPolicyHandler - // EnrollmentCreateEnrollmentHandler sets the operation handler for the create enrollment operation - EnrollmentCreateEnrollmentHandler enrollment.CreateEnrollmentHandler - // ExternalJWTSignerCreateExternalJWTSignerHandler sets the operation handler for the create external Jwt signer operation - ExternalJWTSignerCreateExternalJWTSignerHandler external_jwt_signer.CreateExternalJWTSignerHandler - // IdentityCreateIdentityHandler sets the operation handler for the create identity operation - IdentityCreateIdentityHandler identity.CreateIdentityHandler - // CurrentIdentityCreateMfaRecoveryCodesHandler sets the operation handler for the create mfa recovery codes operation - CurrentIdentityCreateMfaRecoveryCodesHandler current_identity.CreateMfaRecoveryCodesHandler - // PostureChecksCreatePostureCheckHandler sets the operation handler for the create posture check operation - PostureChecksCreatePostureCheckHandler posture_checks.CreatePostureCheckHandler - // RouterCreateRouterHandler sets the operation handler for the create router operation - RouterCreateRouterHandler router.CreateRouterHandler - // ServiceCreateServiceHandler sets the operation handler for the create service operation - ServiceCreateServiceHandler service.CreateServiceHandler - // ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler sets the operation handler for the create service edge router policy operation - ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler service_edge_router_policy.CreateServiceEdgeRouterPolicyHandler - // ServicePolicyCreateServicePolicyHandler sets the operation handler for the create service policy operation - ServicePolicyCreateServicePolicyHandler service_policy.CreateServicePolicyHandler - // TerminatorCreateTerminatorHandler sets the operation handler for the create terminator operation - TerminatorCreateTerminatorHandler terminator.CreateTerminatorHandler - // RouterCreateTransitRouterHandler sets the operation handler for the create transit router operation - RouterCreateTransitRouterHandler router.CreateTransitRouterHandler - // DatabaseDataIntegrityResultsHandler sets the operation handler for the data integrity results operation - DatabaseDataIntegrityResultsHandler database.DataIntegrityResultsHandler - // APISessionDeleteAPISessionsHandler sets the operation handler for the delete API sessions operation - APISessionDeleteAPISessionsHandler api_session.DeleteAPISessionsHandler - // AuthPolicyDeleteAuthPolicyHandler sets the operation handler for the delete auth policy operation - AuthPolicyDeleteAuthPolicyHandler auth_policy.DeleteAuthPolicyHandler - // AuthenticatorDeleteAuthenticatorHandler sets the operation handler for the delete authenticator operation - AuthenticatorDeleteAuthenticatorHandler authenticator.DeleteAuthenticatorHandler - // CertificateAuthorityDeleteCaHandler sets the operation handler for the delete ca operation - CertificateAuthorityDeleteCaHandler certificate_authority.DeleteCaHandler - // ConfigDeleteConfigHandler sets the operation handler for the delete config operation - ConfigDeleteConfigHandler config.DeleteConfigHandler - // ConfigDeleteConfigTypeHandler sets the operation handler for the delete config type operation - ConfigDeleteConfigTypeHandler config.DeleteConfigTypeHandler - // EdgeRouterDeleteEdgeRouterHandler sets the operation handler for the delete edge router operation - EdgeRouterDeleteEdgeRouterHandler edge_router.DeleteEdgeRouterHandler - // EdgeRouterPolicyDeleteEdgeRouterPolicyHandler sets the operation handler for the delete edge router policy operation - EdgeRouterPolicyDeleteEdgeRouterPolicyHandler edge_router_policy.DeleteEdgeRouterPolicyHandler - // EnrollmentDeleteEnrollmentHandler sets the operation handler for the delete enrollment operation - EnrollmentDeleteEnrollmentHandler enrollment.DeleteEnrollmentHandler - // ExternalJWTSignerDeleteExternalJWTSignerHandler sets the operation handler for the delete external Jwt signer operation - ExternalJWTSignerDeleteExternalJWTSignerHandler external_jwt_signer.DeleteExternalJWTSignerHandler - // IdentityDeleteIdentityHandler sets the operation handler for the delete identity operation - IdentityDeleteIdentityHandler identity.DeleteIdentityHandler - // CurrentIdentityDeleteMfaHandler sets the operation handler for the delete mfa operation - CurrentIdentityDeleteMfaHandler current_identity.DeleteMfaHandler - // PostureChecksDeletePostureCheckHandler sets the operation handler for the delete posture check operation - PostureChecksDeletePostureCheckHandler posture_checks.DeletePostureCheckHandler - // RouterDeleteRouterHandler sets the operation handler for the delete router operation - RouterDeleteRouterHandler router.DeleteRouterHandler - // ServiceDeleteServiceHandler sets the operation handler for the delete service operation - ServiceDeleteServiceHandler service.DeleteServiceHandler - // ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler sets the operation handler for the delete service edge router policy operation - ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler service_edge_router_policy.DeleteServiceEdgeRouterPolicyHandler - // ServicePolicyDeleteServicePolicyHandler sets the operation handler for the delete service policy operation - ServicePolicyDeleteServicePolicyHandler service_policy.DeleteServicePolicyHandler - // SessionDeleteSessionHandler sets the operation handler for the delete session operation - SessionDeleteSessionHandler session.DeleteSessionHandler - // TerminatorDeleteTerminatorHandler sets the operation handler for the delete terminator operation - TerminatorDeleteTerminatorHandler terminator.DeleteTerminatorHandler - // RouterDeleteTransitRouterHandler sets the operation handler for the delete transit router operation - RouterDeleteTransitRouterHandler router.DeleteTransitRouterHandler - // APISessionDetailAPISessionsHandler sets the operation handler for the detail API sessions operation - APISessionDetailAPISessionsHandler api_session.DetailAPISessionsHandler - // AuthPolicyDetailAuthPolicyHandler sets the operation handler for the detail auth policy operation - AuthPolicyDetailAuthPolicyHandler auth_policy.DetailAuthPolicyHandler - // AuthenticatorDetailAuthenticatorHandler sets the operation handler for the detail authenticator operation - AuthenticatorDetailAuthenticatorHandler authenticator.DetailAuthenticatorHandler - // CertificateAuthorityDetailCaHandler sets the operation handler for the detail ca operation - CertificateAuthorityDetailCaHandler certificate_authority.DetailCaHandler - // ConfigDetailConfigHandler sets the operation handler for the detail config operation - ConfigDetailConfigHandler config.DetailConfigHandler - // ConfigDetailConfigTypeHandler sets the operation handler for the detail config type operation - ConfigDetailConfigTypeHandler config.DetailConfigTypeHandler - // CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler sets the operation handler for the detail current identity authenticator operation - CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler current_api_session.DetailCurrentIdentityAuthenticatorHandler - // EdgeRouterDetailEdgeRouterHandler sets the operation handler for the detail edge router operation - EdgeRouterDetailEdgeRouterHandler edge_router.DetailEdgeRouterHandler - // EdgeRouterPolicyDetailEdgeRouterPolicyHandler sets the operation handler for the detail edge router policy operation - EdgeRouterPolicyDetailEdgeRouterPolicyHandler edge_router_policy.DetailEdgeRouterPolicyHandler - // EnrollmentDetailEnrollmentHandler sets the operation handler for the detail enrollment operation - EnrollmentDetailEnrollmentHandler enrollment.DetailEnrollmentHandler - // ExternalJWTSignerDetailExternalJWTSignerHandler sets the operation handler for the detail external Jwt signer operation - ExternalJWTSignerDetailExternalJWTSignerHandler external_jwt_signer.DetailExternalJWTSignerHandler - // IdentityDetailIdentityHandler sets the operation handler for the detail identity operation - IdentityDetailIdentityHandler identity.DetailIdentityHandler - // IdentityDetailIdentityTypeHandler sets the operation handler for the detail identity type operation - IdentityDetailIdentityTypeHandler identity.DetailIdentityTypeHandler - // CurrentIdentityDetailMfaHandler sets the operation handler for the detail mfa operation - CurrentIdentityDetailMfaHandler current_identity.DetailMfaHandler - // CurrentIdentityDetailMfaQrCodeHandler sets the operation handler for the detail mfa qr code operation - CurrentIdentityDetailMfaQrCodeHandler current_identity.DetailMfaQrCodeHandler - // CurrentIdentityDetailMfaRecoveryCodesHandler sets the operation handler for the detail mfa recovery codes operation - CurrentIdentityDetailMfaRecoveryCodesHandler current_identity.DetailMfaRecoveryCodesHandler - // PostureChecksDetailPostureCheckHandler sets the operation handler for the detail posture check operation - PostureChecksDetailPostureCheckHandler posture_checks.DetailPostureCheckHandler - // PostureChecksDetailPostureCheckTypeHandler sets the operation handler for the detail posture check type operation - PostureChecksDetailPostureCheckTypeHandler posture_checks.DetailPostureCheckTypeHandler - // RouterDetailRouterHandler sets the operation handler for the detail router operation - RouterDetailRouterHandler router.DetailRouterHandler - // ServiceDetailServiceHandler sets the operation handler for the detail service operation - ServiceDetailServiceHandler service.DetailServiceHandler - // ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler sets the operation handler for the detail service edge router policy operation - ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler service_edge_router_policy.DetailServiceEdgeRouterPolicyHandler - // ServicePolicyDetailServicePolicyHandler sets the operation handler for the detail service policy operation - ServicePolicyDetailServicePolicyHandler service_policy.DetailServicePolicyHandler - // SessionDetailSessionHandler sets the operation handler for the detail session operation - SessionDetailSessionHandler session.DetailSessionHandler - // SessionDetailSessionRoutePathHandler sets the operation handler for the detail session route path operation - SessionDetailSessionRoutePathHandler session.DetailSessionRoutePathHandler - // InformationalDetailSpecHandler sets the operation handler for the detail spec operation - InformationalDetailSpecHandler informational.DetailSpecHandler - // InformationalDetailSpecBodyHandler sets the operation handler for the detail spec body operation - InformationalDetailSpecBodyHandler informational.DetailSpecBodyHandler - // TerminatorDetailTerminatorHandler sets the operation handler for the detail terminator operation - TerminatorDetailTerminatorHandler terminator.DetailTerminatorHandler - // RouterDetailTransitRouterHandler sets the operation handler for the detail transit router operation - RouterDetailTransitRouterHandler router.DetailTransitRouterHandler - // IdentityDisableIdentityHandler sets the operation handler for the disable identity operation - IdentityDisableIdentityHandler identity.DisableIdentityHandler - // IdentityDisassociateIdentitysServiceConfigsHandler sets the operation handler for the disassociate identitys service configs operation - IdentityDisassociateIdentitysServiceConfigsHandler identity.DisassociateIdentitysServiceConfigsHandler - // IdentityEnableIdentityHandler sets the operation handler for the enable identity operation - IdentityEnableIdentityHandler identity.EnableIdentityHandler - // CurrentIdentityEnrollMfaHandler sets the operation handler for the enroll mfa operation - CurrentIdentityEnrollMfaHandler current_identity.EnrollMfaHandler - // CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler sets the operation handler for the extend current identity authenticator operation - CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler current_api_session.ExtendCurrentIdentityAuthenticatorHandler - // CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler sets the operation handler for the extend verify current identity authenticator operation - CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandler - // DatabaseFixDataIntegrityHandler sets the operation handler for the fix data integrity operation - DatabaseFixDataIntegrityHandler database.FixDataIntegrityHandler - // CertificateAuthorityGetCaJWTHandler sets the operation handler for the get ca Jwt operation - CertificateAuthorityGetCaJWTHandler certificate_authority.GetCaJWTHandler - // CurrentAPISessionGetCurrentAPISessionHandler sets the operation handler for the get current API session operation - CurrentAPISessionGetCurrentAPISessionHandler current_api_session.GetCurrentAPISessionHandler - // CurrentIdentityGetCurrentIdentityHandler sets the operation handler for the get current identity operation - CurrentIdentityGetCurrentIdentityHandler current_identity.GetCurrentIdentityHandler - // IdentityGetIdentityAuthenticatorsHandler sets the operation handler for the get identity authenticators operation - IdentityGetIdentityAuthenticatorsHandler identity.GetIdentityAuthenticatorsHandler - // IdentityGetIdentityEnrollmentsHandler sets the operation handler for the get identity enrollments operation - IdentityGetIdentityEnrollmentsHandler identity.GetIdentityEnrollmentsHandler - // IdentityGetIdentityFailedServiceRequestsHandler sets the operation handler for the get identity failed service requests operation - IdentityGetIdentityFailedServiceRequestsHandler identity.GetIdentityFailedServiceRequestsHandler - // IdentityGetIdentityPolicyAdviceHandler sets the operation handler for the get identity policy advice operation - IdentityGetIdentityPolicyAdviceHandler identity.GetIdentityPolicyAdviceHandler - // IdentityGetIdentityPostureDataHandler sets the operation handler for the get identity posture data operation - IdentityGetIdentityPostureDataHandler identity.GetIdentityPostureDataHandler - // APISessionListAPISessionsHandler sets the operation handler for the list API sessions operation - APISessionListAPISessionsHandler api_session.ListAPISessionsHandler - // AuthPolicyListAuthPoliciesHandler sets the operation handler for the list auth policies operation - AuthPolicyListAuthPoliciesHandler auth_policy.ListAuthPoliciesHandler - // AuthenticatorListAuthenticatorsHandler sets the operation handler for the list authenticators operation - AuthenticatorListAuthenticatorsHandler authenticator.ListAuthenticatorsHandler - // CertificateAuthorityListCasHandler sets the operation handler for the list cas operation - CertificateAuthorityListCasHandler certificate_authority.ListCasHandler - // ConfigListConfigTypesHandler sets the operation handler for the list config types operation - ConfigListConfigTypesHandler config.ListConfigTypesHandler - // ConfigListConfigsHandler sets the operation handler for the list configs operation - ConfigListConfigsHandler config.ListConfigsHandler - // ConfigListConfigsForConfigTypeHandler sets the operation handler for the list configs for config type operation - ConfigListConfigsForConfigTypeHandler config.ListConfigsForConfigTypeHandler - // CurrentAPISessionListCurrentIdentityAuthenticatorsHandler sets the operation handler for the list current identity authenticators operation - CurrentAPISessionListCurrentIdentityAuthenticatorsHandler current_api_session.ListCurrentIdentityAuthenticatorsHandler - // EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler sets the operation handler for the list edge router edge router policies operation - EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler edge_router.ListEdgeRouterEdgeRouterPoliciesHandler - // EdgeRouterListEdgeRouterIdentitiesHandler sets the operation handler for the list edge router identities operation - EdgeRouterListEdgeRouterIdentitiesHandler edge_router.ListEdgeRouterIdentitiesHandler - // EdgeRouterPolicyListEdgeRouterPoliciesHandler sets the operation handler for the list edge router policies operation - EdgeRouterPolicyListEdgeRouterPoliciesHandler edge_router_policy.ListEdgeRouterPoliciesHandler - // EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler sets the operation handler for the list edge router policy edge routers operation - EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler edge_router_policy.ListEdgeRouterPolicyEdgeRoutersHandler - // EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler sets the operation handler for the list edge router policy identities operation - EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler edge_router_policy.ListEdgeRouterPolicyIdentitiesHandler - // RoleAttributesListEdgeRouterRoleAttributesHandler sets the operation handler for the list edge router role attributes operation - RoleAttributesListEdgeRouterRoleAttributesHandler role_attributes.ListEdgeRouterRoleAttributesHandler - // EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler sets the operation handler for the list edge router service edge router policies operation - EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler edge_router.ListEdgeRouterServiceEdgeRouterPoliciesHandler - // EdgeRouterListEdgeRouterServicesHandler sets the operation handler for the list edge router services operation - EdgeRouterListEdgeRouterServicesHandler edge_router.ListEdgeRouterServicesHandler - // EdgeRouterListEdgeRoutersHandler sets the operation handler for the list edge routers operation - EdgeRouterListEdgeRoutersHandler edge_router.ListEdgeRoutersHandler - // EnrollmentListEnrollmentsHandler sets the operation handler for the list enrollments operation - EnrollmentListEnrollmentsHandler enrollment.ListEnrollmentsHandler - // ExternalJWTSignerListExternalJWTSignersHandler sets the operation handler for the list external Jwt signers operation - ExternalJWTSignerListExternalJWTSignersHandler external_jwt_signer.ListExternalJWTSignersHandler - // IdentityListIdentitiesHandler sets the operation handler for the list identities operation - IdentityListIdentitiesHandler identity.ListIdentitiesHandler - // IdentityListIdentityEdgeRoutersHandler sets the operation handler for the list identity edge routers operation - IdentityListIdentityEdgeRoutersHandler identity.ListIdentityEdgeRoutersHandler - // RoleAttributesListIdentityRoleAttributesHandler sets the operation handler for the list identity role attributes operation - RoleAttributesListIdentityRoleAttributesHandler role_attributes.ListIdentityRoleAttributesHandler - // IdentityListIdentityServicePoliciesHandler sets the operation handler for the list identity service policies operation - IdentityListIdentityServicePoliciesHandler identity.ListIdentityServicePoliciesHandler - // IdentityListIdentityServicesHandler sets the operation handler for the list identity services operation - IdentityListIdentityServicesHandler identity.ListIdentityServicesHandler - // IdentityListIdentityTypesHandler sets the operation handler for the list identity types operation - IdentityListIdentityTypesHandler identity.ListIdentityTypesHandler - // IdentityListIdentitysEdgeRouterPoliciesHandler sets the operation handler for the list identitys edge router policies operation - IdentityListIdentitysEdgeRouterPoliciesHandler identity.ListIdentitysEdgeRouterPoliciesHandler - // IdentityListIdentitysServiceConfigsHandler sets the operation handler for the list identitys service configs operation - IdentityListIdentitysServiceConfigsHandler identity.ListIdentitysServiceConfigsHandler - // PostureChecksListPostureCheckTypesHandler sets the operation handler for the list posture check types operation - PostureChecksListPostureCheckTypesHandler posture_checks.ListPostureCheckTypesHandler - // PostureChecksListPostureChecksHandler sets the operation handler for the list posture checks operation - PostureChecksListPostureChecksHandler posture_checks.ListPostureChecksHandler - // InformationalListRootHandler sets the operation handler for the list root operation - InformationalListRootHandler informational.ListRootHandler - // RouterListRoutersHandler sets the operation handler for the list routers operation - RouterListRoutersHandler router.ListRoutersHandler - // ServiceListServiceConfigHandler sets the operation handler for the list service config operation - ServiceListServiceConfigHandler service.ListServiceConfigHandler - // ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler sets the operation handler for the list service edge router policies operation - ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler service_edge_router_policy.ListServiceEdgeRouterPoliciesHandler - // ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler sets the operation handler for the list service edge router policy edge routers operation - ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersHandler - // ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler sets the operation handler for the list service edge router policy services operation - ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler service_edge_router_policy.ListServiceEdgeRouterPolicyServicesHandler - // ServiceListServiceEdgeRoutersHandler sets the operation handler for the list service edge routers operation - ServiceListServiceEdgeRoutersHandler service.ListServiceEdgeRoutersHandler - // ServiceListServiceIdentitiesHandler sets the operation handler for the list service identities operation - ServiceListServiceIdentitiesHandler service.ListServiceIdentitiesHandler - // ServicePolicyListServicePoliciesHandler sets the operation handler for the list service policies operation - ServicePolicyListServicePoliciesHandler service_policy.ListServicePoliciesHandler - // ServicePolicyListServicePolicyIdentitiesHandler sets the operation handler for the list service policy identities operation - ServicePolicyListServicePolicyIdentitiesHandler service_policy.ListServicePolicyIdentitiesHandler - // ServicePolicyListServicePolicyPostureChecksHandler sets the operation handler for the list service policy posture checks operation - ServicePolicyListServicePolicyPostureChecksHandler service_policy.ListServicePolicyPostureChecksHandler - // ServicePolicyListServicePolicyServicesHandler sets the operation handler for the list service policy services operation - ServicePolicyListServicePolicyServicesHandler service_policy.ListServicePolicyServicesHandler - // RoleAttributesListServiceRoleAttributesHandler sets the operation handler for the list service role attributes operation - RoleAttributesListServiceRoleAttributesHandler role_attributes.ListServiceRoleAttributesHandler - // ServiceListServiceServiceEdgeRouterPoliciesHandler sets the operation handler for the list service service edge router policies operation - ServiceListServiceServiceEdgeRouterPoliciesHandler service.ListServiceServiceEdgeRouterPoliciesHandler - // ServiceListServiceServicePoliciesHandler sets the operation handler for the list service service policies operation - ServiceListServiceServicePoliciesHandler service.ListServiceServicePoliciesHandler - // ServiceListServiceTerminatorsHandler sets the operation handler for the list service terminators operation - ServiceListServiceTerminatorsHandler service.ListServiceTerminatorsHandler - // ServiceListServicesHandler sets the operation handler for the list services operation - ServiceListServicesHandler service.ListServicesHandler - // SessionListSessionsHandler sets the operation handler for the list sessions operation - SessionListSessionsHandler session.ListSessionsHandler - // InformationalListSpecsHandler sets the operation handler for the list specs operation - InformationalListSpecsHandler informational.ListSpecsHandler - // InformationalListSummaryHandler sets the operation handler for the list summary operation - InformationalListSummaryHandler informational.ListSummaryHandler - // TerminatorListTerminatorsHandler sets the operation handler for the list terminators operation - TerminatorListTerminatorsHandler terminator.ListTerminatorsHandler - // RouterListTransitRoutersHandler sets the operation handler for the list transit routers operation - RouterListTransitRoutersHandler router.ListTransitRoutersHandler - // InformationalListVersionHandler sets the operation handler for the list version operation - InformationalListVersionHandler informational.ListVersionHandler - // AuthPolicyPatchAuthPolicyHandler sets the operation handler for the patch auth policy operation - AuthPolicyPatchAuthPolicyHandler auth_policy.PatchAuthPolicyHandler - // AuthenticatorPatchAuthenticatorHandler sets the operation handler for the patch authenticator operation - AuthenticatorPatchAuthenticatorHandler authenticator.PatchAuthenticatorHandler - // CertificateAuthorityPatchCaHandler sets the operation handler for the patch ca operation - CertificateAuthorityPatchCaHandler certificate_authority.PatchCaHandler - // ConfigPatchConfigHandler sets the operation handler for the patch config operation - ConfigPatchConfigHandler config.PatchConfigHandler - // ConfigPatchConfigTypeHandler sets the operation handler for the patch config type operation - ConfigPatchConfigTypeHandler config.PatchConfigTypeHandler - // CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler sets the operation handler for the patch current identity authenticator operation - CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler current_api_session.PatchCurrentIdentityAuthenticatorHandler - // EdgeRouterPatchEdgeRouterHandler sets the operation handler for the patch edge router operation - EdgeRouterPatchEdgeRouterHandler edge_router.PatchEdgeRouterHandler - // EdgeRouterPolicyPatchEdgeRouterPolicyHandler sets the operation handler for the patch edge router policy operation - EdgeRouterPolicyPatchEdgeRouterPolicyHandler edge_router_policy.PatchEdgeRouterPolicyHandler - // ExternalJWTSignerPatchExternalJWTSignerHandler sets the operation handler for the patch external Jwt signer operation - ExternalJWTSignerPatchExternalJWTSignerHandler external_jwt_signer.PatchExternalJWTSignerHandler - // IdentityPatchIdentityHandler sets the operation handler for the patch identity operation - IdentityPatchIdentityHandler identity.PatchIdentityHandler - // PostureChecksPatchPostureCheckHandler sets the operation handler for the patch posture check operation - PostureChecksPatchPostureCheckHandler posture_checks.PatchPostureCheckHandler - // RouterPatchRouterHandler sets the operation handler for the patch router operation - RouterPatchRouterHandler router.PatchRouterHandler - // ServicePatchServiceHandler sets the operation handler for the patch service operation - ServicePatchServiceHandler service.PatchServiceHandler - // ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler sets the operation handler for the patch service edge router policy operation - ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler service_edge_router_policy.PatchServiceEdgeRouterPolicyHandler - // ServicePolicyPatchServicePolicyHandler sets the operation handler for the patch service policy operation - ServicePolicyPatchServicePolicyHandler service_policy.PatchServicePolicyHandler - // TerminatorPatchTerminatorHandler sets the operation handler for the patch terminator operation - TerminatorPatchTerminatorHandler terminator.PatchTerminatorHandler - // RouterPatchTransitRouterHandler sets the operation handler for the patch transit router operation - RouterPatchTransitRouterHandler router.PatchTransitRouterHandler - // AuthenticatorReEnrollAuthenticatorHandler sets the operation handler for the re enroll authenticator operation - AuthenticatorReEnrollAuthenticatorHandler authenticator.ReEnrollAuthenticatorHandler - // EdgeRouterReEnrollEdgeRouterHandler sets the operation handler for the re enroll edge router operation - EdgeRouterReEnrollEdgeRouterHandler edge_router.ReEnrollEdgeRouterHandler - // EnrollmentRefreshEnrollmentHandler sets the operation handler for the refresh enrollment operation - EnrollmentRefreshEnrollmentHandler enrollment.RefreshEnrollmentHandler - // IdentityRemoveIdentityMfaHandler sets the operation handler for the remove identity mfa operation - IdentityRemoveIdentityMfaHandler identity.RemoveIdentityMfaHandler - // AuthPolicyUpdateAuthPolicyHandler sets the operation handler for the update auth policy operation - AuthPolicyUpdateAuthPolicyHandler auth_policy.UpdateAuthPolicyHandler - // AuthenticatorUpdateAuthenticatorHandler sets the operation handler for the update authenticator operation - AuthenticatorUpdateAuthenticatorHandler authenticator.UpdateAuthenticatorHandler - // CertificateAuthorityUpdateCaHandler sets the operation handler for the update ca operation - CertificateAuthorityUpdateCaHandler certificate_authority.UpdateCaHandler - // ConfigUpdateConfigHandler sets the operation handler for the update config operation - ConfigUpdateConfigHandler config.UpdateConfigHandler - // ConfigUpdateConfigTypeHandler sets the operation handler for the update config type operation - ConfigUpdateConfigTypeHandler config.UpdateConfigTypeHandler - // CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler sets the operation handler for the update current identity authenticator operation - CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler current_api_session.UpdateCurrentIdentityAuthenticatorHandler - // EdgeRouterUpdateEdgeRouterHandler sets the operation handler for the update edge router operation - EdgeRouterUpdateEdgeRouterHandler edge_router.UpdateEdgeRouterHandler - // EdgeRouterPolicyUpdateEdgeRouterPolicyHandler sets the operation handler for the update edge router policy operation - EdgeRouterPolicyUpdateEdgeRouterPolicyHandler edge_router_policy.UpdateEdgeRouterPolicyHandler - // ExternalJWTSignerUpdateExternalJWTSignerHandler sets the operation handler for the update external Jwt signer operation - ExternalJWTSignerUpdateExternalJWTSignerHandler external_jwt_signer.UpdateExternalJWTSignerHandler - // IdentityUpdateIdentityHandler sets the operation handler for the update identity operation - IdentityUpdateIdentityHandler identity.UpdateIdentityHandler - // IdentityUpdateIdentityTracingHandler sets the operation handler for the update identity tracing operation - IdentityUpdateIdentityTracingHandler identity.UpdateIdentityTracingHandler - // PostureChecksUpdatePostureCheckHandler sets the operation handler for the update posture check operation - PostureChecksUpdatePostureCheckHandler posture_checks.UpdatePostureCheckHandler - // RouterUpdateRouterHandler sets the operation handler for the update router operation - RouterUpdateRouterHandler router.UpdateRouterHandler - // ServiceUpdateServiceHandler sets the operation handler for the update service operation - ServiceUpdateServiceHandler service.UpdateServiceHandler - // ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler sets the operation handler for the update service edge router policy operation - ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler service_edge_router_policy.UpdateServiceEdgeRouterPolicyHandler - // ServicePolicyUpdateServicePolicyHandler sets the operation handler for the update service policy operation - ServicePolicyUpdateServicePolicyHandler service_policy.UpdateServicePolicyHandler - // TerminatorUpdateTerminatorHandler sets the operation handler for the update terminator operation - TerminatorUpdateTerminatorHandler terminator.UpdateTerminatorHandler - // RouterUpdateTransitRouterHandler sets the operation handler for the update transit router operation - RouterUpdateTransitRouterHandler router.UpdateTransitRouterHandler - // CertificateAuthorityVerifyCaHandler sets the operation handler for the verify ca operation - CertificateAuthorityVerifyCaHandler certificate_authority.VerifyCaHandler - // CurrentIdentityVerifyMfaHandler sets the operation handler for the verify mfa operation - CurrentIdentityVerifyMfaHandler current_identity.VerifyMfaHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *ZitiEdgeManagementAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *ZitiEdgeManagementAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *ZitiEdgeManagementAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *ZitiEdgeManagementAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *ZitiEdgeManagementAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *ZitiEdgeManagementAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *ZitiEdgeManagementAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *ZitiEdgeManagementAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *ZitiEdgeManagementAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the ZitiEdgeManagementAPI -func (o *ZitiEdgeManagementAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - if o.TxtConsumer == nil { - unregistered = append(unregistered, "TxtConsumer") - } - - if o.ApplicationJWTProducer == nil { - unregistered = append(unregistered, "ApplicationJWTProducer") - } - if o.BinProducer == nil { - unregistered = append(unregistered, "BinProducer") - } - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - if o.TextYamlProducer == nil { - unregistered = append(unregistered, "TextYamlProducer") - } - - if o.ZtSessionAuth == nil { - unregistered = append(unregistered, "ZtSessionAuth") - } - - if o.CurrentAPISessionDeleteCurrentAPISessionHandler == nil { - unregistered = append(unregistered, "current_api_session.DeleteCurrentAPISessionHandler") - } - if o.IdentityAssociateIdentitysServiceConfigsHandler == nil { - unregistered = append(unregistered, "identity.AssociateIdentitysServiceConfigsHandler") - } - if o.AuthenticationAuthenticateHandler == nil { - unregistered = append(unregistered, "authentication.AuthenticateHandler") - } - if o.AuthenticationAuthenticateMfaHandler == nil { - unregistered = append(unregistered, "authentication.AuthenticateMfaHandler") - } - if o.DatabaseCheckDataIntegrityHandler == nil { - unregistered = append(unregistered, "database.CheckDataIntegrityHandler") - } - if o.AuthPolicyCreateAuthPolicyHandler == nil { - unregistered = append(unregistered, "auth_policy.CreateAuthPolicyHandler") - } - if o.AuthenticatorCreateAuthenticatorHandler == nil { - unregistered = append(unregistered, "authenticator.CreateAuthenticatorHandler") - } - if o.CertificateAuthorityCreateCaHandler == nil { - unregistered = append(unregistered, "certificate_authority.CreateCaHandler") - } - if o.ConfigCreateConfigHandler == nil { - unregistered = append(unregistered, "config.CreateConfigHandler") - } - if o.ConfigCreateConfigTypeHandler == nil { - unregistered = append(unregistered, "config.CreateConfigTypeHandler") - } - if o.DatabaseCreateDatabaseSnapshotHandler == nil { - unregistered = append(unregistered, "database.CreateDatabaseSnapshotHandler") - } - if o.EdgeRouterCreateEdgeRouterHandler == nil { - unregistered = append(unregistered, "edge_router.CreateEdgeRouterHandler") - } - if o.EdgeRouterPolicyCreateEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "edge_router_policy.CreateEdgeRouterPolicyHandler") - } - if o.EnrollmentCreateEnrollmentHandler == nil { - unregistered = append(unregistered, "enrollment.CreateEnrollmentHandler") - } - if o.ExternalJWTSignerCreateExternalJWTSignerHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.CreateExternalJWTSignerHandler") - } - if o.IdentityCreateIdentityHandler == nil { - unregistered = append(unregistered, "identity.CreateIdentityHandler") - } - if o.CurrentIdentityCreateMfaRecoveryCodesHandler == nil { - unregistered = append(unregistered, "current_identity.CreateMfaRecoveryCodesHandler") - } - if o.PostureChecksCreatePostureCheckHandler == nil { - unregistered = append(unregistered, "posture_checks.CreatePostureCheckHandler") - } - if o.RouterCreateRouterHandler == nil { - unregistered = append(unregistered, "router.CreateRouterHandler") - } - if o.ServiceCreateServiceHandler == nil { - unregistered = append(unregistered, "service.CreateServiceHandler") - } - if o.ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.CreateServiceEdgeRouterPolicyHandler") - } - if o.ServicePolicyCreateServicePolicyHandler == nil { - unregistered = append(unregistered, "service_policy.CreateServicePolicyHandler") - } - if o.TerminatorCreateTerminatorHandler == nil { - unregistered = append(unregistered, "terminator.CreateTerminatorHandler") - } - if o.RouterCreateTransitRouterHandler == nil { - unregistered = append(unregistered, "router.CreateTransitRouterHandler") - } - if o.DatabaseDataIntegrityResultsHandler == nil { - unregistered = append(unregistered, "database.DataIntegrityResultsHandler") - } - if o.APISessionDeleteAPISessionsHandler == nil { - unregistered = append(unregistered, "api_session.DeleteAPISessionsHandler") - } - if o.AuthPolicyDeleteAuthPolicyHandler == nil { - unregistered = append(unregistered, "auth_policy.DeleteAuthPolicyHandler") - } - if o.AuthenticatorDeleteAuthenticatorHandler == nil { - unregistered = append(unregistered, "authenticator.DeleteAuthenticatorHandler") - } - if o.CertificateAuthorityDeleteCaHandler == nil { - unregistered = append(unregistered, "certificate_authority.DeleteCaHandler") - } - if o.ConfigDeleteConfigHandler == nil { - unregistered = append(unregistered, "config.DeleteConfigHandler") - } - if o.ConfigDeleteConfigTypeHandler == nil { - unregistered = append(unregistered, "config.DeleteConfigTypeHandler") - } - if o.EdgeRouterDeleteEdgeRouterHandler == nil { - unregistered = append(unregistered, "edge_router.DeleteEdgeRouterHandler") - } - if o.EdgeRouterPolicyDeleteEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "edge_router_policy.DeleteEdgeRouterPolicyHandler") - } - if o.EnrollmentDeleteEnrollmentHandler == nil { - unregistered = append(unregistered, "enrollment.DeleteEnrollmentHandler") - } - if o.ExternalJWTSignerDeleteExternalJWTSignerHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.DeleteExternalJWTSignerHandler") - } - if o.IdentityDeleteIdentityHandler == nil { - unregistered = append(unregistered, "identity.DeleteIdentityHandler") - } - if o.CurrentIdentityDeleteMfaHandler == nil { - unregistered = append(unregistered, "current_identity.DeleteMfaHandler") - } - if o.PostureChecksDeletePostureCheckHandler == nil { - unregistered = append(unregistered, "posture_checks.DeletePostureCheckHandler") - } - if o.RouterDeleteRouterHandler == nil { - unregistered = append(unregistered, "router.DeleteRouterHandler") - } - if o.ServiceDeleteServiceHandler == nil { - unregistered = append(unregistered, "service.DeleteServiceHandler") - } - if o.ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.DeleteServiceEdgeRouterPolicyHandler") - } - if o.ServicePolicyDeleteServicePolicyHandler == nil { - unregistered = append(unregistered, "service_policy.DeleteServicePolicyHandler") - } - if o.SessionDeleteSessionHandler == nil { - unregistered = append(unregistered, "session.DeleteSessionHandler") - } - if o.TerminatorDeleteTerminatorHandler == nil { - unregistered = append(unregistered, "terminator.DeleteTerminatorHandler") - } - if o.RouterDeleteTransitRouterHandler == nil { - unregistered = append(unregistered, "router.DeleteTransitRouterHandler") - } - if o.APISessionDetailAPISessionsHandler == nil { - unregistered = append(unregistered, "api_session.DetailAPISessionsHandler") - } - if o.AuthPolicyDetailAuthPolicyHandler == nil { - unregistered = append(unregistered, "auth_policy.DetailAuthPolicyHandler") - } - if o.AuthenticatorDetailAuthenticatorHandler == nil { - unregistered = append(unregistered, "authenticator.DetailAuthenticatorHandler") - } - if o.CertificateAuthorityDetailCaHandler == nil { - unregistered = append(unregistered, "certificate_authority.DetailCaHandler") - } - if o.ConfigDetailConfigHandler == nil { - unregistered = append(unregistered, "config.DetailConfigHandler") - } - if o.ConfigDetailConfigTypeHandler == nil { - unregistered = append(unregistered, "config.DetailConfigTypeHandler") - } - if o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.DetailCurrentIdentityAuthenticatorHandler") - } - if o.EdgeRouterDetailEdgeRouterHandler == nil { - unregistered = append(unregistered, "edge_router.DetailEdgeRouterHandler") - } - if o.EdgeRouterPolicyDetailEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "edge_router_policy.DetailEdgeRouterPolicyHandler") - } - if o.EnrollmentDetailEnrollmentHandler == nil { - unregistered = append(unregistered, "enrollment.DetailEnrollmentHandler") - } - if o.ExternalJWTSignerDetailExternalJWTSignerHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.DetailExternalJWTSignerHandler") - } - if o.IdentityDetailIdentityHandler == nil { - unregistered = append(unregistered, "identity.DetailIdentityHandler") - } - if o.IdentityDetailIdentityTypeHandler == nil { - unregistered = append(unregistered, "identity.DetailIdentityTypeHandler") - } - if o.CurrentIdentityDetailMfaHandler == nil { - unregistered = append(unregistered, "current_identity.DetailMfaHandler") - } - if o.CurrentIdentityDetailMfaQrCodeHandler == nil { - unregistered = append(unregistered, "current_identity.DetailMfaQrCodeHandler") - } - if o.CurrentIdentityDetailMfaRecoveryCodesHandler == nil { - unregistered = append(unregistered, "current_identity.DetailMfaRecoveryCodesHandler") - } - if o.PostureChecksDetailPostureCheckHandler == nil { - unregistered = append(unregistered, "posture_checks.DetailPostureCheckHandler") - } - if o.PostureChecksDetailPostureCheckTypeHandler == nil { - unregistered = append(unregistered, "posture_checks.DetailPostureCheckTypeHandler") - } - if o.RouterDetailRouterHandler == nil { - unregistered = append(unregistered, "router.DetailRouterHandler") - } - if o.ServiceDetailServiceHandler == nil { - unregistered = append(unregistered, "service.DetailServiceHandler") - } - if o.ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.DetailServiceEdgeRouterPolicyHandler") - } - if o.ServicePolicyDetailServicePolicyHandler == nil { - unregistered = append(unregistered, "service_policy.DetailServicePolicyHandler") - } - if o.SessionDetailSessionHandler == nil { - unregistered = append(unregistered, "session.DetailSessionHandler") - } - if o.SessionDetailSessionRoutePathHandler == nil { - unregistered = append(unregistered, "session.DetailSessionRoutePathHandler") - } - if o.InformationalDetailSpecHandler == nil { - unregistered = append(unregistered, "informational.DetailSpecHandler") - } - if o.InformationalDetailSpecBodyHandler == nil { - unregistered = append(unregistered, "informational.DetailSpecBodyHandler") - } - if o.TerminatorDetailTerminatorHandler == nil { - unregistered = append(unregistered, "terminator.DetailTerminatorHandler") - } - if o.RouterDetailTransitRouterHandler == nil { - unregistered = append(unregistered, "router.DetailTransitRouterHandler") - } - if o.IdentityDisableIdentityHandler == nil { - unregistered = append(unregistered, "identity.DisableIdentityHandler") - } - if o.IdentityDisassociateIdentitysServiceConfigsHandler == nil { - unregistered = append(unregistered, "identity.DisassociateIdentitysServiceConfigsHandler") - } - if o.IdentityEnableIdentityHandler == nil { - unregistered = append(unregistered, "identity.EnableIdentityHandler") - } - if o.CurrentIdentityEnrollMfaHandler == nil { - unregistered = append(unregistered, "current_identity.EnrollMfaHandler") - } - if o.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.ExtendCurrentIdentityAuthenticatorHandler") - } - if o.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.ExtendVerifyCurrentIdentityAuthenticatorHandler") - } - if o.DatabaseFixDataIntegrityHandler == nil { - unregistered = append(unregistered, "database.FixDataIntegrityHandler") - } - if o.CertificateAuthorityGetCaJWTHandler == nil { - unregistered = append(unregistered, "certificate_authority.GetCaJWTHandler") - } - if o.CurrentAPISessionGetCurrentAPISessionHandler == nil { - unregistered = append(unregistered, "current_api_session.GetCurrentAPISessionHandler") - } - if o.CurrentIdentityGetCurrentIdentityHandler == nil { - unregistered = append(unregistered, "current_identity.GetCurrentIdentityHandler") - } - if o.IdentityGetIdentityAuthenticatorsHandler == nil { - unregistered = append(unregistered, "identity.GetIdentityAuthenticatorsHandler") - } - if o.IdentityGetIdentityEnrollmentsHandler == nil { - unregistered = append(unregistered, "identity.GetIdentityEnrollmentsHandler") - } - if o.IdentityGetIdentityFailedServiceRequestsHandler == nil { - unregistered = append(unregistered, "identity.GetIdentityFailedServiceRequestsHandler") - } - if o.IdentityGetIdentityPolicyAdviceHandler == nil { - unregistered = append(unregistered, "identity.GetIdentityPolicyAdviceHandler") - } - if o.IdentityGetIdentityPostureDataHandler == nil { - unregistered = append(unregistered, "identity.GetIdentityPostureDataHandler") - } - if o.APISessionListAPISessionsHandler == nil { - unregistered = append(unregistered, "api_session.ListAPISessionsHandler") - } - if o.AuthPolicyListAuthPoliciesHandler == nil { - unregistered = append(unregistered, "auth_policy.ListAuthPoliciesHandler") - } - if o.AuthenticatorListAuthenticatorsHandler == nil { - unregistered = append(unregistered, "authenticator.ListAuthenticatorsHandler") - } - if o.CertificateAuthorityListCasHandler == nil { - unregistered = append(unregistered, "certificate_authority.ListCasHandler") - } - if o.ConfigListConfigTypesHandler == nil { - unregistered = append(unregistered, "config.ListConfigTypesHandler") - } - if o.ConfigListConfigsHandler == nil { - unregistered = append(unregistered, "config.ListConfigsHandler") - } - if o.ConfigListConfigsForConfigTypeHandler == nil { - unregistered = append(unregistered, "config.ListConfigsForConfigTypeHandler") - } - if o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler == nil { - unregistered = append(unregistered, "current_api_session.ListCurrentIdentityAuthenticatorsHandler") - } - if o.EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler == nil { - unregistered = append(unregistered, "edge_router.ListEdgeRouterEdgeRouterPoliciesHandler") - } - if o.EdgeRouterListEdgeRouterIdentitiesHandler == nil { - unregistered = append(unregistered, "edge_router.ListEdgeRouterIdentitiesHandler") - } - if o.EdgeRouterPolicyListEdgeRouterPoliciesHandler == nil { - unregistered = append(unregistered, "edge_router_policy.ListEdgeRouterPoliciesHandler") - } - if o.EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler == nil { - unregistered = append(unregistered, "edge_router_policy.ListEdgeRouterPolicyEdgeRoutersHandler") - } - if o.EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler == nil { - unregistered = append(unregistered, "edge_router_policy.ListEdgeRouterPolicyIdentitiesHandler") - } - if o.RoleAttributesListEdgeRouterRoleAttributesHandler == nil { - unregistered = append(unregistered, "role_attributes.ListEdgeRouterRoleAttributesHandler") - } - if o.EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler == nil { - unregistered = append(unregistered, "edge_router.ListEdgeRouterServiceEdgeRouterPoliciesHandler") - } - if o.EdgeRouterListEdgeRouterServicesHandler == nil { - unregistered = append(unregistered, "edge_router.ListEdgeRouterServicesHandler") - } - if o.EdgeRouterListEdgeRoutersHandler == nil { - unregistered = append(unregistered, "edge_router.ListEdgeRoutersHandler") - } - if o.EnrollmentListEnrollmentsHandler == nil { - unregistered = append(unregistered, "enrollment.ListEnrollmentsHandler") - } - if o.ExternalJWTSignerListExternalJWTSignersHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.ListExternalJWTSignersHandler") - } - if o.IdentityListIdentitiesHandler == nil { - unregistered = append(unregistered, "identity.ListIdentitiesHandler") - } - if o.IdentityListIdentityEdgeRoutersHandler == nil { - unregistered = append(unregistered, "identity.ListIdentityEdgeRoutersHandler") - } - if o.RoleAttributesListIdentityRoleAttributesHandler == nil { - unregistered = append(unregistered, "role_attributes.ListIdentityRoleAttributesHandler") - } - if o.IdentityListIdentityServicePoliciesHandler == nil { - unregistered = append(unregistered, "identity.ListIdentityServicePoliciesHandler") - } - if o.IdentityListIdentityServicesHandler == nil { - unregistered = append(unregistered, "identity.ListIdentityServicesHandler") - } - if o.IdentityListIdentityTypesHandler == nil { - unregistered = append(unregistered, "identity.ListIdentityTypesHandler") - } - if o.IdentityListIdentitysEdgeRouterPoliciesHandler == nil { - unregistered = append(unregistered, "identity.ListIdentitysEdgeRouterPoliciesHandler") - } - if o.IdentityListIdentitysServiceConfigsHandler == nil { - unregistered = append(unregistered, "identity.ListIdentitysServiceConfigsHandler") - } - if o.PostureChecksListPostureCheckTypesHandler == nil { - unregistered = append(unregistered, "posture_checks.ListPostureCheckTypesHandler") - } - if o.PostureChecksListPostureChecksHandler == nil { - unregistered = append(unregistered, "posture_checks.ListPostureChecksHandler") - } - if o.InformationalListRootHandler == nil { - unregistered = append(unregistered, "informational.ListRootHandler") - } - if o.RouterListRoutersHandler == nil { - unregistered = append(unregistered, "router.ListRoutersHandler") - } - if o.ServiceListServiceConfigHandler == nil { - unregistered = append(unregistered, "service.ListServiceConfigHandler") - } - if o.ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.ListServiceEdgeRouterPoliciesHandler") - } - if o.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.ListServiceEdgeRouterPolicyEdgeRoutersHandler") - } - if o.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.ListServiceEdgeRouterPolicyServicesHandler") - } - if o.ServiceListServiceEdgeRoutersHandler == nil { - unregistered = append(unregistered, "service.ListServiceEdgeRoutersHandler") - } - if o.ServiceListServiceIdentitiesHandler == nil { - unregistered = append(unregistered, "service.ListServiceIdentitiesHandler") - } - if o.ServicePolicyListServicePoliciesHandler == nil { - unregistered = append(unregistered, "service_policy.ListServicePoliciesHandler") - } - if o.ServicePolicyListServicePolicyIdentitiesHandler == nil { - unregistered = append(unregistered, "service_policy.ListServicePolicyIdentitiesHandler") - } - if o.ServicePolicyListServicePolicyPostureChecksHandler == nil { - unregistered = append(unregistered, "service_policy.ListServicePolicyPostureChecksHandler") - } - if o.ServicePolicyListServicePolicyServicesHandler == nil { - unregistered = append(unregistered, "service_policy.ListServicePolicyServicesHandler") - } - if o.RoleAttributesListServiceRoleAttributesHandler == nil { - unregistered = append(unregistered, "role_attributes.ListServiceRoleAttributesHandler") - } - if o.ServiceListServiceServiceEdgeRouterPoliciesHandler == nil { - unregistered = append(unregistered, "service.ListServiceServiceEdgeRouterPoliciesHandler") - } - if o.ServiceListServiceServicePoliciesHandler == nil { - unregistered = append(unregistered, "service.ListServiceServicePoliciesHandler") - } - if o.ServiceListServiceTerminatorsHandler == nil { - unregistered = append(unregistered, "service.ListServiceTerminatorsHandler") - } - if o.ServiceListServicesHandler == nil { - unregistered = append(unregistered, "service.ListServicesHandler") - } - if o.SessionListSessionsHandler == nil { - unregistered = append(unregistered, "session.ListSessionsHandler") - } - if o.InformationalListSpecsHandler == nil { - unregistered = append(unregistered, "informational.ListSpecsHandler") - } - if o.InformationalListSummaryHandler == nil { - unregistered = append(unregistered, "informational.ListSummaryHandler") - } - if o.TerminatorListTerminatorsHandler == nil { - unregistered = append(unregistered, "terminator.ListTerminatorsHandler") - } - if o.RouterListTransitRoutersHandler == nil { - unregistered = append(unregistered, "router.ListTransitRoutersHandler") - } - if o.InformationalListVersionHandler == nil { - unregistered = append(unregistered, "informational.ListVersionHandler") - } - if o.AuthPolicyPatchAuthPolicyHandler == nil { - unregistered = append(unregistered, "auth_policy.PatchAuthPolicyHandler") - } - if o.AuthenticatorPatchAuthenticatorHandler == nil { - unregistered = append(unregistered, "authenticator.PatchAuthenticatorHandler") - } - if o.CertificateAuthorityPatchCaHandler == nil { - unregistered = append(unregistered, "certificate_authority.PatchCaHandler") - } - if o.ConfigPatchConfigHandler == nil { - unregistered = append(unregistered, "config.PatchConfigHandler") - } - if o.ConfigPatchConfigTypeHandler == nil { - unregistered = append(unregistered, "config.PatchConfigTypeHandler") - } - if o.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.PatchCurrentIdentityAuthenticatorHandler") - } - if o.EdgeRouterPatchEdgeRouterHandler == nil { - unregistered = append(unregistered, "edge_router.PatchEdgeRouterHandler") - } - if o.EdgeRouterPolicyPatchEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "edge_router_policy.PatchEdgeRouterPolicyHandler") - } - if o.ExternalJWTSignerPatchExternalJWTSignerHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.PatchExternalJWTSignerHandler") - } - if o.IdentityPatchIdentityHandler == nil { - unregistered = append(unregistered, "identity.PatchIdentityHandler") - } - if o.PostureChecksPatchPostureCheckHandler == nil { - unregistered = append(unregistered, "posture_checks.PatchPostureCheckHandler") - } - if o.RouterPatchRouterHandler == nil { - unregistered = append(unregistered, "router.PatchRouterHandler") - } - if o.ServicePatchServiceHandler == nil { - unregistered = append(unregistered, "service.PatchServiceHandler") - } - if o.ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.PatchServiceEdgeRouterPolicyHandler") - } - if o.ServicePolicyPatchServicePolicyHandler == nil { - unregistered = append(unregistered, "service_policy.PatchServicePolicyHandler") - } - if o.TerminatorPatchTerminatorHandler == nil { - unregistered = append(unregistered, "terminator.PatchTerminatorHandler") - } - if o.RouterPatchTransitRouterHandler == nil { - unregistered = append(unregistered, "router.PatchTransitRouterHandler") - } - if o.AuthenticatorReEnrollAuthenticatorHandler == nil { - unregistered = append(unregistered, "authenticator.ReEnrollAuthenticatorHandler") - } - if o.EdgeRouterReEnrollEdgeRouterHandler == nil { - unregistered = append(unregistered, "edge_router.ReEnrollEdgeRouterHandler") - } - if o.EnrollmentRefreshEnrollmentHandler == nil { - unregistered = append(unregistered, "enrollment.RefreshEnrollmentHandler") - } - if o.IdentityRemoveIdentityMfaHandler == nil { - unregistered = append(unregistered, "identity.RemoveIdentityMfaHandler") - } - if o.AuthPolicyUpdateAuthPolicyHandler == nil { - unregistered = append(unregistered, "auth_policy.UpdateAuthPolicyHandler") - } - if o.AuthenticatorUpdateAuthenticatorHandler == nil { - unregistered = append(unregistered, "authenticator.UpdateAuthenticatorHandler") - } - if o.CertificateAuthorityUpdateCaHandler == nil { - unregistered = append(unregistered, "certificate_authority.UpdateCaHandler") - } - if o.ConfigUpdateConfigHandler == nil { - unregistered = append(unregistered, "config.UpdateConfigHandler") - } - if o.ConfigUpdateConfigTypeHandler == nil { - unregistered = append(unregistered, "config.UpdateConfigTypeHandler") - } - if o.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler == nil { - unregistered = append(unregistered, "current_api_session.UpdateCurrentIdentityAuthenticatorHandler") - } - if o.EdgeRouterUpdateEdgeRouterHandler == nil { - unregistered = append(unregistered, "edge_router.UpdateEdgeRouterHandler") - } - if o.EdgeRouterPolicyUpdateEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "edge_router_policy.UpdateEdgeRouterPolicyHandler") - } - if o.ExternalJWTSignerUpdateExternalJWTSignerHandler == nil { - unregistered = append(unregistered, "external_jwt_signer.UpdateExternalJWTSignerHandler") - } - if o.IdentityUpdateIdentityHandler == nil { - unregistered = append(unregistered, "identity.UpdateIdentityHandler") - } - if o.IdentityUpdateIdentityTracingHandler == nil { - unregistered = append(unregistered, "identity.UpdateIdentityTracingHandler") - } - if o.PostureChecksUpdatePostureCheckHandler == nil { - unregistered = append(unregistered, "posture_checks.UpdatePostureCheckHandler") - } - if o.RouterUpdateRouterHandler == nil { - unregistered = append(unregistered, "router.UpdateRouterHandler") - } - if o.ServiceUpdateServiceHandler == nil { - unregistered = append(unregistered, "service.UpdateServiceHandler") - } - if o.ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler == nil { - unregistered = append(unregistered, "service_edge_router_policy.UpdateServiceEdgeRouterPolicyHandler") - } - if o.ServicePolicyUpdateServicePolicyHandler == nil { - unregistered = append(unregistered, "service_policy.UpdateServicePolicyHandler") - } - if o.TerminatorUpdateTerminatorHandler == nil { - unregistered = append(unregistered, "terminator.UpdateTerminatorHandler") - } - if o.RouterUpdateTransitRouterHandler == nil { - unregistered = append(unregistered, "router.UpdateTransitRouterHandler") - } - if o.CertificateAuthorityVerifyCaHandler == nil { - unregistered = append(unregistered, "certificate_authority.VerifyCaHandler") - } - if o.CurrentIdentityVerifyMfaHandler == nil { - unregistered = append(unregistered, "current_identity.VerifyMfaHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *ZitiEdgeManagementAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *ZitiEdgeManagementAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - result := make(map[string]runtime.Authenticator) - for name := range schemes { - switch name { - case "ztSession": - scheme := schemes[name] - result[name] = o.APIKeyAuthenticator(scheme.Name, scheme.In, o.ZtSessionAuth) - - } - } - return result -} - -// Authorizer returns the registered authorizer -func (o *ZitiEdgeManagementAPI) Authorizer() runtime.Authorizer { - return o.APIAuthorizer -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *ZitiEdgeManagementAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - case "text/plain": - result["text/plain"] = o.TxtConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *ZitiEdgeManagementAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/jwt": - result["application/jwt"] = o.ApplicationJWTProducer - case "image/png": - result["image/png"] = o.BinProducer - case "application/json": - result["application/json"] = o.JSONProducer - case "text/yaml": - result["text/yaml"] = o.TextYamlProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *ZitiEdgeManagementAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the ziti edge management API -func (o *ZitiEdgeManagementAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *ZitiEdgeManagementAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/current-api-session"] = current_api_session.NewDeleteCurrentAPISession(o.context, o.CurrentAPISessionDeleteCurrentAPISessionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/identities/{id}/service-configs"] = identity.NewAssociateIdentitysServiceConfigs(o.context, o.IdentityAssociateIdentitysServiceConfigsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/authenticate"] = authentication.NewAuthenticate(o.context, o.AuthenticationAuthenticateHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/authenticate/mfa"] = authentication.NewAuthenticateMfa(o.context, o.AuthenticationAuthenticateMfaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/database/check-data-integrity"] = database.NewCheckDataIntegrity(o.context, o.DatabaseCheckDataIntegrityHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/auth-policies"] = auth_policy.NewCreateAuthPolicy(o.context, o.AuthPolicyCreateAuthPolicyHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/authenticators"] = authenticator.NewCreateAuthenticator(o.context, o.AuthenticatorCreateAuthenticatorHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/cas"] = certificate_authority.NewCreateCa(o.context, o.CertificateAuthorityCreateCaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/configs"] = config.NewCreateConfig(o.context, o.ConfigCreateConfigHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/config-types"] = config.NewCreateConfigType(o.context, o.ConfigCreateConfigTypeHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/database/snapshot"] = database.NewCreateDatabaseSnapshot(o.context, o.DatabaseCreateDatabaseSnapshotHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/edge-routers"] = edge_router.NewCreateEdgeRouter(o.context, o.EdgeRouterCreateEdgeRouterHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/edge-router-policies"] = edge_router_policy.NewCreateEdgeRouterPolicy(o.context, o.EdgeRouterPolicyCreateEdgeRouterPolicyHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enrollments"] = enrollment.NewCreateEnrollment(o.context, o.EnrollmentCreateEnrollmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/external-jwt-signers"] = external_jwt_signer.NewCreateExternalJWTSigner(o.context, o.ExternalJWTSignerCreateExternalJWTSignerHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/identities"] = identity.NewCreateIdentity(o.context, o.IdentityCreateIdentityHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/mfa/recovery-codes"] = current_identity.NewCreateMfaRecoveryCodes(o.context, o.CurrentIdentityCreateMfaRecoveryCodesHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/posture-checks"] = posture_checks.NewCreatePostureCheck(o.context, o.PostureChecksCreatePostureCheckHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/routers"] = router.NewCreateRouter(o.context, o.RouterCreateRouterHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/services"] = service.NewCreateService(o.context, o.ServiceCreateServiceHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/service-edge-router-policies"] = service_edge_router_policy.NewCreateServiceEdgeRouterPolicy(o.context, o.ServiceEdgeRouterPolicyCreateServiceEdgeRouterPolicyHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/service-policies"] = service_policy.NewCreateServicePolicy(o.context, o.ServicePolicyCreateServicePolicyHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/terminators"] = terminator.NewCreateTerminator(o.context, o.TerminatorCreateTerminatorHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/transit-routers"] = router.NewCreateTransitRouter(o.context, o.RouterCreateTransitRouterHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/database/data-integrity-results"] = database.NewDataIntegrityResults(o.context, o.DatabaseDataIntegrityResultsHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/api-sessions/{id}"] = api_session.NewDeleteAPISessions(o.context, o.APISessionDeleteAPISessionsHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/auth-policies/{id}"] = auth_policy.NewDeleteAuthPolicy(o.context, o.AuthPolicyDeleteAuthPolicyHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/authenticators/{id}"] = authenticator.NewDeleteAuthenticator(o.context, o.AuthenticatorDeleteAuthenticatorHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/cas/{id}"] = certificate_authority.NewDeleteCa(o.context, o.CertificateAuthorityDeleteCaHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/configs/{id}"] = config.NewDeleteConfig(o.context, o.ConfigDeleteConfigHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/config-types/{id}"] = config.NewDeleteConfigType(o.context, o.ConfigDeleteConfigTypeHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/edge-routers/{id}"] = edge_router.NewDeleteEdgeRouter(o.context, o.EdgeRouterDeleteEdgeRouterHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/edge-router-policies/{id}"] = edge_router_policy.NewDeleteEdgeRouterPolicy(o.context, o.EdgeRouterPolicyDeleteEdgeRouterPolicyHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/enrollments/{id}"] = enrollment.NewDeleteEnrollment(o.context, o.EnrollmentDeleteEnrollmentHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/external-jwt-signers/{id}"] = external_jwt_signer.NewDeleteExternalJWTSigner(o.context, o.ExternalJWTSignerDeleteExternalJWTSignerHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/identities/{id}"] = identity.NewDeleteIdentity(o.context, o.IdentityDeleteIdentityHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/current-identity/mfa"] = current_identity.NewDeleteMfa(o.context, o.CurrentIdentityDeleteMfaHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/posture-checks/{id}"] = posture_checks.NewDeletePostureCheck(o.context, o.PostureChecksDeletePostureCheckHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/routers/{id}"] = router.NewDeleteRouter(o.context, o.RouterDeleteRouterHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/services/{id}"] = service.NewDeleteService(o.context, o.ServiceDeleteServiceHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/service-edge-router-policies/{id}"] = service_edge_router_policy.NewDeleteServiceEdgeRouterPolicy(o.context, o.ServiceEdgeRouterPolicyDeleteServiceEdgeRouterPolicyHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/service-policies/{id}"] = service_policy.NewDeleteServicePolicy(o.context, o.ServicePolicyDeleteServicePolicyHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/sessions/{id}"] = session.NewDeleteSession(o.context, o.SessionDeleteSessionHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/terminators/{id}"] = terminator.NewDeleteTerminator(o.context, o.TerminatorDeleteTerminatorHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/transit-routers/{id}"] = router.NewDeleteTransitRouter(o.context, o.RouterDeleteTransitRouterHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/api-sessions/{id}"] = api_session.NewDetailAPISessions(o.context, o.APISessionDetailAPISessionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/auth-policies/{id}"] = auth_policy.NewDetailAuthPolicy(o.context, o.AuthPolicyDetailAuthPolicyHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/authenticators/{id}"] = authenticator.NewDetailAuthenticator(o.context, o.AuthenticatorDetailAuthenticatorHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/cas/{id}"] = certificate_authority.NewDetailCa(o.context, o.CertificateAuthorityDetailCaHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/configs/{id}"] = config.NewDetailConfig(o.context, o.ConfigDetailConfigHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/config-types/{id}"] = config.NewDetailConfigType(o.context, o.ConfigDetailConfigTypeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/authenticators/{id}"] = current_api_session.NewDetailCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionDetailCurrentIdentityAuthenticatorHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-routers/{id}"] = edge_router.NewDetailEdgeRouter(o.context, o.EdgeRouterDetailEdgeRouterHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-router-policies/{id}"] = edge_router_policy.NewDetailEdgeRouterPolicy(o.context, o.EdgeRouterPolicyDetailEdgeRouterPolicyHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/enrollments/{id}"] = enrollment.NewDetailEnrollment(o.context, o.EnrollmentDetailEnrollmentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/external-jwt-signers/{id}"] = external_jwt_signer.NewDetailExternalJWTSigner(o.context, o.ExternalJWTSignerDetailExternalJWTSignerHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}"] = identity.NewDetailIdentity(o.context, o.IdentityDetailIdentityHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identity-types/{id}"] = identity.NewDetailIdentityType(o.context, o.IdentityDetailIdentityTypeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/mfa"] = current_identity.NewDetailMfa(o.context, o.CurrentIdentityDetailMfaHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/mfa/qr-code"] = current_identity.NewDetailMfaQrCode(o.context, o.CurrentIdentityDetailMfaQrCodeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/mfa/recovery-codes"] = current_identity.NewDetailMfaRecoveryCodes(o.context, o.CurrentIdentityDetailMfaRecoveryCodesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/posture-checks/{id}"] = posture_checks.NewDetailPostureCheck(o.context, o.PostureChecksDetailPostureCheckHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/posture-check-types/{id}"] = posture_checks.NewDetailPostureCheckType(o.context, o.PostureChecksDetailPostureCheckTypeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/routers/{id}"] = router.NewDetailRouter(o.context, o.RouterDetailRouterHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}"] = service.NewDetailService(o.context, o.ServiceDetailServiceHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-edge-router-policies/{id}"] = service_edge_router_policy.NewDetailServiceEdgeRouterPolicy(o.context, o.ServiceEdgeRouterPolicyDetailServiceEdgeRouterPolicyHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-policies/{id}"] = service_policy.NewDetailServicePolicy(o.context, o.ServicePolicyDetailServicePolicyHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/sessions/{id}"] = session.NewDetailSession(o.context, o.SessionDetailSessionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/sessions/{id}/route-path"] = session.NewDetailSessionRoutePath(o.context, o.SessionDetailSessionRoutePathHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/specs/{id}"] = informational.NewDetailSpec(o.context, o.InformationalDetailSpecHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/specs/{id}/spec"] = informational.NewDetailSpecBody(o.context, o.InformationalDetailSpecBodyHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/terminators/{id}"] = terminator.NewDetailTerminator(o.context, o.TerminatorDetailTerminatorHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/transit-routers/{id}"] = router.NewDetailTransitRouter(o.context, o.RouterDetailTransitRouterHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/identities/{id}/disable"] = identity.NewDisableIdentity(o.context, o.IdentityDisableIdentityHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/identities/{id}/service-configs"] = identity.NewDisassociateIdentitysServiceConfigs(o.context, o.IdentityDisassociateIdentitysServiceConfigsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/identities/{id}/enable"] = identity.NewEnableIdentity(o.context, o.IdentityEnableIdentityHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/mfa"] = current_identity.NewEnrollMfa(o.context, o.CurrentIdentityEnrollMfaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/authenticators/{id}/extend"] = current_api_session.NewExtendCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionExtendCurrentIdentityAuthenticatorHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/authenticators/{id}/extend-verify"] = current_api_session.NewExtendVerifyCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionExtendVerifyCurrentIdentityAuthenticatorHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/database/fix-data-integrity"] = database.NewFixDataIntegrity(o.context, o.DatabaseFixDataIntegrityHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/cas/{id}/jwt"] = certificate_authority.NewGetCaJWT(o.context, o.CertificateAuthorityGetCaJWTHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-api-session"] = current_api_session.NewGetCurrentAPISession(o.context, o.CurrentAPISessionGetCurrentAPISessionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity"] = current_identity.NewGetCurrentIdentity(o.context, o.CurrentIdentityGetCurrentIdentityHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/authenticators"] = identity.NewGetIdentityAuthenticators(o.context, o.IdentityGetIdentityAuthenticatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/enrollments"] = identity.NewGetIdentityEnrollments(o.context, o.IdentityGetIdentityEnrollmentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/failed-service-requests"] = identity.NewGetIdentityFailedServiceRequests(o.context, o.IdentityGetIdentityFailedServiceRequestsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/policy-advice/{serviceId}"] = identity.NewGetIdentityPolicyAdvice(o.context, o.IdentityGetIdentityPolicyAdviceHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/posture-data"] = identity.NewGetIdentityPostureData(o.context, o.IdentityGetIdentityPostureDataHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/api-sessions"] = api_session.NewListAPISessions(o.context, o.APISessionListAPISessionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/auth-policies"] = auth_policy.NewListAuthPolicies(o.context, o.AuthPolicyListAuthPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/authenticators"] = authenticator.NewListAuthenticators(o.context, o.AuthenticatorListAuthenticatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/cas"] = certificate_authority.NewListCas(o.context, o.CertificateAuthorityListCasHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/config-types"] = config.NewListConfigTypes(o.context, o.ConfigListConfigTypesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/configs"] = config.NewListConfigs(o.context, o.ConfigListConfigsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/config-types/{id}/configs"] = config.NewListConfigsForConfigType(o.context, o.ConfigListConfigsForConfigTypeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/current-identity/authenticators"] = current_api_session.NewListCurrentIdentityAuthenticators(o.context, o.CurrentAPISessionListCurrentIdentityAuthenticatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-routers/{id}/edge-router-policies"] = edge_router.NewListEdgeRouterEdgeRouterPolicies(o.context, o.EdgeRouterListEdgeRouterEdgeRouterPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-routers/{id}/identities"] = edge_router.NewListEdgeRouterIdentities(o.context, o.EdgeRouterListEdgeRouterIdentitiesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-router-policies"] = edge_router_policy.NewListEdgeRouterPolicies(o.context, o.EdgeRouterPolicyListEdgeRouterPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-router-policies/{id}/edge-routers"] = edge_router_policy.NewListEdgeRouterPolicyEdgeRouters(o.context, o.EdgeRouterPolicyListEdgeRouterPolicyEdgeRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-router-policies/{id}/identities"] = edge_router_policy.NewListEdgeRouterPolicyIdentities(o.context, o.EdgeRouterPolicyListEdgeRouterPolicyIdentitiesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-router-role-attributes"] = role_attributes.NewListEdgeRouterRoleAttributes(o.context, o.RoleAttributesListEdgeRouterRoleAttributesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-routers/{id}/service-edge-router-policies"] = edge_router.NewListEdgeRouterServiceEdgeRouterPolicies(o.context, o.EdgeRouterListEdgeRouterServiceEdgeRouterPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-routers/{id}/services"] = edge_router.NewListEdgeRouterServices(o.context, o.EdgeRouterListEdgeRouterServicesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/edge-routers"] = edge_router.NewListEdgeRouters(o.context, o.EdgeRouterListEdgeRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/enrollments"] = enrollment.NewListEnrollments(o.context, o.EnrollmentListEnrollmentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/external-jwt-signers"] = external_jwt_signer.NewListExternalJWTSigners(o.context, o.ExternalJWTSignerListExternalJWTSignersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities"] = identity.NewListIdentities(o.context, o.IdentityListIdentitiesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/edge-routers"] = identity.NewListIdentityEdgeRouters(o.context, o.IdentityListIdentityEdgeRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identity-role-attributes"] = role_attributes.NewListIdentityRoleAttributes(o.context, o.RoleAttributesListIdentityRoleAttributesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/service-policies"] = identity.NewListIdentityServicePolicies(o.context, o.IdentityListIdentityServicePoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/services"] = identity.NewListIdentityServices(o.context, o.IdentityListIdentityServicesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identity-types"] = identity.NewListIdentityTypes(o.context, o.IdentityListIdentityTypesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/edge-router-policies"] = identity.NewListIdentitysEdgeRouterPolicies(o.context, o.IdentityListIdentitysEdgeRouterPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/identities/{id}/service-configs"] = identity.NewListIdentitysServiceConfigs(o.context, o.IdentityListIdentitysServiceConfigsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/posture-check-types"] = posture_checks.NewListPostureCheckTypes(o.context, o.PostureChecksListPostureCheckTypesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/posture-checks"] = posture_checks.NewListPostureChecks(o.context, o.PostureChecksListPostureChecksHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"][""] = informational.NewListRoot(o.context, o.InformationalListRootHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/routers"] = router.NewListRouters(o.context, o.RouterListRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/configs"] = service.NewListServiceConfig(o.context, o.ServiceListServiceConfigHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-edge-router-policies"] = service_edge_router_policy.NewListServiceEdgeRouterPolicies(o.context, o.ServiceEdgeRouterPolicyListServiceEdgeRouterPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-edge-router-policies/{id}/edge-routers"] = service_edge_router_policy.NewListServiceEdgeRouterPolicyEdgeRouters(o.context, o.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyEdgeRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-edge-router-policies/{id}/services"] = service_edge_router_policy.NewListServiceEdgeRouterPolicyServices(o.context, o.ServiceEdgeRouterPolicyListServiceEdgeRouterPolicyServicesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/edge-routers"] = service.NewListServiceEdgeRouters(o.context, o.ServiceListServiceEdgeRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/identities"] = service.NewListServiceIdentities(o.context, o.ServiceListServiceIdentitiesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-policies"] = service_policy.NewListServicePolicies(o.context, o.ServicePolicyListServicePoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-policies/{id}/identities"] = service_policy.NewListServicePolicyIdentities(o.context, o.ServicePolicyListServicePolicyIdentitiesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-policies/{id}/posture-checks"] = service_policy.NewListServicePolicyPostureChecks(o.context, o.ServicePolicyListServicePolicyPostureChecksHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-policies/{id}/services"] = service_policy.NewListServicePolicyServices(o.context, o.ServicePolicyListServicePolicyServicesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service-role-attributes"] = role_attributes.NewListServiceRoleAttributes(o.context, o.RoleAttributesListServiceRoleAttributesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/service-edge-router-policies"] = service.NewListServiceServiceEdgeRouterPolicies(o.context, o.ServiceListServiceServiceEdgeRouterPoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/service-policies"] = service.NewListServiceServicePolicies(o.context, o.ServiceListServiceServicePoliciesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services/{id}/terminators"] = service.NewListServiceTerminators(o.context, o.ServiceListServiceTerminatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/services"] = service.NewListServices(o.context, o.ServiceListServicesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/sessions"] = session.NewListSessions(o.context, o.SessionListSessionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/specs"] = informational.NewListSpecs(o.context, o.InformationalListSpecsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/summary"] = informational.NewListSummary(o.context, o.InformationalListSummaryHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/terminators"] = terminator.NewListTerminators(o.context, o.TerminatorListTerminatorsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/transit-routers"] = router.NewListTransitRouters(o.context, o.RouterListTransitRoutersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/version"] = informational.NewListVersion(o.context, o.InformationalListVersionHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/auth-policies/{id}"] = auth_policy.NewPatchAuthPolicy(o.context, o.AuthPolicyPatchAuthPolicyHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/authenticators/{id}"] = authenticator.NewPatchAuthenticator(o.context, o.AuthenticatorPatchAuthenticatorHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/cas/{id}"] = certificate_authority.NewPatchCa(o.context, o.CertificateAuthorityPatchCaHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/configs/{id}"] = config.NewPatchConfig(o.context, o.ConfigPatchConfigHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/config-types/{id}"] = config.NewPatchConfigType(o.context, o.ConfigPatchConfigTypeHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/current-identity/authenticators/{id}"] = current_api_session.NewPatchCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionPatchCurrentIdentityAuthenticatorHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/edge-routers/{id}"] = edge_router.NewPatchEdgeRouter(o.context, o.EdgeRouterPatchEdgeRouterHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/edge-router-policies/{id}"] = edge_router_policy.NewPatchEdgeRouterPolicy(o.context, o.EdgeRouterPolicyPatchEdgeRouterPolicyHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/external-jwt-signers/{id}"] = external_jwt_signer.NewPatchExternalJWTSigner(o.context, o.ExternalJWTSignerPatchExternalJWTSignerHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/identities/{id}"] = identity.NewPatchIdentity(o.context, o.IdentityPatchIdentityHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/posture-checks/{id}"] = posture_checks.NewPatchPostureCheck(o.context, o.PostureChecksPatchPostureCheckHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/routers/{id}"] = router.NewPatchRouter(o.context, o.RouterPatchRouterHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/services/{id}"] = service.NewPatchService(o.context, o.ServicePatchServiceHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/service-edge-router-policies/{id}"] = service_edge_router_policy.NewPatchServiceEdgeRouterPolicy(o.context, o.ServiceEdgeRouterPolicyPatchServiceEdgeRouterPolicyHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/service-policies/{id}"] = service_policy.NewPatchServicePolicy(o.context, o.ServicePolicyPatchServicePolicyHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/terminators/{id}"] = terminator.NewPatchTerminator(o.context, o.TerminatorPatchTerminatorHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/transit-routers/{id}"] = router.NewPatchTransitRouter(o.context, o.RouterPatchTransitRouterHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/authenticators/{id}/re-enroll"] = authenticator.NewReEnrollAuthenticator(o.context, o.AuthenticatorReEnrollAuthenticatorHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/edge-routers/{id}/re-enroll"] = edge_router.NewReEnrollEdgeRouter(o.context, o.EdgeRouterReEnrollEdgeRouterHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/enrollments/{id}/refresh"] = enrollment.NewRefreshEnrollment(o.context, o.EnrollmentRefreshEnrollmentHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/identities/{id}/mfa"] = identity.NewRemoveIdentityMfa(o.context, o.IdentityRemoveIdentityMfaHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/auth-policies/{id}"] = auth_policy.NewUpdateAuthPolicy(o.context, o.AuthPolicyUpdateAuthPolicyHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/authenticators/{id}"] = authenticator.NewUpdateAuthenticator(o.context, o.AuthenticatorUpdateAuthenticatorHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/cas/{id}"] = certificate_authority.NewUpdateCa(o.context, o.CertificateAuthorityUpdateCaHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/configs/{id}"] = config.NewUpdateConfig(o.context, o.ConfigUpdateConfigHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/config-types/{id}"] = config.NewUpdateConfigType(o.context, o.ConfigUpdateConfigTypeHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/current-identity/authenticators/{id}"] = current_api_session.NewUpdateCurrentIdentityAuthenticator(o.context, o.CurrentAPISessionUpdateCurrentIdentityAuthenticatorHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/edge-routers/{id}"] = edge_router.NewUpdateEdgeRouter(o.context, o.EdgeRouterUpdateEdgeRouterHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/edge-router-policies/{id}"] = edge_router_policy.NewUpdateEdgeRouterPolicy(o.context, o.EdgeRouterPolicyUpdateEdgeRouterPolicyHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/external-jwt-signers/{id}"] = external_jwt_signer.NewUpdateExternalJWTSigner(o.context, o.ExternalJWTSignerUpdateExternalJWTSignerHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/identities/{id}"] = identity.NewUpdateIdentity(o.context, o.IdentityUpdateIdentityHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/identities/{id}/trace"] = identity.NewUpdateIdentityTracing(o.context, o.IdentityUpdateIdentityTracingHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/posture-checks/{id}"] = posture_checks.NewUpdatePostureCheck(o.context, o.PostureChecksUpdatePostureCheckHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/routers/{id}"] = router.NewUpdateRouter(o.context, o.RouterUpdateRouterHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/services/{id}"] = service.NewUpdateService(o.context, o.ServiceUpdateServiceHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/service-edge-router-policies/{id}"] = service_edge_router_policy.NewUpdateServiceEdgeRouterPolicy(o.context, o.ServiceEdgeRouterPolicyUpdateServiceEdgeRouterPolicyHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/service-policies/{id}"] = service_policy.NewUpdateServicePolicy(o.context, o.ServicePolicyUpdateServicePolicyHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/terminators/{id}"] = terminator.NewUpdateTerminator(o.context, o.TerminatorUpdateTerminatorHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/transit-routers/{id}"] = router.NewUpdateTransitRouter(o.context, o.RouterUpdateTransitRouterHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/cas/{id}/verify"] = certificate_authority.NewVerifyCa(o.context, o.CertificateAuthorityVerifyCaHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/current-identity/mfa/verify"] = current_identity.NewVerifyMfa(o.context, o.CurrentIdentityVerifyMfaHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *ZitiEdgeManagementAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *ZitiEdgeManagementAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *ZitiEdgeManagementAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *ZitiEdgeManagementAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *ZitiEdgeManagementAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[method][path] = builder(h) - } -} diff --git a/rest_management_api_server/server.go b/rest_management_api_server/server.go deleted file mode 100644 index c3cba6728..000000000 --- a/rest_management_api_server/server.go +++ /dev/null @@ -1,532 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_management_api_server - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "io/ioutil" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/openziti/edge/rest_management_api_server/operations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTPS, - } -} - -// NewServer creates a new api ziti edge management server but does not configure it -func NewServer(api *operations.ZitiEdgeManagementAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the ziti edge management API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/ziti-edge-management.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *operations.ZitiEdgeManagementAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *operations.ZitiEdgeManagementAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving ziti edge management at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving ziti edge management at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving ziti edge management at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving ziti edge management at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := ioutil.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving ziti edge management at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving ziti edge management at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/rest_model/api_error.go b/rest_model/api_error.go deleted file mode 100644 index 8653c326f..000000000 --- a/rest_model/api_error.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// APIError api error -// -// swagger:model apiError -type APIError struct { - - // args - Args *APIErrorArgs `json:"args,omitempty"` - - // cause - Cause *APIErrorCause `json:"cause,omitempty"` - - // cause message - CauseMessage string `json:"causeMessage,omitempty"` - - // code - Code string `json:"code,omitempty"` - - // data - Data interface{} `json:"data,omitempty"` - - // message - Message string `json:"message,omitempty"` - - // request Id - RequestID string `json:"requestId,omitempty"` -} - -// Validate validates this api error -func (m *APIError) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArgs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCause(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIError) validateArgs(formats strfmt.Registry) error { - if swag.IsZero(m.Args) { // not required - return nil - } - - if m.Args != nil { - if err := m.Args.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("args") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("args") - } - return err - } - } - - return nil -} - -func (m *APIError) validateCause(formats strfmt.Registry) error { - if swag.IsZero(m.Cause) { // not required - return nil - } - - if m.Cause != nil { - if err := m.Cause.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cause") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cause") - } - return err - } - } - - return nil -} - -// ContextValidate validate this api error based on the context it is used -func (m *APIError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateArgs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCause(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIError) contextValidateArgs(ctx context.Context, formats strfmt.Registry) error { - - if m.Args != nil { - if err := m.Args.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("args") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("args") - } - return err - } - } - - return nil -} - -func (m *APIError) contextValidateCause(ctx context.Context, formats strfmt.Registry) error { - - if m.Cause != nil { - if err := m.Cause.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cause") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cause") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APIError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIError) UnmarshalBinary(b []byte) error { - var res APIError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_error_args.go b/rest_model/api_error_args.go deleted file mode 100644 index 4b61db6cc..000000000 --- a/rest_model/api_error_args.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// APIErrorArgs api error args -// -// swagger:model apiErrorArgs -type APIErrorArgs struct { - - // url vars - URLVars map[string]string `json:"urlVars,omitempty"` -} - -// Validate validates this api error args -func (m *APIErrorArgs) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this api error args based on context it is used -func (m *APIErrorArgs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *APIErrorArgs) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIErrorArgs) UnmarshalBinary(b []byte) error { - var res APIErrorArgs - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_error_cause.go b/rest_model/api_error_cause.go deleted file mode 100644 index a7891e2e2..000000000 --- a/rest_model/api_error_cause.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// APIErrorCause api error cause -// -// swagger:model apiErrorCause -type APIErrorCause struct { - APIFieldError - - APIError -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *APIErrorCause) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 APIFieldError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.APIFieldError = aO0 - - // AO1 - var aO1 APIError - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.APIError = aO1 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m APIErrorCause) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.APIFieldError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.APIError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this api error cause -func (m *APIErrorCause) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with APIFieldError - if err := m.APIFieldError.Validate(formats); err != nil { - res = append(res, err) - } - // validation for a type composition with APIError - if err := m.APIError.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this api error cause based on the context it is used -func (m *APIErrorCause) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with APIFieldError - if err := m.APIFieldError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - // validation for a type composition with APIError - if err := m.APIError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *APIErrorCause) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIErrorCause) UnmarshalBinary(b []byte) error { - var res APIErrorCause - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_error_envelope.go b/rest_model/api_error_envelope.go deleted file mode 100644 index 5223af154..000000000 --- a/rest_model/api_error_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// APIErrorEnvelope api error envelope -// -// swagger:model apiErrorEnvelope -type APIErrorEnvelope struct { - - // error - // Required: true - Error *APIError `json:"error"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this api error envelope -func (m *APIErrorEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateError(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIErrorEnvelope) validateError(formats strfmt.Registry) error { - - if err := validate.Required("error", "body", m.Error); err != nil { - return err - } - - if m.Error != nil { - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *APIErrorEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this api error envelope based on the context it is used -func (m *APIErrorEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateError(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIErrorEnvelope) contextValidateError(ctx context.Context, formats strfmt.Registry) error { - - if m.Error != nil { - if err := m.Error.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *APIErrorEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APIErrorEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIErrorEnvelope) UnmarshalBinary(b []byte) error { - var res APIErrorEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_field_error.go b/rest_model/api_field_error.go deleted file mode 100644 index b7f5a1051..000000000 --- a/rest_model/api_field_error.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// APIFieldError api field error -// -// swagger:model apiFieldError -type APIFieldError struct { - - // field - Field string `json:"field,omitempty"` - - // reason - Reason string `json:"reason,omitempty"` - - // can be any value - string, number, boolean, array or object - Value interface{} `json:"value,omitempty"` -} - -// Validate validates this api field error -func (m *APIFieldError) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this api field error based on context it is used -func (m *APIFieldError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *APIFieldError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIFieldError) UnmarshalBinary(b []byte) error { - var res APIFieldError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_session_detail.go b/rest_model/api_session_detail.go deleted file mode 100644 index 545409ea9..000000000 --- a/rest_model/api_session_detail.go +++ /dev/null @@ -1,472 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// APISessionDetail An API Session object -// -// swagger:model apiSessionDetail -type APISessionDetail struct { - BaseEntity - - // auth queries - // Required: true - AuthQueries AuthQueryList `json:"authQueries"` - - // authenticator Id - // Required: true - AuthenticatorID *string `json:"authenticatorId"` - - // cached last activity at - // Format: date-time - CachedLastActivityAt strfmt.DateTime `json:"cachedLastActivityAt,omitempty"` - - // config types - // Required: true - ConfigTypes []string `json:"configTypes"` - - // identity - // Required: true - Identity *EntityRef `json:"identity"` - - // identity Id - // Required: true - IdentityID *string `json:"identityId"` - - // ip address - // Required: true - IPAddress *string `json:"ipAddress"` - - // is mfa complete - // Required: true - IsMfaComplete *bool `json:"isMfaComplete"` - - // is mfa required - // Required: true - IsMfaRequired *bool `json:"isMfaRequired"` - - // last activity at - // Format: date-time - LastActivityAt strfmt.DateTime `json:"lastActivityAt,omitempty"` - - // token - // Required: true - Token *string `json:"token"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *APISessionDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - AuthQueries AuthQueryList `json:"authQueries"` - - AuthenticatorID *string `json:"authenticatorId"` - - CachedLastActivityAt strfmt.DateTime `json:"cachedLastActivityAt,omitempty"` - - ConfigTypes []string `json:"configTypes"` - - Identity *EntityRef `json:"identity"` - - IdentityID *string `json:"identityId"` - - IPAddress *string `json:"ipAddress"` - - IsMfaComplete *bool `json:"isMfaComplete"` - - IsMfaRequired *bool `json:"isMfaRequired"` - - LastActivityAt strfmt.DateTime `json:"lastActivityAt,omitempty"` - - Token *string `json:"token"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.AuthQueries = dataAO1.AuthQueries - - m.AuthenticatorID = dataAO1.AuthenticatorID - - m.CachedLastActivityAt = dataAO1.CachedLastActivityAt - - m.ConfigTypes = dataAO1.ConfigTypes - - m.Identity = dataAO1.Identity - - m.IdentityID = dataAO1.IdentityID - - m.IPAddress = dataAO1.IPAddress - - m.IsMfaComplete = dataAO1.IsMfaComplete - - m.IsMfaRequired = dataAO1.IsMfaRequired - - m.LastActivityAt = dataAO1.LastActivityAt - - m.Token = dataAO1.Token - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m APISessionDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - AuthQueries AuthQueryList `json:"authQueries"` - - AuthenticatorID *string `json:"authenticatorId"` - - CachedLastActivityAt strfmt.DateTime `json:"cachedLastActivityAt,omitempty"` - - ConfigTypes []string `json:"configTypes"` - - Identity *EntityRef `json:"identity"` - - IdentityID *string `json:"identityId"` - - IPAddress *string `json:"ipAddress"` - - IsMfaComplete *bool `json:"isMfaComplete"` - - IsMfaRequired *bool `json:"isMfaRequired"` - - LastActivityAt strfmt.DateTime `json:"lastActivityAt,omitempty"` - - Token *string `json:"token"` - } - - dataAO1.AuthQueries = m.AuthQueries - - dataAO1.AuthenticatorID = m.AuthenticatorID - - dataAO1.CachedLastActivityAt = m.CachedLastActivityAt - - dataAO1.ConfigTypes = m.ConfigTypes - - dataAO1.Identity = m.Identity - - dataAO1.IdentityID = m.IdentityID - - dataAO1.IPAddress = m.IPAddress - - dataAO1.IsMfaComplete = m.IsMfaComplete - - dataAO1.IsMfaRequired = m.IsMfaRequired - - dataAO1.LastActivityAt = m.LastActivityAt - - dataAO1.Token = m.Token - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this api session detail -func (m *APISessionDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAuthQueries(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAuthenticatorID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCachedLastActivityAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigTypes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIPAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsMfaComplete(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsMfaRequired(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastActivityAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APISessionDetail) validateAuthQueries(formats strfmt.Registry) error { - - if err := validate.Required("authQueries", "body", m.AuthQueries); err != nil { - return err - } - - if err := m.AuthQueries.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authQueries") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authQueries") - } - return err - } - - return nil -} - -func (m *APISessionDetail) validateAuthenticatorID(formats strfmt.Registry) error { - - if err := validate.Required("authenticatorId", "body", m.AuthenticatorID); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateCachedLastActivityAt(formats strfmt.Registry) error { - - if swag.IsZero(m.CachedLastActivityAt) { // not required - return nil - } - - if err := validate.FormatOf("cachedLastActivityAt", "body", "date-time", m.CachedLastActivityAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateConfigTypes(formats strfmt.Registry) error { - - if err := validate.Required("configTypes", "body", m.ConfigTypes); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateIdentity(formats strfmt.Registry) error { - - if err := validate.Required("identity", "body", m.Identity); err != nil { - return err - } - - if m.Identity != nil { - if err := m.Identity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *APISessionDetail) validateIdentityID(formats strfmt.Registry) error { - - if err := validate.Required("identityId", "body", m.IdentityID); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateIPAddress(formats strfmt.Registry) error { - - if err := validate.Required("ipAddress", "body", m.IPAddress); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateIsMfaComplete(formats strfmt.Registry) error { - - if err := validate.Required("isMfaComplete", "body", m.IsMfaComplete); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateIsMfaRequired(formats strfmt.Registry) error { - - if err := validate.Required("isMfaRequired", "body", m.IsMfaRequired); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateLastActivityAt(formats strfmt.Registry) error { - - if swag.IsZero(m.LastActivityAt) { // not required - return nil - } - - if err := validate.FormatOf("lastActivityAt", "body", "date-time", m.LastActivityAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *APISessionDetail) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this api session detail based on the context it is used -func (m *APISessionDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAuthQueries(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APISessionDetail) contextValidateAuthQueries(ctx context.Context, formats strfmt.Registry) error { - - if err := m.AuthQueries.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authQueries") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authQueries") - } - return err - } - - return nil -} - -func (m *APISessionDetail) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APISessionDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APISessionDetail) UnmarshalBinary(b []byte) error { - var res APISessionDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_session_list.go b/rest_model/api_session_list.go deleted file mode 100644 index 9608f7da9..000000000 --- a/rest_model/api_session_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// APISessionList api session list -// -// swagger:model apiSessionList -type APISessionList []*APISessionDetail - -// Validate validates this api session list -func (m APISessionList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this api session list based on the context it is used -func (m APISessionList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/api_session_posture_data.go b/rest_model/api_session_posture_data.go deleted file mode 100644 index 78bc118ae..000000000 --- a/rest_model/api_session_posture_data.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// APISessionPostureData api session posture data -// -// swagger:model apiSessionPostureData -type APISessionPostureData struct { - - // endpoint state - EndpointState *PostureDataEndpointState `json:"endpointState,omitempty"` - - // mfa - // Required: true - Mfa *PostureDataMfa `json:"mfa"` - - // sdk info - SdkInfo *SdkInfo `json:"sdkInfo,omitempty"` -} - -// Validate validates this api session posture data -func (m *APISessionPostureData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEndpointState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMfa(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSdkInfo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APISessionPostureData) validateEndpointState(formats strfmt.Registry) error { - if swag.IsZero(m.EndpointState) { // not required - return nil - } - - if m.EndpointState != nil { - if err := m.EndpointState.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("endpointState") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("endpointState") - } - return err - } - } - - return nil -} - -func (m *APISessionPostureData) validateMfa(formats strfmt.Registry) error { - - if err := validate.Required("mfa", "body", m.Mfa); err != nil { - return err - } - - if m.Mfa != nil { - if err := m.Mfa.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mfa") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mfa") - } - return err - } - } - - return nil -} - -func (m *APISessionPostureData) validateSdkInfo(formats strfmt.Registry) error { - if swag.IsZero(m.SdkInfo) { // not required - return nil - } - - if m.SdkInfo != nil { - if err := m.SdkInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sdkInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sdkInfo") - } - return err - } - } - - return nil -} - -// ContextValidate validate this api session posture data based on the context it is used -func (m *APISessionPostureData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEndpointState(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMfa(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSdkInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APISessionPostureData) contextValidateEndpointState(ctx context.Context, formats strfmt.Registry) error { - - if m.EndpointState != nil { - if err := m.EndpointState.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("endpointState") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("endpointState") - } - return err - } - } - - return nil -} - -func (m *APISessionPostureData) contextValidateMfa(ctx context.Context, formats strfmt.Registry) error { - - if m.Mfa != nil { - if err := m.Mfa.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mfa") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mfa") - } - return err - } - } - - return nil -} - -func (m *APISessionPostureData) contextValidateSdkInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.SdkInfo != nil { - if err := m.SdkInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sdkInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sdkInfo") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *APISessionPostureData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APISessionPostureData) UnmarshalBinary(b []byte) error { - var res APISessionPostureData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/api_version.go b/rest_model/api_version.go deleted file mode 100644 index cf8e19154..000000000 --- a/rest_model/api_version.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// APIVersion api version -// -// swagger:model apiVersion -type APIVersion struct { - - // api base urls - APIBaseUrls []string `json:"apiBaseUrls"` - - // path - // Required: true - Path *string `json:"path"` - - // version - Version string `json:"version,omitempty"` -} - -// Validate validates this api version -func (m *APIVersion) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *APIVersion) validatePath(formats strfmt.Registry) error { - - if err := validate.Required("path", "body", m.Path); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this api version based on context it is used -func (m *APIVersion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *APIVersion) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *APIVersion) UnmarshalBinary(b []byte) error { - var res APIVersion - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/attributes.go b/rest_model/attributes.go deleted file mode 100644 index d26e01b31..000000000 --- a/rest_model/attributes.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// Attributes A set of strings used to loosly couple this resource to policies -// -// swagger:model attributes -type Attributes []string - -// Validate validates this attributes -func (m Attributes) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this attributes based on context it is used -func (m Attributes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/auth_policy_create.go b/rest_model/auth_policy_create.go deleted file mode 100644 index fd62842fb..000000000 --- a/rest_model/auth_policy_create.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicyCreate A Auth Policy resource -// -// swagger:model authPolicyCreate -type AuthPolicyCreate struct { - - // name - // Required: true - Name *string `json:"name"` - - // primary - // Required: true - Primary *AuthPolicyPrimary `json:"primary"` - - // secondary - // Required: true - Secondary *AuthPolicySecondary `json:"secondary"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this auth policy create -func (m *AuthPolicyCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimary(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondary(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyCreate) validatePrimary(formats strfmt.Registry) error { - - if err := validate.Required("primary", "body", m.Primary); err != nil { - return err - } - - if m.Primary != nil { - if err := m.Primary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("primary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("primary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyCreate) validateSecondary(formats strfmt.Registry) error { - - if err := validate.Required("secondary", "body", m.Secondary); err != nil { - return err - } - - if m.Secondary != nil { - if err := m.Secondary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this auth policy create based on the context it is used -func (m *AuthPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePrimary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyCreate) contextValidatePrimary(ctx context.Context, formats strfmt.Registry) error { - - if m.Primary != nil { - if err := m.Primary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("primary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("primary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyCreate) contextValidateSecondary(ctx context.Context, formats strfmt.Registry) error { - - if m.Secondary != nil { - if err := m.Secondary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyCreate) UnmarshalBinary(b []byte) error { - var res AuthPolicyCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_detail.go b/rest_model/auth_policy_detail.go deleted file mode 100644 index 0e5ded182..000000000 --- a/rest_model/auth_policy_detail.go +++ /dev/null @@ -1,268 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicyDetail A Auth Policy resource -// -// swagger:model authPolicyDetail -type AuthPolicyDetail struct { - BaseEntity - - // name - // Required: true - Name *string `json:"name"` - - // primary - // Required: true - Primary *AuthPolicyPrimary `json:"primary"` - - // secondary - // Required: true - Secondary *AuthPolicySecondary `json:"secondary"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AuthPolicyDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Name *string `json:"name"` - - Primary *AuthPolicyPrimary `json:"primary"` - - Secondary *AuthPolicySecondary `json:"secondary"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Name = dataAO1.Name - - m.Primary = dataAO1.Primary - - m.Secondary = dataAO1.Secondary - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AuthPolicyDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Name *string `json:"name"` - - Primary *AuthPolicyPrimary `json:"primary"` - - Secondary *AuthPolicySecondary `json:"secondary"` - } - - dataAO1.Name = m.Name - - dataAO1.Primary = m.Primary - - dataAO1.Secondary = m.Secondary - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this auth policy detail -func (m *AuthPolicyDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimary(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondary(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyDetail) validatePrimary(formats strfmt.Registry) error { - - if err := validate.Required("primary", "body", m.Primary); err != nil { - return err - } - - if m.Primary != nil { - if err := m.Primary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("primary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("primary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyDetail) validateSecondary(formats strfmt.Registry) error { - - if err := validate.Required("secondary", "body", m.Secondary); err != nil { - return err - } - - if m.Secondary != nil { - if err := m.Secondary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondary") - } - return err - } - } - - return nil -} - -// ContextValidate validate this auth policy detail based on the context it is used -func (m *AuthPolicyDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondary(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyDetail) contextValidatePrimary(ctx context.Context, formats strfmt.Registry) error { - - if m.Primary != nil { - if err := m.Primary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("primary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("primary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyDetail) contextValidateSecondary(ctx context.Context, formats strfmt.Registry) error { - - if m.Secondary != nil { - if err := m.Secondary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondary") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyDetail) UnmarshalBinary(b []byte) error { - var res AuthPolicyDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_list.go b/rest_model/auth_policy_list.go deleted file mode 100644 index e0c20ddf1..000000000 --- a/rest_model/auth_policy_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyList An array of Auth Policies resources -// -// swagger:model authPolicyList -type AuthPolicyList []*AuthPolicyDetail - -// Validate validates this auth policy list -func (m AuthPolicyList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this auth policy list based on the context it is used -func (m AuthPolicyList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/auth_policy_patch.go b/rest_model/auth_policy_patch.go deleted file mode 100644 index 005ce23db..000000000 --- a/rest_model/auth_policy_patch.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyPatch A Auth Policy resource -// -// swagger:model authPolicyPatch -type AuthPolicyPatch struct { - - // name - Name *string `json:"name,omitempty"` - - // primary - Primary *AuthPolicyPrimaryPatch `json:"primary,omitempty"` - - // secondary - Secondary *AuthPolicySecondaryPatch `json:"secondary,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this auth policy patch -func (m *AuthPolicyPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePrimary(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondary(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPatch) validatePrimary(formats strfmt.Registry) error { - if swag.IsZero(m.Primary) { // not required - return nil - } - - if m.Primary != nil { - if err := m.Primary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("primary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("primary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPatch) validateSecondary(formats strfmt.Registry) error { - if swag.IsZero(m.Secondary) { // not required - return nil - } - - if m.Secondary != nil { - if err := m.Secondary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this auth policy patch based on the context it is used -func (m *AuthPolicyPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePrimary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondary(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPatch) contextValidatePrimary(ctx context.Context, formats strfmt.Registry) error { - - if m.Primary != nil { - if err := m.Primary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("primary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("primary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPatch) contextValidateSecondary(ctx context.Context, formats strfmt.Registry) error { - - if m.Secondary != nil { - if err := m.Secondary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondary") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPatch) UnmarshalBinary(b []byte) error { - var res AuthPolicyPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary.go b/rest_model/auth_policy_primary.go deleted file mode 100644 index 5634daab0..000000000 --- a/rest_model/auth_policy_primary.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicyPrimary auth policy primary -// -// swagger:model authPolicyPrimary -type AuthPolicyPrimary struct { - - // cert - // Required: true - Cert *AuthPolicyPrimaryCert `json:"cert"` - - // ext Jwt - // Required: true - ExtJWT *AuthPolicyPrimaryExtJWT `json:"extJwt"` - - // updb - // Required: true - Updb *AuthPolicyPrimaryUpdb `json:"updb"` -} - -// Validate validates this auth policy primary -func (m *AuthPolicyPrimary) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCert(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExtJWT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdb(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimary) validateCert(formats strfmt.Registry) error { - - if err := validate.Required("cert", "body", m.Cert); err != nil { - return err - } - - if m.Cert != nil { - if err := m.Cert.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cert") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cert") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimary) validateExtJWT(formats strfmt.Registry) error { - - if err := validate.Required("extJwt", "body", m.ExtJWT); err != nil { - return err - } - - if m.ExtJWT != nil { - if err := m.ExtJWT.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("extJwt") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("extJwt") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimary) validateUpdb(formats strfmt.Registry) error { - - if err := validate.Required("updb", "body", m.Updb); err != nil { - return err - } - - if m.Updb != nil { - if err := m.Updb.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// ContextValidate validate this auth policy primary based on the context it is used -func (m *AuthPolicyPrimary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCert(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExtJWT(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdb(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimary) contextValidateCert(ctx context.Context, formats strfmt.Registry) error { - - if m.Cert != nil { - if err := m.Cert.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cert") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cert") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimary) contextValidateExtJWT(ctx context.Context, formats strfmt.Registry) error { - - if m.ExtJWT != nil { - if err := m.ExtJWT.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("extJwt") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("extJwt") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimary) contextValidateUpdb(ctx context.Context, formats strfmt.Registry) error { - - if m.Updb != nil { - if err := m.Updb.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimary) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimary) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_cert.go b/rest_model/auth_policy_primary_cert.go deleted file mode 100644 index f4a15b80d..000000000 --- a/rest_model/auth_policy_primary_cert.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicyPrimaryCert auth policy primary cert -// -// swagger:model authPolicyPrimaryCert -type AuthPolicyPrimaryCert struct { - - // allow expired certs - // Required: true - AllowExpiredCerts *bool `json:"allowExpiredCerts"` - - // allowed - // Required: true - Allowed *bool `json:"allowed"` -} - -// Validate validates this auth policy primary cert -func (m *AuthPolicyPrimaryCert) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAllowExpiredCerts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAllowed(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimaryCert) validateAllowExpiredCerts(formats strfmt.Registry) error { - - if err := validate.Required("allowExpiredCerts", "body", m.AllowExpiredCerts); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryCert) validateAllowed(formats strfmt.Registry) error { - - if err := validate.Required("allowed", "body", m.Allowed); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this auth policy primary cert based on context it is used -func (m *AuthPolicyPrimaryCert) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryCert) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryCert) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryCert - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_cert_patch.go b/rest_model/auth_policy_primary_cert_patch.go deleted file mode 100644 index c13bd4ca9..000000000 --- a/rest_model/auth_policy_primary_cert_patch.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyPrimaryCertPatch auth policy primary cert patch -// -// swagger:model authPolicyPrimaryCertPatch -type AuthPolicyPrimaryCertPatch struct { - - // allow expired certs - AllowExpiredCerts *bool `json:"allowExpiredCerts,omitempty"` - - // allowed - Allowed *bool `json:"allowed,omitempty"` -} - -// Validate validates this auth policy primary cert patch -func (m *AuthPolicyPrimaryCertPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this auth policy primary cert patch based on context it is used -func (m *AuthPolicyPrimaryCertPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryCertPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryCertPatch) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryCertPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_ext_jwt.go b/rest_model/auth_policy_primary_ext_jwt.go deleted file mode 100644 index 5cd2d9ddc..000000000 --- a/rest_model/auth_policy_primary_ext_jwt.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicyPrimaryExtJWT auth policy primary ext Jwt -// -// swagger:model authPolicyPrimaryExtJwt -type AuthPolicyPrimaryExtJWT struct { - - // allowed - // Required: true - Allowed *bool `json:"allowed"` - - // allowed signers - // Required: true - AllowedSigners []string `json:"allowedSigners"` -} - -// Validate validates this auth policy primary ext Jwt -func (m *AuthPolicyPrimaryExtJWT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAllowed(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAllowedSigners(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimaryExtJWT) validateAllowed(formats strfmt.Registry) error { - - if err := validate.Required("allowed", "body", m.Allowed); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryExtJWT) validateAllowedSigners(formats strfmt.Registry) error { - - if err := validate.Required("allowedSigners", "body", m.AllowedSigners); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this auth policy primary ext Jwt based on context it is used -func (m *AuthPolicyPrimaryExtJWT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryExtJWT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryExtJWT) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryExtJWT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_ext_jwt_patch.go b/rest_model/auth_policy_primary_ext_jwt_patch.go deleted file mode 100644 index 7d3a2d912..000000000 --- a/rest_model/auth_policy_primary_ext_jwt_patch.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyPrimaryExtJWTPatch auth policy primary ext Jwt patch -// -// swagger:model authPolicyPrimaryExtJwtPatch -type AuthPolicyPrimaryExtJWTPatch struct { - - // allowed - Allowed *bool `json:"allowed,omitempty"` - - // allowed signers - AllowedSigners []string `json:"allowedSigners"` -} - -// Validate validates this auth policy primary ext Jwt patch -func (m *AuthPolicyPrimaryExtJWTPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this auth policy primary ext Jwt patch based on context it is used -func (m *AuthPolicyPrimaryExtJWTPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryExtJWTPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryExtJWTPatch) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryExtJWTPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_patch.go b/rest_model/auth_policy_primary_patch.go deleted file mode 100644 index 26ecb71d0..000000000 --- a/rest_model/auth_policy_primary_patch.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyPrimaryPatch auth policy primary patch -// -// swagger:model authPolicyPrimaryPatch -type AuthPolicyPrimaryPatch struct { - - // cert - Cert *AuthPolicyPrimaryCertPatch `json:"cert,omitempty"` - - // ext Jwt - ExtJWT *AuthPolicyPrimaryExtJWTPatch `json:"extJwt,omitempty"` - - // updb - Updb *AuthPolicyPrimaryUpdbPatch `json:"updb,omitempty"` -} - -// Validate validates this auth policy primary patch -func (m *AuthPolicyPrimaryPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCert(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExtJWT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdb(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimaryPatch) validateCert(formats strfmt.Registry) error { - if swag.IsZero(m.Cert) { // not required - return nil - } - - if m.Cert != nil { - if err := m.Cert.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cert") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cert") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimaryPatch) validateExtJWT(formats strfmt.Registry) error { - if swag.IsZero(m.ExtJWT) { // not required - return nil - } - - if m.ExtJWT != nil { - if err := m.ExtJWT.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("extJwt") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("extJwt") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimaryPatch) validateUpdb(formats strfmt.Registry) error { - if swag.IsZero(m.Updb) { // not required - return nil - } - - if m.Updb != nil { - if err := m.Updb.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// ContextValidate validate this auth policy primary patch based on the context it is used -func (m *AuthPolicyPrimaryPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCert(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExtJWT(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdb(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimaryPatch) contextValidateCert(ctx context.Context, formats strfmt.Registry) error { - - if m.Cert != nil { - if err := m.Cert.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cert") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cert") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimaryPatch) contextValidateExtJWT(ctx context.Context, formats strfmt.Registry) error { - - if m.ExtJWT != nil { - if err := m.ExtJWT.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("extJwt") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("extJwt") - } - return err - } - } - - return nil -} - -func (m *AuthPolicyPrimaryPatch) contextValidateUpdb(ctx context.Context, formats strfmt.Registry) error { - - if m.Updb != nil { - if err := m.Updb.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryPatch) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_updb.go b/rest_model/auth_policy_primary_updb.go deleted file mode 100644 index 61cd85cf4..000000000 --- a/rest_model/auth_policy_primary_updb.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicyPrimaryUpdb auth policy primary updb -// -// swagger:model authPolicyPrimaryUpdb -type AuthPolicyPrimaryUpdb struct { - - // allowed - // Required: true - Allowed *bool `json:"allowed"` - - // lockout duration minutes - // Required: true - LockoutDurationMinutes *int64 `json:"lockoutDurationMinutes"` - - // max attempts - // Required: true - MaxAttempts *int64 `json:"maxAttempts"` - - // min password length - // Required: true - MinPasswordLength *int64 `json:"minPasswordLength"` - - // require mixed case - // Required: true - RequireMixedCase *bool `json:"requireMixedCase"` - - // require number char - // Required: true - RequireNumberChar *bool `json:"requireNumberChar"` - - // require special char - // Required: true - RequireSpecialChar *bool `json:"requireSpecialChar"` -} - -// Validate validates this auth policy primary updb -func (m *AuthPolicyPrimaryUpdb) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAllowed(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockoutDurationMinutes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMaxAttempts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMinPasswordLength(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequireMixedCase(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequireNumberChar(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequireSpecialChar(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateAllowed(formats strfmt.Registry) error { - - if err := validate.Required("allowed", "body", m.Allowed); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateLockoutDurationMinutes(formats strfmt.Registry) error { - - if err := validate.Required("lockoutDurationMinutes", "body", m.LockoutDurationMinutes); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateMaxAttempts(formats strfmt.Registry) error { - - if err := validate.Required("maxAttempts", "body", m.MaxAttempts); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateMinPasswordLength(formats strfmt.Registry) error { - - if err := validate.Required("minPasswordLength", "body", m.MinPasswordLength); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateRequireMixedCase(formats strfmt.Registry) error { - - if err := validate.Required("requireMixedCase", "body", m.RequireMixedCase); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateRequireNumberChar(formats strfmt.Registry) error { - - if err := validate.Required("requireNumberChar", "body", m.RequireNumberChar); err != nil { - return err - } - - return nil -} - -func (m *AuthPolicyPrimaryUpdb) validateRequireSpecialChar(formats strfmt.Registry) error { - - if err := validate.Required("requireSpecialChar", "body", m.RequireSpecialChar); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this auth policy primary updb based on context it is used -func (m *AuthPolicyPrimaryUpdb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryUpdb) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryUpdb) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryUpdb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_primary_updb_patch.go b/rest_model/auth_policy_primary_updb_patch.go deleted file mode 100644 index 8a3efad4f..000000000 --- a/rest_model/auth_policy_primary_updb_patch.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyPrimaryUpdbPatch auth policy primary updb patch -// -// swagger:model authPolicyPrimaryUpdbPatch -type AuthPolicyPrimaryUpdbPatch struct { - - // allowed - Allowed *bool `json:"allowed,omitempty"` - - // lockout duration minutes - LockoutDurationMinutes *int64 `json:"lockoutDurationMinutes,omitempty"` - - // max attempts - MaxAttempts *int64 `json:"maxAttempts,omitempty"` - - // min password length - MinPasswordLength *int64 `json:"minPasswordLength,omitempty"` - - // require mixed case - RequireMixedCase *bool `json:"requireMixedCase,omitempty"` - - // require number char - RequireNumberChar *bool `json:"requireNumberChar,omitempty"` - - // require special char - RequireSpecialChar *bool `json:"requireSpecialChar,omitempty"` -} - -// Validate validates this auth policy primary updb patch -func (m *AuthPolicyPrimaryUpdbPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this auth policy primary updb patch based on context it is used -func (m *AuthPolicyPrimaryUpdbPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicyPrimaryUpdbPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicyPrimaryUpdbPatch) UnmarshalBinary(b []byte) error { - var res AuthPolicyPrimaryUpdbPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_secondary.go b/rest_model/auth_policy_secondary.go deleted file mode 100644 index b952d819e..000000000 --- a/rest_model/auth_policy_secondary.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthPolicySecondary auth policy secondary -// -// swagger:model authPolicySecondary -type AuthPolicySecondary struct { - - // require ext Jwt signer - RequireExtJWTSigner *string `json:"requireExtJwtSigner,omitempty"` - - // require totp - // Required: true - RequireTotp *bool `json:"requireTotp"` -} - -// Validate validates this auth policy secondary -func (m *AuthPolicySecondary) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRequireTotp(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthPolicySecondary) validateRequireTotp(formats strfmt.Registry) error { - - if err := validate.Required("requireTotp", "body", m.RequireTotp); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this auth policy secondary based on context it is used -func (m *AuthPolicySecondary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicySecondary) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicySecondary) UnmarshalBinary(b []byte) error { - var res AuthPolicySecondary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_secondary_patch.go b/rest_model/auth_policy_secondary_patch.go deleted file mode 100644 index a458d5ce0..000000000 --- a/rest_model/auth_policy_secondary_patch.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicySecondaryPatch auth policy secondary patch -// -// swagger:model authPolicySecondaryPatch -type AuthPolicySecondaryPatch struct { - - // require ext Jwt signer - RequireExtJWTSigner *string `json:"requireExtJwtSigner,omitempty"` - - // require totp - RequireTotp *bool `json:"requireTotp,omitempty"` -} - -// Validate validates this auth policy secondary patch -func (m *AuthPolicySecondaryPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this auth policy secondary patch based on context it is used -func (m *AuthPolicySecondaryPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *AuthPolicySecondaryPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthPolicySecondaryPatch) UnmarshalBinary(b []byte) error { - var res AuthPolicySecondaryPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_policy_update.go b/rest_model/auth_policy_update.go deleted file mode 100644 index 91d9cd93d..000000000 --- a/rest_model/auth_policy_update.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthPolicyUpdate auth policy update -// -// swagger:model authPolicyUpdate -type AuthPolicyUpdate struct { - AuthPolicyCreate -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AuthPolicyUpdate) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 AuthPolicyCreate - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.AuthPolicyCreate = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AuthPolicyUpdate) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.AuthPolicyCreate) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this auth policy update -func (m *AuthPolicyUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validate this auth policy update based on the context it is used -func (m *AuthPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AuthPolicyCreate - if err := m.AuthPolicyCreate.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/auth_query_detail.go b/rest_model/auth_query_detail.go deleted file mode 100644 index bd8d783f9..000000000 --- a/rest_model/auth_query_detail.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthQueryDetail auth query detail -// -// swagger:model authQueryDetail -type AuthQueryDetail struct { - - // format - Format MfaFormats `json:"format,omitempty"` - - // http method - HTTPMethod string `json:"httpMethod,omitempty"` - - // http Url - HTTPURL string `json:"httpUrl,omitempty"` - - // max length - MaxLength int64 `json:"maxLength,omitempty"` - - // min length - MinLength int64 `json:"minLength,omitempty"` - - // provider - // Required: true - Provider *MfaProviders `json:"provider"` - - // type Id - TypeID string `json:"typeId,omitempty"` -} - -// Validate validates this auth query detail -func (m *AuthQueryDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateFormat(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProvider(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthQueryDetail) validateFormat(formats strfmt.Registry) error { - if swag.IsZero(m.Format) { // not required - return nil - } - - if err := m.Format.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("format") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("format") - } - return err - } - - return nil -} - -func (m *AuthQueryDetail) validateProvider(formats strfmt.Registry) error { - - if err := validate.Required("provider", "body", m.Provider); err != nil { - return err - } - - if err := validate.Required("provider", "body", m.Provider); err != nil { - return err - } - - if m.Provider != nil { - if err := m.Provider.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("provider") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("provider") - } - return err - } - } - - return nil -} - -// ContextValidate validate this auth query detail based on the context it is used -func (m *AuthQueryDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateFormat(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProvider(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthQueryDetail) contextValidateFormat(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Format.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("format") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("format") - } - return err - } - - return nil -} - -func (m *AuthQueryDetail) contextValidateProvider(ctx context.Context, formats strfmt.Registry) error { - - if m.Provider != nil { - if err := m.Provider.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("provider") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("provider") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthQueryDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthQueryDetail) UnmarshalBinary(b []byte) error { - var res AuthQueryDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/auth_query_list.go b/rest_model/auth_query_list.go deleted file mode 100644 index 6fec8c105..000000000 --- a/rest_model/auth_query_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthQueryList auth query list -// -// swagger:model authQueryList -type AuthQueryList []*AuthQueryDetail - -// Validate validates this auth query list -func (m AuthQueryList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this auth query list based on the context it is used -func (m AuthQueryList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/authenticate.go b/rest_model/authenticate.go deleted file mode 100644 index a7e7e6e02..000000000 --- a/rest_model/authenticate.go +++ /dev/null @@ -1,300 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Authenticate A generic authenticate object meant for use with the /authenticate path. Required fields depend on authentication method. -// -// swagger:model authenticate -type Authenticate struct { - - // config types - ConfigTypes ConfigTypes `json:"configTypes,omitempty"` - - // env info - EnvInfo *EnvInfo `json:"envInfo,omitempty"` - - // password - Password Password `json:"password,omitempty"` - - // sdk info - SdkInfo *SdkInfo `json:"sdkInfo,omitempty"` - - // username - Username Username `json:"username,omitempty"` -} - -// Validate validates this authenticate -func (m *Authenticate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfigTypes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSdkInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsername(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Authenticate) validateConfigTypes(formats strfmt.Registry) error { - if swag.IsZero(m.ConfigTypes) { // not required - return nil - } - - if err := m.ConfigTypes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("configTypes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("configTypes") - } - return err - } - - return nil -} - -func (m *Authenticate) validateEnvInfo(formats strfmt.Registry) error { - if swag.IsZero(m.EnvInfo) { // not required - return nil - } - - if m.EnvInfo != nil { - if err := m.EnvInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("envInfo") - } - return err - } - } - - return nil -} - -func (m *Authenticate) validatePassword(formats strfmt.Registry) error { - if swag.IsZero(m.Password) { // not required - return nil - } - - if err := m.Password.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - - return nil -} - -func (m *Authenticate) validateSdkInfo(formats strfmt.Registry) error { - if swag.IsZero(m.SdkInfo) { // not required - return nil - } - - if m.SdkInfo != nil { - if err := m.SdkInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sdkInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sdkInfo") - } - return err - } - } - - return nil -} - -func (m *Authenticate) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required - return nil - } - - if err := m.Username.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("username") - } - return err - } - - return nil -} - -// ContextValidate validate this authenticate based on the context it is used -func (m *Authenticate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfigTypes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnvInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePassword(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSdkInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUsername(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Authenticate) contextValidateConfigTypes(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ConfigTypes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("configTypes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("configTypes") - } - return err - } - - return nil -} - -func (m *Authenticate) contextValidateEnvInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.EnvInfo != nil { - if err := m.EnvInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("envInfo") - } - return err - } - } - - return nil -} - -func (m *Authenticate) contextValidatePassword(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Password.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - - return nil -} - -func (m *Authenticate) contextValidateSdkInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.SdkInfo != nil { - if err := m.SdkInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sdkInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sdkInfo") - } - return err - } - } - - return nil -} - -func (m *Authenticate) contextValidateUsername(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Username.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("username") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Authenticate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Authenticate) UnmarshalBinary(b []byte) error { - var res Authenticate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/authenticator_create.go b/rest_model/authenticator_create.go deleted file mode 100644 index 5362113e6..000000000 --- a/rest_model/authenticator_create.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthenticatorCreate Creates an authenticator for a specific identity which can be used for API authentication -// -// swagger:model authenticatorCreate -type AuthenticatorCreate struct { - - // The client certificate the identity will login with. Used only for method='cert' - CertPem string `json:"certPem,omitempty"` - - // The id of an existing identity that will be assigned this authenticator - // Required: true - IdentityID *string `json:"identityId"` - - // The type of authenticator to create; which will dictate which properties on this object are required. - // Required: true - Method *string `json:"method"` - - // The password the identity will login with. Used only for method='updb' - Password string `json:"password,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // The username that the identity will login with. Used only for method='updb' - Username string `json:"username,omitempty"` -} - -// Validate validates this authenticator create -func (m *AuthenticatorCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIdentityID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorCreate) validateIdentityID(formats strfmt.Registry) error { - - if err := validate.Required("identityId", "body", m.IdentityID); err != nil { - return err - } - - return nil -} - -func (m *AuthenticatorCreate) validateMethod(formats strfmt.Registry) error { - - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - return nil -} - -func (m *AuthenticatorCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this authenticator create based on the context it is used -func (m *AuthenticatorCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthenticatorCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthenticatorCreate) UnmarshalBinary(b []byte) error { - var res AuthenticatorCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/authenticator_detail.go b/rest_model/authenticator_detail.go deleted file mode 100644 index fe2501594..000000000 --- a/rest_model/authenticator_detail.go +++ /dev/null @@ -1,270 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthenticatorDetail A singular authenticator resource -// -// swagger:model authenticatorDetail -type AuthenticatorDetail struct { - BaseEntity - - // cert pem - CertPem string `json:"certPem,omitempty"` - - // fingerprint - Fingerprint string `json:"fingerprint,omitempty"` - - // identity - // Required: true - Identity *EntityRef `json:"identity"` - - // identity Id - // Required: true - IdentityID *string `json:"identityId"` - - // method - // Required: true - Method *string `json:"method"` - - // username - Username string `json:"username,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AuthenticatorDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - CertPem string `json:"certPem,omitempty"` - - Fingerprint string `json:"fingerprint,omitempty"` - - Identity *EntityRef `json:"identity"` - - IdentityID *string `json:"identityId"` - - Method *string `json:"method"` - - Username string `json:"username,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.CertPem = dataAO1.CertPem - - m.Fingerprint = dataAO1.Fingerprint - - m.Identity = dataAO1.Identity - - m.IdentityID = dataAO1.IdentityID - - m.Method = dataAO1.Method - - m.Username = dataAO1.Username - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AuthenticatorDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - CertPem string `json:"certPem,omitempty"` - - Fingerprint string `json:"fingerprint,omitempty"` - - Identity *EntityRef `json:"identity"` - - IdentityID *string `json:"identityId"` - - Method *string `json:"method"` - - Username string `json:"username,omitempty"` - } - - dataAO1.CertPem = m.CertPem - - dataAO1.Fingerprint = m.Fingerprint - - dataAO1.Identity = m.Identity - - dataAO1.IdentityID = m.IdentityID - - dataAO1.Method = m.Method - - dataAO1.Username = m.Username - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this authenticator detail -func (m *AuthenticatorDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMethod(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorDetail) validateIdentity(formats strfmt.Registry) error { - - if err := validate.Required("identity", "body", m.Identity); err != nil { - return err - } - - if m.Identity != nil { - if err := m.Identity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorDetail) validateIdentityID(formats strfmt.Registry) error { - - if err := validate.Required("identityId", "body", m.IdentityID); err != nil { - return err - } - - return nil -} - -func (m *AuthenticatorDetail) validateMethod(formats strfmt.Registry) error { - - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this authenticator detail based on the context it is used -func (m *AuthenticatorDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorDetail) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthenticatorDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthenticatorDetail) UnmarshalBinary(b []byte) error { - var res AuthenticatorDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/authenticator_list.go b/rest_model/authenticator_list.go deleted file mode 100644 index ca2000b4b..000000000 --- a/rest_model/authenticator_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthenticatorList An array of authenticator resources -// -// swagger:model authenticatorList -type AuthenticatorList []*AuthenticatorDetail - -// Validate validates this authenticator list -func (m AuthenticatorList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this authenticator list based on the context it is used -func (m AuthenticatorList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/authenticator_patch.go b/rest_model/authenticator_patch.go deleted file mode 100644 index 787167422..000000000 --- a/rest_model/authenticator_patch.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// AuthenticatorPatch All of the fields on an authenticator that may be updated -// -// swagger:model authenticatorPatch -type AuthenticatorPatch struct { - - // password - Password *PasswordNullable `json:"password,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // username - Username *UsernameNullable `json:"username,omitempty"` -} - -// Validate validates this authenticator patch -func (m *AuthenticatorPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsername(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorPatch) validatePassword(formats strfmt.Registry) error { - if swag.IsZero(m.Password) { // not required - return nil - } - - if m.Password != nil { - if err := m.Password.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorPatch) validateUsername(formats strfmt.Registry) error { - if swag.IsZero(m.Username) { // not required - return nil - } - - if m.Username != nil { - if err := m.Username.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("username") - } - return err - } - } - - return nil -} - -// ContextValidate validate this authenticator patch based on the context it is used -func (m *AuthenticatorPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePassword(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUsername(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorPatch) contextValidatePassword(ctx context.Context, formats strfmt.Registry) error { - - if m.Password != nil { - if err := m.Password.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorPatch) contextValidateUsername(ctx context.Context, formats strfmt.Registry) error { - - if m.Username != nil { - if err := m.Username.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("username") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthenticatorPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthenticatorPatch) UnmarshalBinary(b []byte) error { - var res AuthenticatorPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/authenticator_patch_with_current.go b/rest_model/authenticator_patch_with_current.go deleted file mode 100644 index 3c1ba63bd..000000000 --- a/rest_model/authenticator_patch_with_current.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthenticatorPatchWithCurrent All of the fields on an authenticator that may be updated -// -// swagger:model authenticatorPatchWithCurrent -type AuthenticatorPatchWithCurrent struct { - AuthenticatorPatch - - // current password - // Required: true - CurrentPassword *Password `json:"currentPassword"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AuthenticatorPatchWithCurrent) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 AuthenticatorPatch - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.AuthenticatorPatch = aO0 - - // AO1 - var dataAO1 struct { - CurrentPassword *Password `json:"currentPassword"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.CurrentPassword = dataAO1.CurrentPassword - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AuthenticatorPatchWithCurrent) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.AuthenticatorPatch) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - CurrentPassword *Password `json:"currentPassword"` - } - - dataAO1.CurrentPassword = m.CurrentPassword - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this authenticator patch with current -func (m *AuthenticatorPatchWithCurrent) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AuthenticatorPatch - if err := m.AuthenticatorPatch.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentPassword(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorPatchWithCurrent) validateCurrentPassword(formats strfmt.Registry) error { - - if err := validate.Required("currentPassword", "body", m.CurrentPassword); err != nil { - return err - } - - if err := validate.Required("currentPassword", "body", m.CurrentPassword); err != nil { - return err - } - - if m.CurrentPassword != nil { - if err := m.CurrentPassword.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentPassword") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentPassword") - } - return err - } - } - - return nil -} - -// ContextValidate validate this authenticator patch with current based on the context it is used -func (m *AuthenticatorPatchWithCurrent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AuthenticatorPatch - if err := m.AuthenticatorPatch.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCurrentPassword(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorPatchWithCurrent) contextValidateCurrentPassword(ctx context.Context, formats strfmt.Registry) error { - - if m.CurrentPassword != nil { - if err := m.CurrentPassword.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentPassword") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentPassword") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthenticatorPatchWithCurrent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthenticatorPatchWithCurrent) UnmarshalBinary(b []byte) error { - var res AuthenticatorPatchWithCurrent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/authenticator_update.go b/rest_model/authenticator_update.go deleted file mode 100644 index 066c27c2d..000000000 --- a/rest_model/authenticator_update.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthenticatorUpdate All of the fields on an authenticator that will be updated -// -// swagger:model authenticatorUpdate -type AuthenticatorUpdate struct { - - // password - // Required: true - Password *Password `json:"password"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // username - // Required: true - Username *Username `json:"username"` -} - -// Validate validates this authenticator update -func (m *AuthenticatorUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePassword(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsername(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorUpdate) validatePassword(formats strfmt.Registry) error { - - if err := validate.Required("password", "body", m.Password); err != nil { - return err - } - - if err := validate.Required("password", "body", m.Password); err != nil { - return err - } - - if m.Password != nil { - if err := m.Password.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorUpdate) validateUsername(formats strfmt.Registry) error { - - if err := validate.Required("username", "body", m.Username); err != nil { - return err - } - - if err := validate.Required("username", "body", m.Username); err != nil { - return err - } - - if m.Username != nil { - if err := m.Username.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("username") - } - return err - } - } - - return nil -} - -// ContextValidate validate this authenticator update based on the context it is used -func (m *AuthenticatorUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePassword(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUsername(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorUpdate) contextValidatePassword(ctx context.Context, formats strfmt.Registry) error { - - if m.Password != nil { - if err := m.Password.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("password") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("password") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *AuthenticatorUpdate) contextValidateUsername(ctx context.Context, formats strfmt.Registry) error { - - if m.Username != nil { - if err := m.Username.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("username") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("username") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthenticatorUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthenticatorUpdate) UnmarshalBinary(b []byte) error { - var res AuthenticatorUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/authenticator_update_with_current.go b/rest_model/authenticator_update_with_current.go deleted file mode 100644 index 16c3d09a8..000000000 --- a/rest_model/authenticator_update_with_current.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// AuthenticatorUpdateWithCurrent All of the fields on an authenticator that will be updated -// -// swagger:model authenticatorUpdateWithCurrent -type AuthenticatorUpdateWithCurrent struct { - AuthenticatorUpdate - - // current password - // Required: true - CurrentPassword *Password `json:"currentPassword"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *AuthenticatorUpdateWithCurrent) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 AuthenticatorUpdate - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.AuthenticatorUpdate = aO0 - - // AO1 - var dataAO1 struct { - CurrentPassword *Password `json:"currentPassword"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.CurrentPassword = dataAO1.CurrentPassword - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m AuthenticatorUpdateWithCurrent) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.AuthenticatorUpdate) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - CurrentPassword *Password `json:"currentPassword"` - } - - dataAO1.CurrentPassword = m.CurrentPassword - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this authenticator update with current -func (m *AuthenticatorUpdateWithCurrent) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AuthenticatorUpdate - if err := m.AuthenticatorUpdate.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentPassword(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorUpdateWithCurrent) validateCurrentPassword(formats strfmt.Registry) error { - - if err := validate.Required("currentPassword", "body", m.CurrentPassword); err != nil { - return err - } - - if err := validate.Required("currentPassword", "body", m.CurrentPassword); err != nil { - return err - } - - if m.CurrentPassword != nil { - if err := m.CurrentPassword.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentPassword") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentPassword") - } - return err - } - } - - return nil -} - -// ContextValidate validate this authenticator update with current based on the context it is used -func (m *AuthenticatorUpdateWithCurrent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with AuthenticatorUpdate - if err := m.AuthenticatorUpdate.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCurrentPassword(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *AuthenticatorUpdateWithCurrent) contextValidateCurrentPassword(ctx context.Context, formats strfmt.Registry) error { - - if m.CurrentPassword != nil { - if err := m.CurrentPassword.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentPassword") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentPassword") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *AuthenticatorUpdateWithCurrent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *AuthenticatorUpdateWithCurrent) UnmarshalBinary(b []byte) error { - var res AuthenticatorUpdateWithCurrent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/base_entity.go b/rest_model/base_entity.go deleted file mode 100644 index 0e79c58b3..000000000 --- a/rest_model/base_entity.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// BaseEntity Fields shared by all Edge API entities -// -// swagger:model baseEntity -type BaseEntity struct { - - // links - // Required: true - Links Links `json:"_links"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"createdAt"` - - // id - // Required: true - ID *string `json:"id"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this base entity -func (m *BaseEntity) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BaseEntity) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links); err != nil { - return err - } - - if m.Links != nil { - if err := m.Links.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *BaseEntity) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *BaseEntity) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *BaseEntity) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *BaseEntity) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this base entity based on the context it is used -func (m *BaseEntity) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BaseEntity) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *BaseEntity) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BaseEntity) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BaseEntity) UnmarshalBinary(b []byte) error { - var res BaseEntity - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/ca_create.go b/rest_model/ca_create.go deleted file mode 100644 index 5b1c15395..000000000 --- a/rest_model/ca_create.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CaCreate A create Certificate Authority (CA) object -// -// swagger:model caCreate -type CaCreate struct { - - // cert pem - // Example: -----BEGIN CERTIFICATE-----\nMIICUjCCAdmgAwIBAgIJANooo7NB+dZZMAoGCCqGSM49BAMCMF4xCzAJBgNVBAYT\nAlVTMQswCQYDVQQIDAJOQzETMBEGA1UECgwKTmV0Rm91bmRyeTEtMCsGA1UEAwwk\nTmV0Rm91bmRyeSBaaXRpIEV4dGVybmFsIEFQSSBSb290IENBMB4XDTE4MTExNTEy\nNTcwOVoXDTM4MTExMDEyNTcwOVowXjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAk5D\nMRMwEQYDVQQKDApOZXRGb3VuZHJ5MS0wKwYDVQQDDCROZXRGb3VuZHJ5IFppdGkg\nRXh0ZXJuYWwgQVBJIFJvb3QgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARwq61Z\nIaqbaw0PDt3frJZaHjkxfZhwYrykI1GlbRNd/jix03lVG9qvpN5Og9fQfFFcFmD/\n3vCE9S6O0npm0mADQxcBcxbMRAH5dtBuCuiJW6qAAbPgiM32vqSxBiFt0KejYzBh\nMB0GA1UdDgQWBBRx1OVGuc/jdltDc8YBtkw8Tbr4fjAfBgNVHSMEGDAWgBRx1OVG\nuc/jdltDc8YBtkw8Tbr4fjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB\nhjAKBggqhkjOPQQDAgNnADBkAjBDRxNZUaIVpkQKnAgJukl3ysd3/i7Z6hDyIEms\nkllz/+ZvmdBp9iedV5o5BvJUggACMCv+UBFlJH7pmsOCo/F45Kk178YsCC7gaMxE\n1ZG1zveyMvsYsH04C9FndE6w2MLvlA==\n-----END CERTIFICATE-----\n - // Required: true - CertPem *string `json:"certPem"` - - // external Id claim - ExternalIDClaim *ExternalIDClaim `json:"externalIdClaim,omitempty"` - - // identity name format - IdentityNameFormat string `json:"identityNameFormat,omitempty"` - - // identity roles - // Required: true - IdentityRoles Roles `json:"identityRoles"` - - // is auth enabled - // Example: true - // Required: true - IsAuthEnabled *bool `json:"isAuthEnabled"` - - // is auto ca enrollment enabled - // Example: true - // Required: true - IsAutoCaEnrollmentEnabled *bool `json:"isAutoCaEnrollmentEnabled"` - - // is ott ca enrollment enabled - // Example: true - // Required: true - IsOttCaEnrollmentEnabled *bool `json:"isOttCaEnrollmentEnabled"` - - // name - // Example: Test 3rd Party External CA - // Required: true - Name *string `json:"name"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this ca create -func (m *CaCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertPem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalIDClaim(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAuthEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAutoCaEnrollmentEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsOttCaEnrollmentEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaCreate) validateCertPem(formats strfmt.Registry) error { - - if err := validate.Required("certPem", "body", m.CertPem); err != nil { - return err - } - - return nil -} - -func (m *CaCreate) validateExternalIDClaim(formats strfmt.Registry) error { - if swag.IsZero(m.ExternalIDClaim) { // not required - return nil - } - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaCreate) validateIdentityRoles(formats strfmt.Registry) error { - - if err := validate.Required("identityRoles", "body", m.IdentityRoles); err != nil { - return err - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaCreate) validateIsAuthEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isAuthEnabled", "body", m.IsAuthEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaCreate) validateIsAutoCaEnrollmentEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isAutoCaEnrollmentEnabled", "body", m.IsAutoCaEnrollmentEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaCreate) validateIsOttCaEnrollmentEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isOttCaEnrollmentEnabled", "body", m.IsOttCaEnrollmentEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CaCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this ca create based on the context it is used -func (m *CaCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExternalIDClaim(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaCreate) contextValidateExternalIDClaim(ctx context.Context, formats strfmt.Registry) error { - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaCreate) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CaCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CaCreate) UnmarshalBinary(b []byte) error { - var res CaCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/ca_detail.go b/rest_model/ca_detail.go deleted file mode 100644 index 92eb93562..000000000 --- a/rest_model/ca_detail.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CaDetail A Certificate Authority (CA) resource -// -// swagger:model caDetail -type CaDetail struct { - BaseEntity - - // cert pem - // Required: true - CertPem *string `json:"certPem"` - - // external Id claim - ExternalIDClaim *ExternalIDClaim `json:"externalIdClaim,omitempty"` - - // fingerprint - // Required: true - Fingerprint *string `json:"fingerprint"` - - // identity name format - // Required: true - IdentityNameFormat *string `json:"identityNameFormat"` - - // identity roles - // Required: true - IdentityRoles Roles `json:"identityRoles"` - - // is auth enabled - // Example: true - // Required: true - IsAuthEnabled *bool `json:"isAuthEnabled"` - - // is auto ca enrollment enabled - // Example: true - // Required: true - IsAutoCaEnrollmentEnabled *bool `json:"isAutoCaEnrollmentEnabled"` - - // is ott ca enrollment enabled - // Example: true - // Required: true - IsOttCaEnrollmentEnabled *bool `json:"isOttCaEnrollmentEnabled"` - - // is verified - // Example: false - // Required: true - IsVerified *bool `json:"isVerified"` - - // name - // Required: true - Name *string `json:"name"` - - // verification token - // Format: uuid - VerificationToken strfmt.UUID `json:"verificationToken,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *CaDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - CertPem *string `json:"certPem"` - - ExternalIDClaim *ExternalIDClaim `json:"externalIdClaim,omitempty"` - - Fingerprint *string `json:"fingerprint"` - - IdentityNameFormat *string `json:"identityNameFormat"` - - IdentityRoles Roles `json:"identityRoles"` - - IsAuthEnabled *bool `json:"isAuthEnabled"` - - IsAutoCaEnrollmentEnabled *bool `json:"isAutoCaEnrollmentEnabled"` - - IsOttCaEnrollmentEnabled *bool `json:"isOttCaEnrollmentEnabled"` - - IsVerified *bool `json:"isVerified"` - - Name *string `json:"name"` - - VerificationToken strfmt.UUID `json:"verificationToken,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.CertPem = dataAO1.CertPem - - m.ExternalIDClaim = dataAO1.ExternalIDClaim - - m.Fingerprint = dataAO1.Fingerprint - - m.IdentityNameFormat = dataAO1.IdentityNameFormat - - m.IdentityRoles = dataAO1.IdentityRoles - - m.IsAuthEnabled = dataAO1.IsAuthEnabled - - m.IsAutoCaEnrollmentEnabled = dataAO1.IsAutoCaEnrollmentEnabled - - m.IsOttCaEnrollmentEnabled = dataAO1.IsOttCaEnrollmentEnabled - - m.IsVerified = dataAO1.IsVerified - - m.Name = dataAO1.Name - - m.VerificationToken = dataAO1.VerificationToken - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m CaDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - CertPem *string `json:"certPem"` - - ExternalIDClaim *ExternalIDClaim `json:"externalIdClaim,omitempty"` - - Fingerprint *string `json:"fingerprint"` - - IdentityNameFormat *string `json:"identityNameFormat"` - - IdentityRoles Roles `json:"identityRoles"` - - IsAuthEnabled *bool `json:"isAuthEnabled"` - - IsAutoCaEnrollmentEnabled *bool `json:"isAutoCaEnrollmentEnabled"` - - IsOttCaEnrollmentEnabled *bool `json:"isOttCaEnrollmentEnabled"` - - IsVerified *bool `json:"isVerified"` - - Name *string `json:"name"` - - VerificationToken strfmt.UUID `json:"verificationToken,omitempty"` - } - - dataAO1.CertPem = m.CertPem - - dataAO1.ExternalIDClaim = m.ExternalIDClaim - - dataAO1.Fingerprint = m.Fingerprint - - dataAO1.IdentityNameFormat = m.IdentityNameFormat - - dataAO1.IdentityRoles = m.IdentityRoles - - dataAO1.IsAuthEnabled = m.IsAuthEnabled - - dataAO1.IsAutoCaEnrollmentEnabled = m.IsAutoCaEnrollmentEnabled - - dataAO1.IsOttCaEnrollmentEnabled = m.IsOttCaEnrollmentEnabled - - dataAO1.IsVerified = m.IsVerified - - dataAO1.Name = m.Name - - dataAO1.VerificationToken = m.VerificationToken - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this ca detail -func (m *CaDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertPem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalIDClaim(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFingerprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityNameFormat(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAuthEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAutoCaEnrollmentEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsOttCaEnrollmentEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsVerified(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationToken(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaDetail) validateCertPem(formats strfmt.Registry) error { - - if err := validate.Required("certPem", "body", m.CertPem); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateExternalIDClaim(formats strfmt.Registry) error { - - if swag.IsZero(m.ExternalIDClaim) { // not required - return nil - } - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaDetail) validateFingerprint(formats strfmt.Registry) error { - - if err := validate.Required("fingerprint", "body", m.Fingerprint); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateIdentityNameFormat(formats strfmt.Registry) error { - - if err := validate.Required("identityNameFormat", "body", m.IdentityNameFormat); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateIdentityRoles(formats strfmt.Registry) error { - - if err := validate.Required("identityRoles", "body", m.IdentityRoles); err != nil { - return err - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaDetail) validateIsAuthEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isAuthEnabled", "body", m.IsAuthEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateIsAutoCaEnrollmentEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isAutoCaEnrollmentEnabled", "body", m.IsAutoCaEnrollmentEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateIsOttCaEnrollmentEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isOttCaEnrollmentEnabled", "body", m.IsOttCaEnrollmentEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateIsVerified(formats strfmt.Registry) error { - - if err := validate.Required("isVerified", "body", m.IsVerified); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CaDetail) validateVerificationToken(formats strfmt.Registry) error { - - if swag.IsZero(m.VerificationToken) { // not required - return nil - } - - if err := validate.FormatOf("verificationToken", "body", "uuid", m.VerificationToken.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this ca detail based on the context it is used -func (m *CaDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExternalIDClaim(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaDetail) contextValidateExternalIDClaim(ctx context.Context, formats strfmt.Registry) error { - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaDetail) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CaDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CaDetail) UnmarshalBinary(b []byte) error { - var res CaDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/ca_list.go b/rest_model/ca_list.go deleted file mode 100644 index a5781c026..000000000 --- a/rest_model/ca_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CaList An array of Certificate Authority (CA) resources -// -// swagger:model caList -type CaList []*CaDetail - -// Validate validates this ca list -func (m CaList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this ca list based on the context it is used -func (m CaList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/ca_patch.go b/rest_model/ca_patch.go deleted file mode 100644 index 50d03d1a1..000000000 --- a/rest_model/ca_patch.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CaPatch ca patch -// -// swagger:model caPatch -type CaPatch struct { - - // external Id claim - ExternalIDClaim *ExternalIDClaimPatch `json:"externalIdClaim,omitempty"` - - // identity name format - IdentityNameFormat *string `json:"identityNameFormat,omitempty"` - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // is auth enabled - // Example: true - IsAuthEnabled *bool `json:"isAuthEnabled,omitempty"` - - // is auto ca enrollment enabled - // Example: true - IsAutoCaEnrollmentEnabled *bool `json:"isAutoCaEnrollmentEnabled,omitempty"` - - // is ott ca enrollment enabled - // Example: true - IsOttCaEnrollmentEnabled *bool `json:"isOttCaEnrollmentEnabled,omitempty"` - - // name - // Example: My CA - Name *string `json:"name,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this ca patch -func (m *CaPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExternalIDClaim(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaPatch) validateExternalIDClaim(formats strfmt.Registry) error { - if swag.IsZero(m.ExternalIDClaim) { // not required - return nil - } - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaPatch) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this ca patch based on the context it is used -func (m *CaPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExternalIDClaim(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaPatch) contextValidateExternalIDClaim(ctx context.Context, formats strfmt.Registry) error { - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaPatch) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CaPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CaPatch) UnmarshalBinary(b []byte) error { - var res CaPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/ca_update.go b/rest_model/ca_update.go deleted file mode 100644 index 4b8e21f48..000000000 --- a/rest_model/ca_update.go +++ /dev/null @@ -1,308 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CaUpdate ca update -// -// swagger:model caUpdate -type CaUpdate struct { - - // external Id claim - ExternalIDClaim *ExternalIDClaim `json:"externalIdClaim,omitempty"` - - // identity name format - // Required: true - IdentityNameFormat *string `json:"identityNameFormat"` - - // identity roles - // Required: true - IdentityRoles Roles `json:"identityRoles"` - - // is auth enabled - // Example: true - // Required: true - IsAuthEnabled *bool `json:"isAuthEnabled"` - - // is auto ca enrollment enabled - // Example: true - // Required: true - IsAutoCaEnrollmentEnabled *bool `json:"isAutoCaEnrollmentEnabled"` - - // is ott ca enrollment enabled - // Example: true - // Required: true - IsOttCaEnrollmentEnabled *bool `json:"isOttCaEnrollmentEnabled"` - - // name - // Example: My CA - // Required: true - Name *string `json:"name"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this ca update -func (m *CaUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExternalIDClaim(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityNameFormat(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAuthEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAutoCaEnrollmentEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsOttCaEnrollmentEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaUpdate) validateExternalIDClaim(formats strfmt.Registry) error { - if swag.IsZero(m.ExternalIDClaim) { // not required - return nil - } - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaUpdate) validateIdentityNameFormat(formats strfmt.Registry) error { - - if err := validate.Required("identityNameFormat", "body", m.IdentityNameFormat); err != nil { - return err - } - - return nil -} - -func (m *CaUpdate) validateIdentityRoles(formats strfmt.Registry) error { - - if err := validate.Required("identityRoles", "body", m.IdentityRoles); err != nil { - return err - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaUpdate) validateIsAuthEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isAuthEnabled", "body", m.IsAuthEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaUpdate) validateIsAutoCaEnrollmentEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isAutoCaEnrollmentEnabled", "body", m.IsAutoCaEnrollmentEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaUpdate) validateIsOttCaEnrollmentEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isOttCaEnrollmentEnabled", "body", m.IsOttCaEnrollmentEnabled); err != nil { - return err - } - - return nil -} - -func (m *CaUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CaUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this ca update based on the context it is used -func (m *CaUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateExternalIDClaim(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CaUpdate) contextValidateExternalIDClaim(ctx context.Context, formats strfmt.Registry) error { - - if m.ExternalIDClaim != nil { - if err := m.ExternalIDClaim.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("externalIdClaim") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("externalIdClaim") - } - return err - } - } - - return nil -} - -func (m *CaUpdate) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *CaUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CaUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CaUpdate) UnmarshalBinary(b []byte) error { - var res CaUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/client_external_jwt_signer_detail.go b/rest_model/client_external_jwt_signer_detail.go deleted file mode 100644 index 921b32e9f..000000000 --- a/rest_model/client_external_jwt_signer_detail.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ClientExternalJWTSignerDetail A External JWT Signer resource -// -// swagger:model clientExternalJwtSignerDetail -type ClientExternalJWTSignerDetail struct { - BaseEntity - - // external auth Url - // Required: true - ExternalAuthURL *string `json:"externalAuthUrl"` - - // name - // Example: MyApps Signer - // Required: true - Name *string `json:"name"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ClientExternalJWTSignerDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - ExternalAuthURL *string `json:"externalAuthUrl"` - - Name *string `json:"name"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.ExternalAuthURL = dataAO1.ExternalAuthURL - - m.Name = dataAO1.Name - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ClientExternalJWTSignerDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - ExternalAuthURL *string `json:"externalAuthUrl"` - - Name *string `json:"name"` - } - - dataAO1.ExternalAuthURL = m.ExternalAuthURL - - dataAO1.Name = m.Name - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this client external Jwt signer detail -func (m *ClientExternalJWTSignerDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalAuthURL(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClientExternalJWTSignerDetail) validateExternalAuthURL(formats strfmt.Registry) error { - - if err := validate.Required("externalAuthUrl", "body", m.ExternalAuthURL); err != nil { - return err - } - - return nil -} - -func (m *ClientExternalJWTSignerDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this client external Jwt signer detail based on the context it is used -func (m *ClientExternalJWTSignerDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ClientExternalJWTSignerDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClientExternalJWTSignerDetail) UnmarshalBinary(b []byte) error { - var res ClientExternalJWTSignerDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/client_external_jwt_signer_list.go b/rest_model/client_external_jwt_signer_list.go deleted file mode 100644 index d0b7f54cb..000000000 --- a/rest_model/client_external_jwt_signer_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ClientExternalJWTSignerList An array of External JWT Signers resources -// -// swagger:model clientExternalJwtSignerList -type ClientExternalJWTSignerList []*ClientExternalJWTSignerDetail - -// Validate validates this client external Jwt signer list -func (m ClientExternalJWTSignerList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this client external Jwt signer list based on the context it is used -func (m ClientExternalJWTSignerList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/common_edge_router_properties.go b/rest_model/common_edge_router_properties.go deleted file mode 100644 index c862e3e9a..000000000 --- a/rest_model/common_edge_router_properties.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CommonEdgeRouterProperties common edge router properties -// -// swagger:model commonEdgeRouterProperties -type CommonEdgeRouterProperties struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // cost - // Required: true - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost"` - - // hostname - // Required: true - Hostname *string `json:"hostname"` - - // is online - // Required: true - IsOnline *bool `json:"isOnline"` - - // name - // Required: true - Name *string `json:"name"` - - // no traversal - // Required: true - NoTraversal *bool `json:"noTraversal"` - - // supported protocols - // Required: true - SupportedProtocols map[string]string `json:"supportedProtocols"` - - // sync status - // Required: true - SyncStatus *string `json:"syncStatus"` -} - -// Validate validates this common edge router properties -func (m *CommonEdgeRouterProperties) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHostname(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsOnline(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNoTraversal(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSupportedProtocols(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSyncStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CommonEdgeRouterProperties) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateCost(formats strfmt.Registry) error { - - if err := validate.Required("cost", "body", m.Cost); err != nil { - return err - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateHostname(formats strfmt.Registry) error { - - if err := validate.Required("hostname", "body", m.Hostname); err != nil { - return err - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateIsOnline(formats strfmt.Registry) error { - - if err := validate.Required("isOnline", "body", m.IsOnline); err != nil { - return err - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateNoTraversal(formats strfmt.Registry) error { - - if err := validate.Required("noTraversal", "body", m.NoTraversal); err != nil { - return err - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateSupportedProtocols(formats strfmt.Registry) error { - - if err := validate.Required("supportedProtocols", "body", m.SupportedProtocols); err != nil { - return err - } - - return nil -} - -func (m *CommonEdgeRouterProperties) validateSyncStatus(formats strfmt.Registry) error { - - if err := validate.Required("syncStatus", "body", m.SyncStatus); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this common edge router properties based on the context it is used -func (m *CommonEdgeRouterProperties) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CommonEdgeRouterProperties) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CommonEdgeRouterProperties) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CommonEdgeRouterProperties) UnmarshalBinary(b []byte) error { - var res CommonEdgeRouterProperties - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_create.go b/rest_model/config_create.go deleted file mode 100644 index 06b7dcdcf..000000000 --- a/rest_model/config_create.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigCreate A config create object -// Example: {"configTypeId":"cea49285-6c07-42cf-9f52-09a9b115c783","data":{"hostname":"example.com","port":80},"name":"test-config"} -// -// swagger:model configCreate -type ConfigCreate struct { - - // The id of a config-type that the data section will match - // Required: true - ConfigTypeID *string `json:"configTypeId"` - - // Data payload is defined by the schema of the config-type defined in the type parameter - // Required: true - Data interface{} `json:"data"` - - // name - // Example: default.ziti-tunneler-server.v1 - // Required: true - Name *string `json:"name"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this config create -func (m *ConfigCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfigTypeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigCreate) validateConfigTypeID(formats strfmt.Registry) error { - - if err := validate.Required("configTypeId", "body", m.ConfigTypeID); err != nil { - return err - } - - return nil -} - -func (m *ConfigCreate) validateData(formats strfmt.Registry) error { - - if m.Data == nil { - return errors.Required("data", "body", nil) - } - - return nil -} - -func (m *ConfigCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ConfigCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config create based on the context it is used -func (m *ConfigCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigCreate) UnmarshalBinary(b []byte) error { - var res ConfigCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_detail.go b/rest_model/config_detail.go deleted file mode 100644 index 586a7e413..000000000 --- a/rest_model/config_detail.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigDetail A config resource -// -// swagger:model configDetail -type ConfigDetail struct { - BaseEntity - - // config type - // Required: true - ConfigType *EntityRef `json:"configType"` - - // config type Id - // Required: true - ConfigTypeID *string `json:"configTypeId"` - - // The data section of a config is based on the schema of its type - // Required: true - Data interface{} `json:"data"` - - // name - // Required: true - Name *string `json:"name"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ConfigDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - ConfigType *EntityRef `json:"configType"` - - ConfigTypeID *string `json:"configTypeId"` - - Data interface{} `json:"data"` - - Name *string `json:"name"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.ConfigType = dataAO1.ConfigType - - m.ConfigTypeID = dataAO1.ConfigTypeID - - m.Data = dataAO1.Data - - m.Name = dataAO1.Name - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ConfigDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - ConfigType *EntityRef `json:"configType"` - - ConfigTypeID *string `json:"configTypeId"` - - Data interface{} `json:"data"` - - Name *string `json:"name"` - } - - dataAO1.ConfigType = m.ConfigType - - dataAO1.ConfigTypeID = m.ConfigTypeID - - dataAO1.Data = m.Data - - dataAO1.Name = m.Name - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this config detail -func (m *ConfigDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigTypeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigDetail) validateConfigType(formats strfmt.Registry) error { - - if err := validate.Required("configType", "body", m.ConfigType); err != nil { - return err - } - - if m.ConfigType != nil { - if err := m.ConfigType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("configType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("configType") - } - return err - } - } - - return nil -} - -func (m *ConfigDetail) validateConfigTypeID(formats strfmt.Registry) error { - - if err := validate.Required("configTypeId", "body", m.ConfigTypeID); err != nil { - return err - } - - return nil -} - -func (m *ConfigDetail) validateData(formats strfmt.Registry) error { - - if m.Data == nil { - return errors.Required("data", "body", nil) - } - - return nil -} - -func (m *ConfigDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this config detail based on the context it is used -func (m *ConfigDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateConfigType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigDetail) contextValidateConfigType(ctx context.Context, formats strfmt.Registry) error { - - if m.ConfigType != nil { - if err := m.ConfigType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("configType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("configType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigDetail) UnmarshalBinary(b []byte) error { - var res ConfigDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_list.go b/rest_model/config_list.go deleted file mode 100644 index 24dcf29db..000000000 --- a/rest_model/config_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ConfigList An array of config resources -// -// swagger:model configList -type ConfigList []*ConfigDetail - -// Validate validates this config list -func (m ConfigList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this config list based on the context it is used -func (m ConfigList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/config_patch.go b/rest_model/config_patch.go deleted file mode 100644 index 6be495e3b..000000000 --- a/rest_model/config_patch.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ConfigPatch A config patch object -// Example: {"data":{"hostname":"example.com","port":80},"name":"example-config-name"} -// -// swagger:model configPatch -type ConfigPatch struct { - - // Data payload is defined by the schema of the config-type defined in the type parameter - Data interface{} `json:"data,omitempty"` - - // name - // Example: default.ziti-tunneler-server.v1 - Name string `json:"name,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this config patch -func (m *ConfigPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config patch based on the context it is used -func (m *ConfigPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigPatch) UnmarshalBinary(b []byte) error { - var res ConfigPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_type_create.go b/rest_model/config_type_create.go deleted file mode 100644 index 592fa30bb..000000000 --- a/rest_model/config_type_create.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigTypeCreate A config-type create object -// -// swagger:model configTypeCreate -type ConfigTypeCreate struct { - - // name - // Example: ziti-tunneler-server.v1 - // Required: true - Name *string `json:"name"` - - // A JSON schema to enforce configuration against - Schema interface{} `json:"schema,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this config type create -func (m *ConfigTypeCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypeCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ConfigTypeCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config type create based on the context it is used -func (m *ConfigTypeCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypeCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigTypeCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigTypeCreate) UnmarshalBinary(b []byte) error { - var res ConfigTypeCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_type_detail.go b/rest_model/config_type_detail.go deleted file mode 100644 index 2a600d173..000000000 --- a/rest_model/config_type_detail.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigTypeDetail A config-type resource -// -// swagger:model configTypeDetail -type ConfigTypeDetail struct { - BaseEntity - - // name - // Example: ziti-tunneler-server.v1 - // Required: true - Name *string `json:"name"` - - // A JSON schema to enforce configuration against - // Required: true - Schema interface{} `json:"schema"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ConfigTypeDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Name *string `json:"name"` - - Schema interface{} `json:"schema"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Name = dataAO1.Name - - m.Schema = dataAO1.Schema - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ConfigTypeDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Name *string `json:"name"` - - Schema interface{} `json:"schema"` - } - - dataAO1.Name = m.Name - - dataAO1.Schema = m.Schema - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this config type detail -func (m *ConfigTypeDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSchema(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypeDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ConfigTypeDetail) validateSchema(formats strfmt.Registry) error { - - if m.Schema == nil { - return errors.Required("schema", "body", nil) - } - - return nil -} - -// ContextValidate validate this config type detail based on the context it is used -func (m *ConfigTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigTypeDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigTypeDetail) UnmarshalBinary(b []byte) error { - var res ConfigTypeDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_type_list.go b/rest_model/config_type_list.go deleted file mode 100644 index a80068113..000000000 --- a/rest_model/config_type_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ConfigTypeList An array of config-type resources -// -// swagger:model configTypeList -type ConfigTypeList []*ConfigTypeDetail - -// Validate validates this config type list -func (m ConfigTypeList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this config type list based on the context it is used -func (m ConfigTypeList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/config_type_patch.go b/rest_model/config_type_patch.go deleted file mode 100644 index 93993a3e9..000000000 --- a/rest_model/config_type_patch.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ConfigTypePatch A config-type patch object -// -// swagger:model configTypePatch -type ConfigTypePatch struct { - - // name - // Example: ziti-tunneler-server.v1 - Name string `json:"name,omitempty"` - - // A JSON schema to enforce configuration against - Schema interface{} `json:"schema,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this config type patch -func (m *ConfigTypePatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypePatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config type patch based on the context it is used -func (m *ConfigTypePatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypePatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigTypePatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigTypePatch) UnmarshalBinary(b []byte) error { - var res ConfigTypePatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_type_update.go b/rest_model/config_type_update.go deleted file mode 100644 index db54a9917..000000000 --- a/rest_model/config_type_update.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigTypeUpdate A config-type update object -// -// swagger:model configTypeUpdate -type ConfigTypeUpdate struct { - - // name - // Example: ziti-tunneler-server.v1 - // Required: true - Name *string `json:"name"` - - // A JSON schema to enforce configuration against - Schema interface{} `json:"schema,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this config type update -func (m *ConfigTypeUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypeUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ConfigTypeUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config type update based on the context it is used -func (m *ConfigTypeUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigTypeUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigTypeUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigTypeUpdate) UnmarshalBinary(b []byte) error { - var res ConfigTypeUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/config_types.go b/rest_model/config_types.go deleted file mode 100644 index 24f85d38d..000000000 --- a/rest_model/config_types.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// ConfigTypes Specific configuration types that should be returned -// -// swagger:model configTypes -type ConfigTypes []string - -// Validate validates this config types -func (m ConfigTypes) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this config types based on context it is used -func (m ConfigTypes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/config_update.go b/rest_model/config_update.go deleted file mode 100644 index 4be01689d..000000000 --- a/rest_model/config_update.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ConfigUpdate A config update object -// Example: {"data":{"hostname":"example.com","port":80},"name":"example-config-name"} -// -// swagger:model configUpdate -type ConfigUpdate struct { - - // Data payload is defined by the schema of the config-type defined in the type parameter - // Required: true - Data interface{} `json:"data"` - - // name - // Example: default.ziti-tunneler-server.v1 - // Required: true - Name *string `json:"name"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this config update -func (m *ConfigUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigUpdate) validateData(formats strfmt.Registry) error { - - if m.Data == nil { - return errors.Required("data", "body", nil) - } - - return nil -} - -func (m *ConfigUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ConfigUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this config update based on the context it is used -func (m *ConfigUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ConfigUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ConfigUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ConfigUpdate) UnmarshalBinary(b []byte) error { - var res ConfigUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/create_current_api_session_certificate_envelope.go b/rest_model/create_current_api_session_certificate_envelope.go deleted file mode 100644 index f5c4eedd9..000000000 --- a/rest_model/create_current_api_session_certificate_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateCurrentAPISessionCertificateEnvelope create current Api session certificate envelope -// -// swagger:model createCurrentApiSessionCertificateEnvelope -type CreateCurrentAPISessionCertificateEnvelope struct { - - // data - // Required: true - Data *CurrentAPISessionCertificateCreateResponse `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this create current Api session certificate envelope -func (m *CreateCurrentAPISessionCertificateEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateCurrentAPISessionCertificateEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CreateCurrentAPISessionCertificateEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create current Api session certificate envelope based on the context it is used -func (m *CreateCurrentAPISessionCertificateEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateCurrentAPISessionCertificateEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CreateCurrentAPISessionCertificateEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateCurrentAPISessionCertificateEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateCurrentAPISessionCertificateEnvelope) UnmarshalBinary(b []byte) error { - var res CreateCurrentAPISessionCertificateEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/create_envelope.go b/rest_model/create_envelope.go deleted file mode 100644 index 8a0280a65..000000000 --- a/rest_model/create_envelope.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CreateEnvelope create envelope -// -// swagger:model createEnvelope -type CreateEnvelope struct { - - // data - Data *CreateLocation `json:"data,omitempty"` - - // meta - Meta *Meta `json:"meta,omitempty"` -} - -// Validate validates this create envelope -func (m *CreateEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CreateEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create envelope based on the context it is used -func (m *CreateEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CreateEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateEnvelope) UnmarshalBinary(b []byte) error { - var res CreateEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/create_location.go b/rest_model/create_location.go deleted file mode 100644 index 0cb5bec49..000000000 --- a/rest_model/create_location.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CreateLocation create location -// -// swagger:model createLocation -type CreateLocation struct { - - // links - Links Links `json:"_links"` - - // id - ID string `json:"id,omitempty"` -} - -// Validate validates this create location -func (m *CreateLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateLocation) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required - return nil - } - - if m.Links != nil { - if err := m.Links.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create location based on the context it is used -func (m *CreateLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateLocation) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateLocation) UnmarshalBinary(b []byte) error { - var res CreateLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_api_session_certificate_create.go b/rest_model/current_api_session_certificate_create.go deleted file mode 100644 index 7f37c03cf..000000000 --- a/rest_model/current_api_session_certificate_create.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentAPISessionCertificateCreate current Api session certificate create -// -// swagger:model currentApiSessionCertificateCreate -type CurrentAPISessionCertificateCreate struct { - - // csr - // Required: true - Csr *string `json:"csr"` -} - -// Validate validates this current Api session certificate create -func (m *CurrentAPISessionCertificateCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCsr(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionCertificateCreate) validateCsr(formats strfmt.Registry) error { - - if err := validate.Required("csr", "body", m.Csr); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this current Api session certificate create based on context it is used -func (m *CurrentAPISessionCertificateCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentAPISessionCertificateCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentAPISessionCertificateCreate) UnmarshalBinary(b []byte) error { - var res CurrentAPISessionCertificateCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_api_session_certificate_create_response.go b/rest_model/current_api_session_certificate_create_response.go deleted file mode 100644 index a8de730bc..000000000 --- a/rest_model/current_api_session_certificate_create_response.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentAPISessionCertificateCreateResponse current Api session certificate create response -// -// swagger:model currentApiSessionCertificateCreateResponse -type CurrentAPISessionCertificateCreateResponse struct { - CreateLocation - - // cas - Cas string `json:"cas,omitempty"` - - // certificate - // Required: true - Certificate *string `json:"certificate"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *CurrentAPISessionCertificateCreateResponse) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CreateLocation - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CreateLocation = aO0 - - // AO1 - var dataAO1 struct { - Cas string `json:"cas,omitempty"` - - Certificate *string `json:"certificate"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Cas = dataAO1.Cas - - m.Certificate = dataAO1.Certificate - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m CurrentAPISessionCertificateCreateResponse) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.CreateLocation) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Cas string `json:"cas,omitempty"` - - Certificate *string `json:"certificate"` - } - - dataAO1.Cas = m.Cas - - dataAO1.Certificate = m.Certificate - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this current Api session certificate create response -func (m *CurrentAPISessionCertificateCreateResponse) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CreateLocation - if err := m.CreateLocation.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertificate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionCertificateCreateResponse) validateCertificate(formats strfmt.Registry) error { - - if err := validate.Required("certificate", "body", m.Certificate); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this current Api session certificate create response based on the context it is used -func (m *CurrentAPISessionCertificateCreateResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CreateLocation - if err := m.CreateLocation.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentAPISessionCertificateCreateResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentAPISessionCertificateCreateResponse) UnmarshalBinary(b []byte) error { - var res CurrentAPISessionCertificateCreateResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_api_session_certificate_detail.go b/rest_model/current_api_session_certificate_detail.go deleted file mode 100644 index 427d75fe3..000000000 --- a/rest_model/current_api_session_certificate_detail.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentAPISessionCertificateDetail current Api session certificate detail -// -// swagger:model currentApiSessionCertificateDetail -type CurrentAPISessionCertificateDetail struct { - BaseEntity - - // certificate - // Required: true - Certificate *string `json:"certificate"` - - // fingerprint - // Required: true - Fingerprint *string `json:"fingerprint"` - - // subject - // Required: true - Subject *string `json:"subject"` - - // valid from - // Required: true - // Format: date-time - ValidFrom *strfmt.DateTime `json:"validFrom"` - - // valid to - // Required: true - // Format: date-time - ValidTo *strfmt.DateTime `json:"validTo"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *CurrentAPISessionCertificateDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Certificate *string `json:"certificate"` - - Fingerprint *string `json:"fingerprint"` - - Subject *string `json:"subject"` - - ValidFrom *strfmt.DateTime `json:"validFrom"` - - ValidTo *strfmt.DateTime `json:"validTo"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Certificate = dataAO1.Certificate - - m.Fingerprint = dataAO1.Fingerprint - - m.Subject = dataAO1.Subject - - m.ValidFrom = dataAO1.ValidFrom - - m.ValidTo = dataAO1.ValidTo - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m CurrentAPISessionCertificateDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Certificate *string `json:"certificate"` - - Fingerprint *string `json:"fingerprint"` - - Subject *string `json:"subject"` - - ValidFrom *strfmt.DateTime `json:"validFrom"` - - ValidTo *strfmt.DateTime `json:"validTo"` - } - - dataAO1.Certificate = m.Certificate - - dataAO1.Fingerprint = m.Fingerprint - - dataAO1.Subject = m.Subject - - dataAO1.ValidFrom = m.ValidFrom - - dataAO1.ValidTo = m.ValidTo - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this current Api session certificate detail -func (m *CurrentAPISessionCertificateDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertificate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFingerprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubject(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValidFrom(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValidTo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionCertificateDetail) validateCertificate(formats strfmt.Registry) error { - - if err := validate.Required("certificate", "body", m.Certificate); err != nil { - return err - } - - return nil -} - -func (m *CurrentAPISessionCertificateDetail) validateFingerprint(formats strfmt.Registry) error { - - if err := validate.Required("fingerprint", "body", m.Fingerprint); err != nil { - return err - } - - return nil -} - -func (m *CurrentAPISessionCertificateDetail) validateSubject(formats strfmt.Registry) error { - - if err := validate.Required("subject", "body", m.Subject); err != nil { - return err - } - - return nil -} - -func (m *CurrentAPISessionCertificateDetail) validateValidFrom(formats strfmt.Registry) error { - - if err := validate.Required("validFrom", "body", m.ValidFrom); err != nil { - return err - } - - if err := validate.FormatOf("validFrom", "body", "date-time", m.ValidFrom.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CurrentAPISessionCertificateDetail) validateValidTo(formats strfmt.Registry) error { - - if err := validate.Required("validTo", "body", m.ValidTo); err != nil { - return err - } - - if err := validate.FormatOf("validTo", "body", "date-time", m.ValidTo.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this current Api session certificate detail based on the context it is used -func (m *CurrentAPISessionCertificateDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentAPISessionCertificateDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentAPISessionCertificateDetail) UnmarshalBinary(b []byte) error { - var res CurrentAPISessionCertificateDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_api_session_certificate_list.go b/rest_model/current_api_session_certificate_list.go deleted file mode 100644 index 67a52a3ba..000000000 --- a/rest_model/current_api_session_certificate_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CurrentAPISessionCertificateList current Api session certificate list -// -// swagger:model currentApiSessionCertificateList -type CurrentAPISessionCertificateList []*CurrentAPISessionCertificateDetail - -// Validate validates this current Api session certificate list -func (m CurrentAPISessionCertificateList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this current Api session certificate list based on the context it is used -func (m CurrentAPISessionCertificateList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/current_api_session_detail.go b/rest_model/current_api_session_detail.go deleted file mode 100644 index ce61c6d6b..000000000 --- a/rest_model/current_api_session_detail.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentAPISessionDetail An API Session object for the current API session -// -// swagger:model currentApiSessionDetail -type CurrentAPISessionDetail struct { - APISessionDetail - - // expiration seconds - // Required: true - ExpirationSeconds *int64 `json:"expirationSeconds"` - - // expires at - // Required: true - // Format: date-time - ExpiresAt *strfmt.DateTime `json:"expiresAt"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *CurrentAPISessionDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 APISessionDetail - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.APISessionDetail = aO0 - - // AO1 - var dataAO1 struct { - ExpirationSeconds *int64 `json:"expirationSeconds"` - - ExpiresAt *strfmt.DateTime `json:"expiresAt"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.ExpirationSeconds = dataAO1.ExpirationSeconds - - m.ExpiresAt = dataAO1.ExpiresAt - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m CurrentAPISessionDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.APISessionDetail) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - ExpirationSeconds *int64 `json:"expirationSeconds"` - - ExpiresAt *strfmt.DateTime `json:"expiresAt"` - } - - dataAO1.ExpirationSeconds = m.ExpirationSeconds - - dataAO1.ExpiresAt = m.ExpiresAt - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this current Api session detail -func (m *CurrentAPISessionDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with APISessionDetail - if err := m.APISessionDetail.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpirationSeconds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionDetail) validateExpirationSeconds(formats strfmt.Registry) error { - - if err := validate.Required("expirationSeconds", "body", m.ExpirationSeconds); err != nil { - return err - } - - return nil -} - -func (m *CurrentAPISessionDetail) validateExpiresAt(formats strfmt.Registry) error { - - if err := validate.Required("expiresAt", "body", m.ExpiresAt); err != nil { - return err - } - - if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this current Api session detail based on the context it is used -func (m *CurrentAPISessionDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with APISessionDetail - if err := m.APISessionDetail.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentAPISessionDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentAPISessionDetail) UnmarshalBinary(b []byte) error { - var res CurrentAPISessionDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_api_session_detail_envelope.go b/rest_model/current_api_session_detail_envelope.go deleted file mode 100644 index 590b3915b..000000000 --- a/rest_model/current_api_session_detail_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentAPISessionDetailEnvelope current Api session detail envelope -// -// swagger:model currentApiSessionDetailEnvelope -type CurrentAPISessionDetailEnvelope struct { - - // data - // Required: true - Data *CurrentAPISessionDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this current Api session detail envelope -func (m *CurrentAPISessionDetailEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionDetailEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CurrentAPISessionDetailEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this current Api session detail envelope based on the context it is used -func (m *CurrentAPISessionDetailEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionDetailEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CurrentAPISessionDetailEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentAPISessionDetailEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentAPISessionDetailEnvelope) UnmarshalBinary(b []byte) error { - var res CurrentAPISessionDetailEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_api_session_service_update_list.go b/rest_model/current_api_session_service_update_list.go deleted file mode 100644 index a17943baa..000000000 --- a/rest_model/current_api_session_service_update_list.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentAPISessionServiceUpdateList current Api session service update list -// -// swagger:model currentApiSessionServiceUpdateList -type CurrentAPISessionServiceUpdateList struct { - - // last change at - // Required: true - // Format: date-time - LastChangeAt *strfmt.DateTime `json:"lastChangeAt"` -} - -// Validate validates this current Api session service update list -func (m *CurrentAPISessionServiceUpdateList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLastChangeAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentAPISessionServiceUpdateList) validateLastChangeAt(formats strfmt.Registry) error { - - if err := validate.Required("lastChangeAt", "body", m.LastChangeAt); err != nil { - return err - } - - if err := validate.FormatOf("lastChangeAt", "body", "date-time", m.LastChangeAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this current Api session service update list based on context it is used -func (m *CurrentAPISessionServiceUpdateList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentAPISessionServiceUpdateList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentAPISessionServiceUpdateList) UnmarshalBinary(b []byte) error { - var res CurrentAPISessionServiceUpdateList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_identity_detail_envelope.go b/rest_model/current_identity_detail_envelope.go deleted file mode 100644 index d92e2bceb..000000000 --- a/rest_model/current_identity_detail_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CurrentIdentityDetailEnvelope current identity detail envelope -// -// swagger:model currentIdentityDetailEnvelope -type CurrentIdentityDetailEnvelope struct { - - // data - // Required: true - Data *IdentityDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this current identity detail envelope -func (m *CurrentIdentityDetailEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentIdentityDetailEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CurrentIdentityDetailEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this current identity detail envelope based on the context it is used -func (m *CurrentIdentityDetailEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CurrentIdentityDetailEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *CurrentIdentityDetailEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentIdentityDetailEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentIdentityDetailEnvelope) UnmarshalBinary(b []byte) error { - var res CurrentIdentityDetailEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_identity_edge_router_detail.go b/rest_model/current_identity_edge_router_detail.go deleted file mode 100644 index 408ab34f9..000000000 --- a/rest_model/current_identity_edge_router_detail.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CurrentIdentityEdgeRouterDetail A detail edge router resource -// -// swagger:model currentIdentityEdgeRouterDetail -type CurrentIdentityEdgeRouterDetail struct { - BaseEntity - - CommonEdgeRouterProperties -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *CurrentIdentityEdgeRouterDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var aO1 CommonEdgeRouterProperties - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.CommonEdgeRouterProperties = aO1 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m CurrentIdentityEdgeRouterDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.CommonEdgeRouterProperties) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this current identity edge router detail -func (m *CurrentIdentityEdgeRouterDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - // validation for a type composition with CommonEdgeRouterProperties - if err := m.CommonEdgeRouterProperties.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this current identity edge router detail based on the context it is used -func (m *CurrentIdentityEdgeRouterDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - // validation for a type composition with CommonEdgeRouterProperties - if err := m.CommonEdgeRouterProperties.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *CurrentIdentityEdgeRouterDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CurrentIdentityEdgeRouterDetail) UnmarshalBinary(b []byte) error { - var res CurrentIdentityEdgeRouterDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/current_identity_edge_router_list.go b/rest_model/current_identity_edge_router_list.go deleted file mode 100644 index 648e38f51..000000000 --- a/rest_model/current_identity_edge_router_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CurrentIdentityEdgeRouterList A list of edge router resources -// -// swagger:model currentIdentityEdgeRouterList -type CurrentIdentityEdgeRouterList []*CurrentIdentityEdgeRouterDetail - -// Validate validates this current identity edge router list -func (m CurrentIdentityEdgeRouterList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this current identity edge router list based on the context it is used -func (m CurrentIdentityEdgeRouterList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/data_integrity_check_detail.go b/rest_model/data_integrity_check_detail.go deleted file mode 100644 index 04f765f88..000000000 --- a/rest_model/data_integrity_check_detail.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DataIntegrityCheckDetail data integrity check detail -// -// swagger:model dataIntegrityCheckDetail -type DataIntegrityCheckDetail struct { - - // description - // Required: true - Description *string `json:"description"` - - // fixed - // Required: true - Fixed *bool `json:"fixed"` -} - -// Validate validates this data integrity check detail -func (m *DataIntegrityCheckDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFixed(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DataIntegrityCheckDetail) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetail) validateFixed(formats strfmt.Registry) error { - - if err := validate.Required("fixed", "body", m.Fixed); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this data integrity check detail based on context it is used -func (m *DataIntegrityCheckDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DataIntegrityCheckDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DataIntegrityCheckDetail) UnmarshalBinary(b []byte) error { - var res DataIntegrityCheckDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/data_integrity_check_detail_list.go b/rest_model/data_integrity_check_detail_list.go deleted file mode 100644 index ed0e94b84..000000000 --- a/rest_model/data_integrity_check_detail_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DataIntegrityCheckDetailList data integrity check detail list -// -// swagger:model dataIntegrityCheckDetailList -type DataIntegrityCheckDetailList []*DataIntegrityCheckDetail - -// Validate validates this data integrity check detail list -func (m DataIntegrityCheckDetailList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this data integrity check detail list based on the context it is used -func (m DataIntegrityCheckDetailList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/data_integrity_check_details.go b/rest_model/data_integrity_check_details.go deleted file mode 100644 index aa80d1dd8..000000000 --- a/rest_model/data_integrity_check_details.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DataIntegrityCheckDetails data integrity check details -// -// swagger:model dataIntegrityCheckDetails -type DataIntegrityCheckDetails struct { - - // end time - // Required: true - // Format: date-time - EndTime *strfmt.DateTime `json:"endTime"` - - // error - // Required: true - Error *string `json:"error"` - - // fixing errors - // Required: true - FixingErrors *bool `json:"fixingErrors"` - - // in progress - // Required: true - InProgress *bool `json:"inProgress"` - - // results - // Required: true - Results DataIntegrityCheckDetailList `json:"results"` - - // start time - // Required: true - // Format: date-time - StartTime *strfmt.DateTime `json:"startTime"` - - // too many errors - // Required: true - TooManyErrors *bool `json:"tooManyErrors"` -} - -// Validate validates this data integrity check details -func (m *DataIntegrityCheckDetails) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEndTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateError(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFixingErrors(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInProgress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStartTime(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTooManyErrors(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DataIntegrityCheckDetails) validateEndTime(formats strfmt.Registry) error { - - if err := validate.Required("endTime", "body", m.EndTime); err != nil { - return err - } - - if err := validate.FormatOf("endTime", "body", "date-time", m.EndTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetails) validateError(formats strfmt.Registry) error { - - if err := validate.Required("error", "body", m.Error); err != nil { - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetails) validateFixingErrors(formats strfmt.Registry) error { - - if err := validate.Required("fixingErrors", "body", m.FixingErrors); err != nil { - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetails) validateInProgress(formats strfmt.Registry) error { - - if err := validate.Required("inProgress", "body", m.InProgress); err != nil { - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetails) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("results") - } - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetails) validateStartTime(formats strfmt.Registry) error { - - if err := validate.Required("startTime", "body", m.StartTime); err != nil { - return err - } - - if err := validate.FormatOf("startTime", "body", "date-time", m.StartTime.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DataIntegrityCheckDetails) validateTooManyErrors(formats strfmt.Registry) error { - - if err := validate.Required("tooManyErrors", "body", m.TooManyErrors); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this data integrity check details based on the context it is used -func (m *DataIntegrityCheckDetails) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateResults(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DataIntegrityCheckDetails) contextValidateResults(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Results.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DataIntegrityCheckDetails) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DataIntegrityCheckDetails) UnmarshalBinary(b []byte) error { - var res DataIntegrityCheckDetails - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/data_integrity_check_result_envelope.go b/rest_model/data_integrity_check_result_envelope.go deleted file mode 100644 index 40a707566..000000000 --- a/rest_model/data_integrity_check_result_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DataIntegrityCheckResultEnvelope data integrity check result envelope -// -// swagger:model dataIntegrityCheckResultEnvelope -type DataIntegrityCheckResultEnvelope struct { - - // data - // Required: true - Data *DataIntegrityCheckDetails `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this data integrity check result envelope -func (m *DataIntegrityCheckResultEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DataIntegrityCheckResultEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DataIntegrityCheckResultEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this data integrity check result envelope based on the context it is used -func (m *DataIntegrityCheckResultEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DataIntegrityCheckResultEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DataIntegrityCheckResultEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DataIntegrityCheckResultEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DataIntegrityCheckResultEnvelope) UnmarshalBinary(b []byte) error { - var res DataIntegrityCheckResultEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_api_session_envelope.go b/rest_model/detail_api_session_envelope.go deleted file mode 100644 index 69b149d8c..000000000 --- a/rest_model/detail_api_session_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailAPISessionEnvelope detail Api session envelope -// -// swagger:model detailApiSessionEnvelope -type DetailAPISessionEnvelope struct { - - // data - // Required: true - Data *APISessionDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail Api session envelope -func (m *DetailAPISessionEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailAPISessionEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailAPISessionEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail Api session envelope based on the context it is used -func (m *DetailAPISessionEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailAPISessionEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailAPISessionEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailAPISessionEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailAPISessionEnvelope) UnmarshalBinary(b []byte) error { - var res DetailAPISessionEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_auth_policy_envelope.go b/rest_model/detail_auth_policy_envelope.go deleted file mode 100644 index 53efaf9a5..000000000 --- a/rest_model/detail_auth_policy_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailAuthPolicyEnvelope detail auth policy envelope -// -// swagger:model detailAuthPolicyEnvelope -type DetailAuthPolicyEnvelope struct { - - // data - // Required: true - Data *AuthPolicyDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail auth policy envelope -func (m *DetailAuthPolicyEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailAuthPolicyEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailAuthPolicyEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail auth policy envelope based on the context it is used -func (m *DetailAuthPolicyEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailAuthPolicyEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailAuthPolicyEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailAuthPolicyEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailAuthPolicyEnvelope) UnmarshalBinary(b []byte) error { - var res DetailAuthPolicyEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_authenticator_envelope.go b/rest_model/detail_authenticator_envelope.go deleted file mode 100644 index 186cd60f7..000000000 --- a/rest_model/detail_authenticator_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailAuthenticatorEnvelope detail authenticator envelope -// -// swagger:model detailAuthenticatorEnvelope -type DetailAuthenticatorEnvelope struct { - - // data - // Required: true - Data *AuthenticatorDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail authenticator envelope -func (m *DetailAuthenticatorEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailAuthenticatorEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailAuthenticatorEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail authenticator envelope based on the context it is used -func (m *DetailAuthenticatorEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailAuthenticatorEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailAuthenticatorEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailAuthenticatorEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailAuthenticatorEnvelope) UnmarshalBinary(b []byte) error { - var res DetailAuthenticatorEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_ca_envelope.go b/rest_model/detail_ca_envelope.go deleted file mode 100644 index 0fd9ceba0..000000000 --- a/rest_model/detail_ca_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailCaEnvelope detail ca envelope -// -// swagger:model detailCaEnvelope -type DetailCaEnvelope struct { - - // data - // Required: true - Data *CaDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail ca envelope -func (m *DetailCaEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailCaEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailCaEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail ca envelope based on the context it is used -func (m *DetailCaEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailCaEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailCaEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailCaEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailCaEnvelope) UnmarshalBinary(b []byte) error { - var res DetailCaEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_config_envelope.go b/rest_model/detail_config_envelope.go deleted file mode 100644 index 54c1054ad..000000000 --- a/rest_model/detail_config_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailConfigEnvelope detail config envelope -// -// swagger:model detailConfigEnvelope -type DetailConfigEnvelope struct { - - // data - // Required: true - Data *ConfigDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail config envelope -func (m *DetailConfigEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailConfigEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailConfigEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail config envelope based on the context it is used -func (m *DetailConfigEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailConfigEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailConfigEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailConfigEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailConfigEnvelope) UnmarshalBinary(b []byte) error { - var res DetailConfigEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_config_type_envelope.go b/rest_model/detail_config_type_envelope.go deleted file mode 100644 index deeb8855a..000000000 --- a/rest_model/detail_config_type_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailConfigTypeEnvelope detail config type envelope -// -// swagger:model detailConfigTypeEnvelope -type DetailConfigTypeEnvelope struct { - - // data - // Required: true - Data *ConfigTypeDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail config type envelope -func (m *DetailConfigTypeEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailConfigTypeEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailConfigTypeEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail config type envelope based on the context it is used -func (m *DetailConfigTypeEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailConfigTypeEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailConfigTypeEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailConfigTypeEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailConfigTypeEnvelope) UnmarshalBinary(b []byte) error { - var res DetailConfigTypeEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_current_api_session_certificate_envelope.go b/rest_model/detail_current_api_session_certificate_envelope.go deleted file mode 100644 index 339d8b70b..000000000 --- a/rest_model/detail_current_api_session_certificate_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailCurrentAPISessionCertificateEnvelope detail current Api session certificate envelope -// -// swagger:model detailCurrentApiSessionCertificateEnvelope -type DetailCurrentAPISessionCertificateEnvelope struct { - - // data - // Required: true - Data *CurrentAPISessionCertificateDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail current Api session certificate envelope -func (m *DetailCurrentAPISessionCertificateEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailCurrentAPISessionCertificateEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailCurrentAPISessionCertificateEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail current Api session certificate envelope based on the context it is used -func (m *DetailCurrentAPISessionCertificateEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailCurrentAPISessionCertificateEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailCurrentAPISessionCertificateEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailCurrentAPISessionCertificateEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailCurrentAPISessionCertificateEnvelope) UnmarshalBinary(b []byte) error { - var res DetailCurrentAPISessionCertificateEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_edge_router_policy_envelope.go b/rest_model/detail_edge_router_policy_envelope.go deleted file mode 100644 index 4b3cba7f7..000000000 --- a/rest_model/detail_edge_router_policy_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailEdgeRouterPolicyEnvelope detail edge router policy envelope -// -// swagger:model detailEdgeRouterPolicyEnvelope -type DetailEdgeRouterPolicyEnvelope struct { - - // data - // Required: true - Data *EdgeRouterPolicyDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail edge router policy envelope -func (m *DetailEdgeRouterPolicyEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailEdgeRouterPolicyEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailEdgeRouterPolicyEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail edge router policy envelope based on the context it is used -func (m *DetailEdgeRouterPolicyEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailEdgeRouterPolicyEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailEdgeRouterPolicyEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailEdgeRouterPolicyEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailEdgeRouterPolicyEnvelope) UnmarshalBinary(b []byte) error { - var res DetailEdgeRouterPolicyEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_enrollment_envelope.go b/rest_model/detail_enrollment_envelope.go deleted file mode 100644 index 9c20bc833..000000000 --- a/rest_model/detail_enrollment_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailEnrollmentEnvelope detail enrollment envelope -// -// swagger:model detailEnrollmentEnvelope -type DetailEnrollmentEnvelope struct { - - // data - // Required: true - Data *EnrollmentDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail enrollment envelope -func (m *DetailEnrollmentEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailEnrollmentEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailEnrollmentEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail enrollment envelope based on the context it is used -func (m *DetailEnrollmentEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailEnrollmentEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailEnrollmentEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailEnrollmentEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailEnrollmentEnvelope) UnmarshalBinary(b []byte) error { - var res DetailEnrollmentEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_external_jwt_signer_envelope.go b/rest_model/detail_external_jwt_signer_envelope.go deleted file mode 100644 index c339a0e61..000000000 --- a/rest_model/detail_external_jwt_signer_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailExternalJWTSignerEnvelope detail external Jwt signer envelope -// -// swagger:model detailExternalJwtSignerEnvelope -type DetailExternalJWTSignerEnvelope struct { - - // data - // Required: true - Data *ExternalJWTSignerDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail external Jwt signer envelope -func (m *DetailExternalJWTSignerEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailExternalJWTSignerEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailExternalJWTSignerEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail external Jwt signer envelope based on the context it is used -func (m *DetailExternalJWTSignerEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailExternalJWTSignerEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailExternalJWTSignerEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailExternalJWTSignerEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailExternalJWTSignerEnvelope) UnmarshalBinary(b []byte) error { - var res DetailExternalJWTSignerEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_identity_envelope.go b/rest_model/detail_identity_envelope.go deleted file mode 100644 index 8e9f6e05b..000000000 --- a/rest_model/detail_identity_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailIdentityEnvelope detail identity envelope -// -// swagger:model detailIdentityEnvelope -type DetailIdentityEnvelope struct { - - // data - // Required: true - Data *IdentityDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail identity envelope -func (m *DetailIdentityEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailIdentityEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailIdentityEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail identity envelope based on the context it is used -func (m *DetailIdentityEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailIdentityEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailIdentityEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailIdentityEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailIdentityEnvelope) UnmarshalBinary(b []byte) error { - var res DetailIdentityEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_identity_type_envelope.go b/rest_model/detail_identity_type_envelope.go deleted file mode 100644 index 9d0e19aee..000000000 --- a/rest_model/detail_identity_type_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailIdentityTypeEnvelope detail identity type envelope -// -// swagger:model detailIdentityTypeEnvelope -type DetailIdentityTypeEnvelope struct { - - // data - // Required: true - Data *IdentityTypeDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail identity type envelope -func (m *DetailIdentityTypeEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailIdentityTypeEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailIdentityTypeEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail identity type envelope based on the context it is used -func (m *DetailIdentityTypeEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailIdentityTypeEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailIdentityTypeEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailIdentityTypeEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailIdentityTypeEnvelope) UnmarshalBinary(b []byte) error { - var res DetailIdentityTypeEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_mfa.go b/rest_model/detail_mfa.go deleted file mode 100644 index 7120d5abb..000000000 --- a/rest_model/detail_mfa.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailMfa detail mfa -// -// swagger:model detailMfa -type DetailMfa struct { - BaseEntity - - // is verified - // Required: true - IsVerified *bool `json:"isVerified"` - - // Not provided if MFA verification has been completed - ProvisioningURL string `json:"provisioningUrl,omitempty"` - - // Not provided if MFA verification has been completed - RecoveryCodes []string `json:"recoveryCodes"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *DetailMfa) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - IsVerified *bool `json:"isVerified"` - - ProvisioningURL string `json:"provisioningUrl,omitempty"` - - RecoveryCodes []string `json:"recoveryCodes"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.IsVerified = dataAO1.IsVerified - - m.ProvisioningURL = dataAO1.ProvisioningURL - - m.RecoveryCodes = dataAO1.RecoveryCodes - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m DetailMfa) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - IsVerified *bool `json:"isVerified"` - - ProvisioningURL string `json:"provisioningUrl,omitempty"` - - RecoveryCodes []string `json:"recoveryCodes"` - } - - dataAO1.IsVerified = m.IsVerified - - dataAO1.ProvisioningURL = m.ProvisioningURL - - dataAO1.RecoveryCodes = m.RecoveryCodes - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this detail mfa -func (m *DetailMfa) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsVerified(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailMfa) validateIsVerified(formats strfmt.Registry) error { - - if err := validate.Required("isVerified", "body", m.IsVerified); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this detail mfa based on the context it is used -func (m *DetailMfa) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *DetailMfa) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailMfa) UnmarshalBinary(b []byte) error { - var res DetailMfa - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_mfa_envelope.go b/rest_model/detail_mfa_envelope.go deleted file mode 100644 index d06d10b22..000000000 --- a/rest_model/detail_mfa_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailMfaEnvelope detail mfa envelope -// -// swagger:model detailMfaEnvelope -type DetailMfaEnvelope struct { - - // data - // Required: true - Data *DetailMfa `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail mfa envelope -func (m *DetailMfaEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailMfaEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailMfaEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail mfa envelope based on the context it is used -func (m *DetailMfaEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailMfaEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailMfaEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailMfaEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailMfaEnvelope) UnmarshalBinary(b []byte) error { - var res DetailMfaEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_mfa_recovery_codes.go b/rest_model/detail_mfa_recovery_codes.go deleted file mode 100644 index 5da6bec5a..000000000 --- a/rest_model/detail_mfa_recovery_codes.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailMfaRecoveryCodes detail mfa recovery codes -// -// swagger:model detailMfaRecoveryCodes -type DetailMfaRecoveryCodes struct { - BaseEntity - - // recovery codes - // Required: true - RecoveryCodes []string `json:"recoveryCodes"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *DetailMfaRecoveryCodes) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - RecoveryCodes []string `json:"recoveryCodes"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.RecoveryCodes = dataAO1.RecoveryCodes - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m DetailMfaRecoveryCodes) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - RecoveryCodes []string `json:"recoveryCodes"` - } - - dataAO1.RecoveryCodes = m.RecoveryCodes - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this detail mfa recovery codes -func (m *DetailMfaRecoveryCodes) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecoveryCodes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailMfaRecoveryCodes) validateRecoveryCodes(formats strfmt.Registry) error { - - if err := validate.Required("recoveryCodes", "body", m.RecoveryCodes); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this detail mfa recovery codes based on the context it is used -func (m *DetailMfaRecoveryCodes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *DetailMfaRecoveryCodes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailMfaRecoveryCodes) UnmarshalBinary(b []byte) error { - var res DetailMfaRecoveryCodes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_mfa_recovery_codes_envelope.go b/rest_model/detail_mfa_recovery_codes_envelope.go deleted file mode 100644 index 040db70e8..000000000 --- a/rest_model/detail_mfa_recovery_codes_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailMfaRecoveryCodesEnvelope detail mfa recovery codes envelope -// -// swagger:model detailMfaRecoveryCodesEnvelope -type DetailMfaRecoveryCodesEnvelope struct { - - // error - // Required: true - Error *DetailMfaRecoveryCodes `json:"error"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail mfa recovery codes envelope -func (m *DetailMfaRecoveryCodesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateError(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailMfaRecoveryCodesEnvelope) validateError(formats strfmt.Registry) error { - - if err := validate.Required("error", "body", m.Error); err != nil { - return err - } - - if m.Error != nil { - if err := m.Error.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *DetailMfaRecoveryCodesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail mfa recovery codes envelope based on the context it is used -func (m *DetailMfaRecoveryCodesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateError(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailMfaRecoveryCodesEnvelope) contextValidateError(ctx context.Context, formats strfmt.Registry) error { - - if m.Error != nil { - if err := m.Error.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("error") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("error") - } - return err - } - } - - return nil -} - -func (m *DetailMfaRecoveryCodesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailMfaRecoveryCodesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailMfaRecoveryCodesEnvelope) UnmarshalBinary(b []byte) error { - var res DetailMfaRecoveryCodesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_posture_check_envelope.go b/rest_model/detail_posture_check_envelope.go deleted file mode 100644 index 6cf688126..000000000 --- a/rest_model/detail_posture_check_envelope.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailPostureCheckEnvelope detail posture check envelope -// -// swagger:model detailPostureCheckEnvelope -type DetailPostureCheckEnvelope struct { - dataField PostureCheckDetail - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Data gets the data of this base type -func (m *DetailPostureCheckEnvelope) Data() PostureCheckDetail { - return m.dataField -} - -// SetData sets the data of this base type -func (m *DetailPostureCheckEnvelope) SetData(val PostureCheckDetail) { - m.dataField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *DetailPostureCheckEnvelope) UnmarshalJSON(raw []byte) error { - var data struct { - Data json.RawMessage `json:"data"` - - Meta *Meta `json:"meta"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propData, err := UnmarshalPostureCheckDetail(bytes.NewBuffer(data.Data), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - - var result DetailPostureCheckEnvelope - - // data - result.dataField = propData - - // meta - result.Meta = data.Meta - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m DetailPostureCheckEnvelope) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - Meta *Meta `json:"meta"` - }{ - - Meta: m.Meta, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Data PostureCheckDetail `json:"data"` - }{ - - Data: m.dataField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this detail posture check envelope -func (m *DetailPostureCheckEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailPostureCheckEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data()); err != nil { - return err - } - - if err := m.Data().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *DetailPostureCheckEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail posture check envelope based on the context it is used -func (m *DetailPostureCheckEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailPostureCheckEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *DetailPostureCheckEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailPostureCheckEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailPostureCheckEnvelope) UnmarshalBinary(b []byte) error { - var res DetailPostureCheckEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_posture_check_type_envelope.go b/rest_model/detail_posture_check_type_envelope.go deleted file mode 100644 index 8b9214561..000000000 --- a/rest_model/detail_posture_check_type_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailPostureCheckTypeEnvelope detail posture check type envelope -// -// swagger:model detailPostureCheckTypeEnvelope -type DetailPostureCheckTypeEnvelope struct { - - // data - // Required: true - Data *PostureCheckTypeDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail posture check type envelope -func (m *DetailPostureCheckTypeEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailPostureCheckTypeEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailPostureCheckTypeEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail posture check type envelope based on the context it is used -func (m *DetailPostureCheckTypeEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailPostureCheckTypeEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailPostureCheckTypeEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailPostureCheckTypeEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailPostureCheckTypeEnvelope) UnmarshalBinary(b []byte) error { - var res DetailPostureCheckTypeEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_router_envelope.go b/rest_model/detail_router_envelope.go deleted file mode 100644 index 1e54bd009..000000000 --- a/rest_model/detail_router_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailRouterEnvelope detail router envelope -// -// swagger:model detailRouterEnvelope -type DetailRouterEnvelope struct { - - // data - // Required: true - Data *RouterDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail router envelope -func (m *DetailRouterEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailRouterEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailRouterEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail router envelope based on the context it is used -func (m *DetailRouterEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailRouterEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailRouterEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailRouterEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailRouterEnvelope) UnmarshalBinary(b []byte) error { - var res DetailRouterEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_service_edge_policy_envelope.go b/rest_model/detail_service_edge_policy_envelope.go deleted file mode 100644 index 5803c26fb..000000000 --- a/rest_model/detail_service_edge_policy_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailServiceEdgePolicyEnvelope detail service edge policy envelope -// -// swagger:model detailServiceEdgePolicyEnvelope -type DetailServiceEdgePolicyEnvelope struct { - - // data - // Required: true - Data *ServiceEdgeRouterPolicyDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail service edge policy envelope -func (m *DetailServiceEdgePolicyEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailServiceEdgePolicyEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailServiceEdgePolicyEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail service edge policy envelope based on the context it is used -func (m *DetailServiceEdgePolicyEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailServiceEdgePolicyEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailServiceEdgePolicyEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailServiceEdgePolicyEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailServiceEdgePolicyEnvelope) UnmarshalBinary(b []byte) error { - var res DetailServiceEdgePolicyEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_service_envelope.go b/rest_model/detail_service_envelope.go deleted file mode 100644 index 0a496966b..000000000 --- a/rest_model/detail_service_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailServiceEnvelope detail service envelope -// -// swagger:model detailServiceEnvelope -type DetailServiceEnvelope struct { - - // data - // Required: true - Data *ServiceDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail service envelope -func (m *DetailServiceEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailServiceEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailServiceEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail service envelope based on the context it is used -func (m *DetailServiceEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailServiceEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailServiceEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailServiceEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailServiceEnvelope) UnmarshalBinary(b []byte) error { - var res DetailServiceEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_service_policy_envelop.go b/rest_model/detail_service_policy_envelop.go deleted file mode 100644 index 3a4ed2e16..000000000 --- a/rest_model/detail_service_policy_envelop.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailServicePolicyEnvelop detail service policy envelop -// -// swagger:model detailServicePolicyEnvelop -type DetailServicePolicyEnvelop struct { - - // data - // Required: true - Data *ServicePolicyDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail service policy envelop -func (m *DetailServicePolicyEnvelop) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailServicePolicyEnvelop) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailServicePolicyEnvelop) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail service policy envelop based on the context it is used -func (m *DetailServicePolicyEnvelop) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailServicePolicyEnvelop) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailServicePolicyEnvelop) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailServicePolicyEnvelop) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailServicePolicyEnvelop) UnmarshalBinary(b []byte) error { - var res DetailServicePolicyEnvelop - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_session_envelope.go b/rest_model/detail_session_envelope.go deleted file mode 100644 index 886af7bcd..000000000 --- a/rest_model/detail_session_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailSessionEnvelope detail session envelope -// -// swagger:model detailSessionEnvelope -type DetailSessionEnvelope struct { - - // data - // Required: true - Data *SessionDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail session envelope -func (m *DetailSessionEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSessionEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSessionEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail session envelope based on the context it is used -func (m *DetailSessionEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSessionEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSessionEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailSessionEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailSessionEnvelope) UnmarshalBinary(b []byte) error { - var res DetailSessionEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_session_management_envelope.go b/rest_model/detail_session_management_envelope.go deleted file mode 100644 index 764b84e6a..000000000 --- a/rest_model/detail_session_management_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailSessionManagementEnvelope detail session management envelope -// -// swagger:model detailSessionManagementEnvelope -type DetailSessionManagementEnvelope struct { - - // data - // Required: true - Data *SessionManagementDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail session management envelope -func (m *DetailSessionManagementEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSessionManagementEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSessionManagementEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail session management envelope based on the context it is used -func (m *DetailSessionManagementEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSessionManagementEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSessionManagementEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailSessionManagementEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailSessionManagementEnvelope) UnmarshalBinary(b []byte) error { - var res DetailSessionManagementEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_session_route_path_envelope.go b/rest_model/detail_session_route_path_envelope.go deleted file mode 100644 index c762ed5f5..000000000 --- a/rest_model/detail_session_route_path_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailSessionRoutePathEnvelope detail session route path envelope -// -// swagger:model detailSessionRoutePathEnvelope -type DetailSessionRoutePathEnvelope struct { - - // data - // Required: true - Data *SessionRoutePathDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail session route path envelope -func (m *DetailSessionRoutePathEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSessionRoutePathEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSessionRoutePathEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail session route path envelope based on the context it is used -func (m *DetailSessionRoutePathEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSessionRoutePathEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSessionRoutePathEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailSessionRoutePathEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailSessionRoutePathEnvelope) UnmarshalBinary(b []byte) error { - var res DetailSessionRoutePathEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_spec_body_envelope.go b/rest_model/detail_spec_body_envelope.go deleted file mode 100644 index f91bf79f6..000000000 --- a/rest_model/detail_spec_body_envelope.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailSpecBodyEnvelope detail spec body envelope -// -// swagger:model detailSpecBodyEnvelope -type DetailSpecBodyEnvelope struct { - - // data - // Required: true - Data *SpecBodyDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail spec body envelope -func (m *DetailSpecBodyEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSpecBodyEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSpecBodyEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail spec body envelope based on the context it is used -func (m *DetailSpecBodyEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSpecBodyEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSpecBodyEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailSpecBodyEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailSpecBodyEnvelope) UnmarshalBinary(b []byte) error { - var res DetailSpecBodyEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_spec_envelope.go b/rest_model/detail_spec_envelope.go deleted file mode 100644 index ab23805dc..000000000 --- a/rest_model/detail_spec_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailSpecEnvelope detail spec envelope -// -// swagger:model detailSpecEnvelope -type DetailSpecEnvelope struct { - - // data - // Required: true - Data *SpecDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail spec envelope -func (m *DetailSpecEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSpecEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSpecEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail spec envelope based on the context it is used -func (m *DetailSpecEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailSpecEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailSpecEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailSpecEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailSpecEnvelope) UnmarshalBinary(b []byte) error { - var res DetailSpecEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detail_terminator_envelope.go b/rest_model/detail_terminator_envelope.go deleted file mode 100644 index f3054c3ce..000000000 --- a/rest_model/detail_terminator_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailTerminatorEnvelope detail terminator envelope -// -// swagger:model detailTerminatorEnvelope -type DetailTerminatorEnvelope struct { - - // data - // Required: true - Data *TerminatorDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detail terminator envelope -func (m *DetailTerminatorEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailTerminatorEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailTerminatorEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detail terminator envelope based on the context it is used -func (m *DetailTerminatorEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailTerminatorEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailTerminatorEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailTerminatorEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailTerminatorEnvelope) UnmarshalBinary(b []byte) error { - var res DetailTerminatorEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/detailed_edge_router_envelope.go b/rest_model/detailed_edge_router_envelope.go deleted file mode 100644 index 7026b0742..000000000 --- a/rest_model/detailed_edge_router_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DetailedEdgeRouterEnvelope detailed edge router envelope -// -// swagger:model detailedEdgeRouterEnvelope -type DetailedEdgeRouterEnvelope struct { - - // data - // Required: true - Data *EdgeRouterDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this detailed edge router envelope -func (m *DetailedEdgeRouterEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailedEdgeRouterEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailedEdgeRouterEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this detailed edge router envelope based on the context it is used -func (m *DetailedEdgeRouterEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DetailedEdgeRouterEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *DetailedEdgeRouterEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DetailedEdgeRouterEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DetailedEdgeRouterEnvelope) UnmarshalBinary(b []byte) error { - var res DetailedEdgeRouterEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/dial_bind.go b/rest_model/dial_bind.go deleted file mode 100644 index a43bc710e..000000000 --- a/rest_model/dial_bind.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DialBind dial bind -// -// swagger:model dialBind -type DialBind string - -func NewDialBind(value DialBind) *DialBind { - v := value - return &v -} - -const ( - - // DialBindDial captures enum value "Dial" - DialBindDial DialBind = "Dial" - - // DialBindBind captures enum value "Bind" - DialBindBind DialBind = "Bind" -) - -// for schema -var dialBindEnum []interface{} - -func init() { - var res []DialBind - if err := json.Unmarshal([]byte(`["Dial","Bind"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - dialBindEnum = append(dialBindEnum, v) - } -} - -func (m DialBind) validateDialBindEnum(path, location string, value DialBind) error { - if err := validate.EnumCase(path, location, value, dialBindEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this dial bind -func (m DialBind) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDialBindEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this dial bind based on context it is used -func (m DialBind) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/dial_bind_array.go b/rest_model/dial_bind_array.go deleted file mode 100644 index b07ef822b..000000000 --- a/rest_model/dial_bind_array.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" -) - -// DialBindArray dial bind array -// -// swagger:model dialBindArray -type DialBindArray []DialBind - -// Validate validates this dial bind array -func (m DialBindArray) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this dial bind array based on the context it is used -func (m DialBindArray) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/disable_params.go b/rest_model/disable_params.go deleted file mode 100644 index 10365914b..000000000 --- a/rest_model/disable_params.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DisableParams disable params -// -// swagger:model disableParams -type DisableParams struct { - - // duration minutes - // Required: true - DurationMinutes *int64 `json:"durationMinutes"` -} - -// Validate validates this disable params -func (m *DisableParams) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDurationMinutes(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DisableParams) validateDurationMinutes(formats strfmt.Registry) error { - - if err := validate.Required("durationMinutes", "body", m.DurationMinutes); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this disable params based on context it is used -func (m *DisableParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DisableParams) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DisableParams) UnmarshalBinary(b []byte) error { - var res DisableParams - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_create.go b/rest_model/edge_router_create.go deleted file mode 100644 index 57c2c6bae..000000000 --- a/rest_model/edge_router_create.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterCreate An edge router create object -// -// swagger:model edgeRouterCreate -type EdgeRouterCreate struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // cost - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost,omitempty"` - - // is tunneler enabled - IsTunnelerEnabled bool `json:"isTunnelerEnabled,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // no traversal - NoTraversal *bool `json:"noTraversal,omitempty"` - - // role attributes - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this edge router create -func (m *EdgeRouterCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterCreate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterCreate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterCreate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required - return nil - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router create based on the context it is used -func (m *EdgeRouterCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterCreate) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterCreate) UnmarshalBinary(b []byte) error { - var res EdgeRouterCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_detail.go b/rest_model/edge_router_detail.go deleted file mode 100644 index 3c47c272e..000000000 --- a/rest_model/edge_router_detail.go +++ /dev/null @@ -1,440 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterDetail A detail edge router resource -// Example: {"_links":{"edge-router-policies":{"href":"./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d/edge-routers"},"self":{"href":"./edge-routers/b0766b8d-bd1a-4d28-8415-639b29d3c83d"}},"cost":0,"createdAt":"2020-03-16T17:13:31.5807454Z","enrollmentCreatedAt":"2020-03-16T17:13:31.5777637Z","enrollmentExpiresAt":"2020-03-16T17:18:31.5777637Z","enrollmentJwt":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbSI6ImVyb3R0IiwiZXhwIjoxNTg0Mzc5MTExLCJpc3MiOiJodHRwczovL 2xvY2FsaG9zdDoxMjgwIiwianRpIjoiMzBhMWYwZWEtZDM5Yi00YWFlLWI4NTItMzA0Y2YxYzMwZDFmIiwic3ViIjoiYjA3NjZiOGQtYmQxYS00ZDI 4LTg0MTUtNjM5YjI5ZDNjODNkIn0.UsyQhCPORQ5tQnYWY7S88LNvV9iFS5Hy-P4aJaClZzEICobKgnQoyQblJcdMvk3cGKwyFqAnQtt0tDZkb8tHz Vqyv6bilHcAFuMRrdwXRqdXquabSN5geu2qBUnyzL7Mf2X85if8sbMida6snB4oLZsVRF3CRn4ODBJdeiVJ_Z4rgD-zW2IwtXPApT7ALyiiw2cN4EH 8pqQ7tpZKqztE0PGEbBQFPGKUFnm7oXyvSUo17EsFJUv5gUlBzfKKGolh5io4ptp22HZrqsqSnqDSOnYEZHonr5Yljuwiktrlh-JKiK6GGns5OAJMP dO9lgM4yHSpF2ILbqhWMV93Y3zMOg","enrollmentToken":"30a1f0ea-d39b-4aae-b852-304cf1c30d1f","fingerprint":null,"hostname":"","id":"b0766b8d-bd1a-4d28-8415-639b29d3c83d","isOnline":false,"isTunnelerEnabled":false,"isVerified":false,"name":"TestRouter-e33c837f-3222-4b40-bcd6-b3458fd5156e","noTraversal":false,"roleAttributes":["eastCoast","sales","test"],"supportedProtocols":{},"tags":{},"updatedAt":"2020-03-16T17:13:31.5807454Z"} -// -// swagger:model edgeRouterDetail -type EdgeRouterDetail struct { - BaseEntity - - CommonEdgeRouterProperties - - // cert pem - CertPem *string `json:"certPem"` - - // enrollment created at - // Format: date-time - EnrollmentCreatedAt *strfmt.DateTime `json:"enrollmentCreatedAt,omitempty"` - - // enrollment expires at - // Format: date-time - EnrollmentExpiresAt *strfmt.DateTime `json:"enrollmentExpiresAt,omitempty"` - - // enrollment Jwt - EnrollmentJWT *string `json:"enrollmentJwt,omitempty"` - - // enrollment token - EnrollmentToken *string `json:"enrollmentToken,omitempty"` - - // fingerprint - Fingerprint string `json:"fingerprint,omitempty"` - - // is tunneler enabled - // Required: true - IsTunnelerEnabled *bool `json:"isTunnelerEnabled"` - - // is verified - // Required: true - IsVerified *bool `json:"isVerified"` - - // role attributes - // Required: true - RoleAttributes *Attributes `json:"roleAttributes"` - - // unverified cert pem - UnverifiedCertPem *string `json:"unverifiedCertPem"` - - // unverified fingerprint - UnverifiedFingerprint *string `json:"unverifiedFingerprint"` - - // version info - VersionInfo *VersionInfo `json:"versionInfo,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *EdgeRouterDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var aO1 CommonEdgeRouterProperties - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.CommonEdgeRouterProperties = aO1 - - // AO2 - var dataAO2 struct { - CertPem *string `json:"certPem"` - - EnrollmentCreatedAt *strfmt.DateTime `json:"enrollmentCreatedAt,omitempty"` - - EnrollmentExpiresAt *strfmt.DateTime `json:"enrollmentExpiresAt,omitempty"` - - EnrollmentJWT *string `json:"enrollmentJwt,omitempty"` - - EnrollmentToken *string `json:"enrollmentToken,omitempty"` - - Fingerprint string `json:"fingerprint,omitempty"` - - IsTunnelerEnabled *bool `json:"isTunnelerEnabled"` - - IsVerified *bool `json:"isVerified"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - UnverifiedCertPem *string `json:"unverifiedCertPem"` - - UnverifiedFingerprint *string `json:"unverifiedFingerprint"` - - VersionInfo *VersionInfo `json:"versionInfo,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO2); err != nil { - return err - } - - m.CertPem = dataAO2.CertPem - - m.EnrollmentCreatedAt = dataAO2.EnrollmentCreatedAt - - m.EnrollmentExpiresAt = dataAO2.EnrollmentExpiresAt - - m.EnrollmentJWT = dataAO2.EnrollmentJWT - - m.EnrollmentToken = dataAO2.EnrollmentToken - - m.Fingerprint = dataAO2.Fingerprint - - m.IsTunnelerEnabled = dataAO2.IsTunnelerEnabled - - m.IsVerified = dataAO2.IsVerified - - m.RoleAttributes = dataAO2.RoleAttributes - - m.UnverifiedCertPem = dataAO2.UnverifiedCertPem - - m.UnverifiedFingerprint = dataAO2.UnverifiedFingerprint - - m.VersionInfo = dataAO2.VersionInfo - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m EdgeRouterDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 3) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.CommonEdgeRouterProperties) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - var dataAO2 struct { - CertPem *string `json:"certPem"` - - EnrollmentCreatedAt *strfmt.DateTime `json:"enrollmentCreatedAt,omitempty"` - - EnrollmentExpiresAt *strfmt.DateTime `json:"enrollmentExpiresAt,omitempty"` - - EnrollmentJWT *string `json:"enrollmentJwt,omitempty"` - - EnrollmentToken *string `json:"enrollmentToken,omitempty"` - - Fingerprint string `json:"fingerprint,omitempty"` - - IsTunnelerEnabled *bool `json:"isTunnelerEnabled"` - - IsVerified *bool `json:"isVerified"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - UnverifiedCertPem *string `json:"unverifiedCertPem"` - - UnverifiedFingerprint *string `json:"unverifiedFingerprint"` - - VersionInfo *VersionInfo `json:"versionInfo,omitempty"` - } - - dataAO2.CertPem = m.CertPem - - dataAO2.EnrollmentCreatedAt = m.EnrollmentCreatedAt - - dataAO2.EnrollmentExpiresAt = m.EnrollmentExpiresAt - - dataAO2.EnrollmentJWT = m.EnrollmentJWT - - dataAO2.EnrollmentToken = m.EnrollmentToken - - dataAO2.Fingerprint = m.Fingerprint - - dataAO2.IsTunnelerEnabled = m.IsTunnelerEnabled - - dataAO2.IsVerified = m.IsVerified - - dataAO2.RoleAttributes = m.RoleAttributes - - dataAO2.UnverifiedCertPem = m.UnverifiedCertPem - - dataAO2.UnverifiedFingerprint = m.UnverifiedFingerprint - - dataAO2.VersionInfo = m.VersionInfo - - jsonDataAO2, errAO2 := swag.WriteJSON(dataAO2) - if errAO2 != nil { - return nil, errAO2 - } - _parts = append(_parts, jsonDataAO2) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this edge router detail -func (m *EdgeRouterDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - // validation for a type composition with CommonEdgeRouterProperties - if err := m.CommonEdgeRouterProperties.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrollmentCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrollmentExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsTunnelerEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsVerified(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersionInfo(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterDetail) validateEnrollmentCreatedAt(formats strfmt.Registry) error { - - if swag.IsZero(m.EnrollmentCreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("enrollmentCreatedAt", "body", "date-time", m.EnrollmentCreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterDetail) validateEnrollmentExpiresAt(formats strfmt.Registry) error { - - if swag.IsZero(m.EnrollmentExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("enrollmentExpiresAt", "body", "date-time", m.EnrollmentExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterDetail) validateIsTunnelerEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isTunnelerEnabled", "body", m.IsTunnelerEnabled); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterDetail) validateIsVerified(formats strfmt.Registry) error { - - if err := validate.Required("isVerified", "body", m.IsVerified); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes); err != nil { - return err - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterDetail) validateVersionInfo(formats strfmt.Registry) error { - - if swag.IsZero(m.VersionInfo) { // not required - return nil - } - - if m.VersionInfo != nil { - if err := m.VersionInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versionInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versionInfo") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router detail based on the context it is used -func (m *EdgeRouterDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - // validation for a type composition with CommonEdgeRouterProperties - if err := m.CommonEdgeRouterProperties.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateVersionInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterDetail) contextValidateVersionInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.VersionInfo != nil { - if err := m.VersionInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("versionInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("versionInfo") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterDetail) UnmarshalBinary(b []byte) error { - var res EdgeRouterDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_list.go b/rest_model/edge_router_list.go deleted file mode 100644 index 5b3efe45a..000000000 --- a/rest_model/edge_router_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EdgeRouterList A list of edge router resources -// -// swagger:model edgeRouterList -type EdgeRouterList []*EdgeRouterDetail - -// Validate validates this edge router list -func (m EdgeRouterList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this edge router list based on the context it is used -func (m EdgeRouterList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/edge_router_patch.go b/rest_model/edge_router_patch.go deleted file mode 100644 index b8d4e14fc..000000000 --- a/rest_model/edge_router_patch.go +++ /dev/null @@ -1,255 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterPatch An edge router patch object -// -// swagger:model edgeRouterPatch -type EdgeRouterPatch struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // cost - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost,omitempty"` - - // is tunneler enabled - IsTunnelerEnabled bool `json:"isTunnelerEnabled,omitempty"` - - // name - Name *string `json:"name,omitempty"` - - // no traversal - NoTraversal *bool `json:"noTraversal,omitempty"` - - // role attributes - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this edge router patch -func (m *EdgeRouterPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPatch) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPatch) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterPatch) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required - return nil - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router patch based on the context it is used -func (m *EdgeRouterPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPatch) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterPatch) UnmarshalBinary(b []byte) error { - var res EdgeRouterPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_policy_create.go b/rest_model/edge_router_policy_create.go deleted file mode 100644 index 847285003..000000000 --- a/rest_model/edge_router_policy_create.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterPolicyCreate edge router policy create -// -// swagger:model edgeRouterPolicyCreate -type EdgeRouterPolicyCreate struct { - - // edge router roles - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // name - // Required: true - Name *string `json:"name"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this edge router policy create -func (m *EdgeRouterPolicyCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyCreate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required - return nil - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router policy create based on the context it is used -func (m *EdgeRouterPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyCreate) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterPolicyCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterPolicyCreate) UnmarshalBinary(b []byte) error { - var res EdgeRouterPolicyCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_policy_detail.go b/rest_model/edge_router_policy_detail.go deleted file mode 100644 index 120f5ad3d..000000000 --- a/rest_model/edge_router_policy_detail.go +++ /dev/null @@ -1,449 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterPolicyDetail edge router policy detail -// -// swagger:model edgeRouterPolicyDetail -type EdgeRouterPolicyDetail struct { - BaseEntity - - // edge router roles - // Required: true - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // edge router roles display - // Required: true - EdgeRouterRolesDisplay NamedRoles `json:"edgeRouterRolesDisplay"` - - // identity roles - // Required: true - IdentityRoles Roles `json:"identityRoles"` - - // identity roles display - // Required: true - IdentityRolesDisplay NamedRoles `json:"identityRolesDisplay"` - - // is system - // Required: true - IsSystem *bool `json:"isSystem"` - - // name - // Required: true - Name *string `json:"name"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *EdgeRouterPolicyDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - EdgeRouterRolesDisplay NamedRoles `json:"edgeRouterRolesDisplay"` - - IdentityRoles Roles `json:"identityRoles"` - - IdentityRolesDisplay NamedRoles `json:"identityRolesDisplay"` - - IsSystem *bool `json:"isSystem"` - - Name *string `json:"name"` - - Semantic *Semantic `json:"semantic"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.EdgeRouterRoles = dataAO1.EdgeRouterRoles - - m.EdgeRouterRolesDisplay = dataAO1.EdgeRouterRolesDisplay - - m.IdentityRoles = dataAO1.IdentityRoles - - m.IdentityRolesDisplay = dataAO1.IdentityRolesDisplay - - m.IsSystem = dataAO1.IsSystem - - m.Name = dataAO1.Name - - m.Semantic = dataAO1.Semantic - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m EdgeRouterPolicyDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - EdgeRouterRolesDisplay NamedRoles `json:"edgeRouterRolesDisplay"` - - IdentityRoles Roles `json:"identityRoles"` - - IdentityRolesDisplay NamedRoles `json:"identityRolesDisplay"` - - IsSystem *bool `json:"isSystem"` - - Name *string `json:"name"` - - Semantic *Semantic `json:"semantic"` - } - - dataAO1.EdgeRouterRoles = m.EdgeRouterRoles - - dataAO1.EdgeRouterRolesDisplay = m.EdgeRouterRolesDisplay - - dataAO1.IdentityRoles = m.IdentityRoles - - dataAO1.IdentityRolesDisplay = m.IdentityRolesDisplay - - dataAO1.IsSystem = m.IsSystem - - dataAO1.Name = m.Name - - dataAO1.Semantic = m.Semantic - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this edge router policy detail -func (m *EdgeRouterPolicyDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdgeRouterRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsSystem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyDetail) validateEdgeRouterRoles(formats strfmt.Registry) error { - - if err := validate.Required("edgeRouterRoles", "body", m.EdgeRouterRoles); err != nil { - return err - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) validateEdgeRouterRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("edgeRouterRolesDisplay", "body", m.EdgeRouterRolesDisplay); err != nil { - return err - } - - if err := m.EdgeRouterRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRolesDisplay") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) validateIdentityRoles(formats strfmt.Registry) error { - - if err := validate.Required("identityRoles", "body", m.IdentityRoles); err != nil { - return err - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) validateIdentityRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("identityRolesDisplay", "body", m.IdentityRolesDisplay); err != nil { - return err - } - - if err := m.IdentityRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRolesDisplay") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) validateIsSystem(formats strfmt.Registry) error { - - if err := validate.Required("isSystem", "body", m.IsSystem); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router policy detail based on the context it is used -func (m *EdgeRouterPolicyDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEdgeRouterRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyDetail) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) contextValidateEdgeRouterRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRolesDisplay") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) contextValidateIdentityRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRolesDisplay") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyDetail) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterPolicyDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterPolicyDetail) UnmarshalBinary(b []byte) error { - var res EdgeRouterPolicyDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_policy_list.go b/rest_model/edge_router_policy_list.go deleted file mode 100644 index 50e57d45f..000000000 --- a/rest_model/edge_router_policy_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EdgeRouterPolicyList edge router policy list -// -// swagger:model edgeRouterPolicyList -type EdgeRouterPolicyList []*EdgeRouterPolicyDetail - -// Validate validates this edge router policy list -func (m EdgeRouterPolicyList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this edge router policy list based on the context it is used -func (m EdgeRouterPolicyList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/edge_router_policy_patch.go b/rest_model/edge_router_policy_patch.go deleted file mode 100644 index 42be07eb5..000000000 --- a/rest_model/edge_router_policy_patch.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EdgeRouterPolicyPatch edge router policy patch -// -// swagger:model edgeRouterPolicyPatch -type EdgeRouterPolicyPatch struct { - - // edge router roles - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // name - Name string `json:"name,omitempty"` - - // semantic - Semantic Semantic `json:"semantic,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this edge router policy patch -func (m *EdgeRouterPolicyPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyPatch) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required - return nil - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyPatch) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyPatch) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required - return nil - } - - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router policy patch based on the context it is used -func (m *EdgeRouterPolicyPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyPatch) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyPatch) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyPatch) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterPolicyPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterPolicyPatch) UnmarshalBinary(b []byte) error { - var res EdgeRouterPolicyPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_policy_update.go b/rest_model/edge_router_policy_update.go deleted file mode 100644 index 01965a498..000000000 --- a/rest_model/edge_router_policy_update.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterPolicyUpdate edge router policy update -// -// swagger:model edgeRouterPolicyUpdate -type EdgeRouterPolicyUpdate struct { - - // edge router roles - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // name - // Required: true - Name *string `json:"name"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this edge router policy update -func (m *EdgeRouterPolicyUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyUpdate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required - return nil - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router policy update based on the context it is used -func (m *EdgeRouterPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterPolicyUpdate) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterPolicyUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterPolicyUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterPolicyUpdate) UnmarshalBinary(b []byte) error { - var res EdgeRouterPolicyUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/edge_router_update.go b/rest_model/edge_router_update.go deleted file mode 100644 index 3fb05bb1c..000000000 --- a/rest_model/edge_router_update.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EdgeRouterUpdate An edge router update object -// -// swagger:model edgeRouterUpdate -type EdgeRouterUpdate struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // cost - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost,omitempty"` - - // is tunneler enabled - IsTunnelerEnabled bool `json:"isTunnelerEnabled,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // no traversal - NoTraversal *bool `json:"noTraversal,omitempty"` - - // role attributes - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this edge router update -func (m *EdgeRouterUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterUpdate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterUpdate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *EdgeRouterUpdate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required - return nil - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this edge router update based on the context it is used -func (m *EdgeRouterUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EdgeRouterUpdate) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *EdgeRouterUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EdgeRouterUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EdgeRouterUpdate) UnmarshalBinary(b []byte) error { - var res EdgeRouterUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/empty.go b/rest_model/empty.go deleted file mode 100644 index 3ffbceea3..000000000 --- a/rest_model/empty.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Empty empty -// -// swagger:model empty -type Empty struct { - - // data - // Example: {} - // Required: true - Data interface{} `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this empty -func (m *Empty) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Empty) validateData(formats strfmt.Registry) error { - - if m.Data == nil { - return errors.Required("data", "body", nil) - } - - return nil -} - -func (m *Empty) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this empty based on the context it is used -func (m *Empty) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Empty) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Empty) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Empty) UnmarshalBinary(b []byte) error { - var res Empty - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/enrollment_certs.go b/rest_model/enrollment_certs.go deleted file mode 100644 index f31ca549f..000000000 --- a/rest_model/enrollment_certs.go +++ /dev/null @@ -1,80 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnrollmentCerts enrollment certs -// -// swagger:model enrollmentCerts -type EnrollmentCerts struct { - - // A PEM encoded set of CA certificates to trust - Ca string `json:"ca,omitempty"` - - // A PEM encoded cert for the server - Cert string `json:"cert,omitempty"` - - // A PEM encoded set of certificates to use as the servers chain - ServerCert string `json:"serverCert,omitempty"` -} - -// Validate validates this enrollment certs -func (m *EnrollmentCerts) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this enrollment certs based on context it is used -func (m *EnrollmentCerts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EnrollmentCerts) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnrollmentCerts) UnmarshalBinary(b []byte) error { - var res EnrollmentCerts - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/enrollment_certs_envelope.go b/rest_model/enrollment_certs_envelope.go deleted file mode 100644 index fca456ceb..000000000 --- a/rest_model/enrollment_certs_envelope.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnrollmentCertsEnvelope enrollment certs envelope -// -// swagger:model enrollmentCertsEnvelope -type EnrollmentCertsEnvelope struct { - - // data - Data *EnrollmentCerts `json:"data,omitempty"` - - // meta - Meta *Meta `json:"meta,omitempty"` -} - -// Validate validates this enrollment certs envelope -func (m *EnrollmentCertsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnrollmentCertsEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *EnrollmentCertsEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this enrollment certs envelope based on the context it is used -func (m *EnrollmentCertsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnrollmentCertsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *EnrollmentCertsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EnrollmentCertsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnrollmentCertsEnvelope) UnmarshalBinary(b []byte) error { - var res EnrollmentCertsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/enrollment_create.go b/rest_model/enrollment_create.go deleted file mode 100644 index daf56d616..000000000 --- a/rest_model/enrollment_create.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EnrollmentCreate enrollment create -// -// swagger:model enrollmentCreate -type EnrollmentCreate struct { - - // ca Id - CaID *string `json:"caId,omitempty"` - - // expires at - // Required: true - // Format: date-time - ExpiresAt *strfmt.DateTime `json:"expiresAt"` - - // identity Id - // Required: true - IdentityID *string `json:"identityId"` - - // method - // Required: true - // Enum: [ott ottca updb] - Method *string `json:"method"` - - // username - Username *string `json:"username,omitempty"` -} - -// Validate validates this enrollment create -func (m *EnrollmentCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMethod(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnrollmentCreate) validateExpiresAt(formats strfmt.Registry) error { - - if err := validate.Required("expiresAt", "body", m.ExpiresAt); err != nil { - return err - } - - if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EnrollmentCreate) validateIdentityID(formats strfmt.Registry) error { - - if err := validate.Required("identityId", "body", m.IdentityID); err != nil { - return err - } - - return nil -} - -var enrollmentCreateTypeMethodPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ott","ottca","updb"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - enrollmentCreateTypeMethodPropEnum = append(enrollmentCreateTypeMethodPropEnum, v) - } -} - -const ( - - // EnrollmentCreateMethodOtt captures enum value "ott" - EnrollmentCreateMethodOtt string = "ott" - - // EnrollmentCreateMethodOttca captures enum value "ottca" - EnrollmentCreateMethodOttca string = "ottca" - - // EnrollmentCreateMethodUpdb captures enum value "updb" - EnrollmentCreateMethodUpdb string = "updb" -) - -// prop value enum -func (m *EnrollmentCreate) validateMethodEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, enrollmentCreateTypeMethodPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *EnrollmentCreate) validateMethod(formats strfmt.Registry) error { - - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - // value enum - if err := m.validateMethodEnum("method", "body", *m.Method); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this enrollment create based on context it is used -func (m *EnrollmentCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EnrollmentCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnrollmentCreate) UnmarshalBinary(b []byte) error { - var res EnrollmentCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/enrollment_detail.go b/rest_model/enrollment_detail.go deleted file mode 100644 index 0bba766e2..000000000 --- a/rest_model/enrollment_detail.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EnrollmentDetail An enrollment object. Enrollments are tied to identities and potentially a CA. Depending on the -// method, different fields are utilized. For example ottca enrollments use the `ca` field and updb enrollments -// use the username field, but not vice versa. -// -// Example: {"_links":{"self":{"href":"./enrollments/624fa53f-7629-4a7a-9e38-c1f4ce322c1d"}},"ca":null,"createdAt":"0001-01-01T00:00:00Z","expiresAt":"2020-03-11T20:20:24.0055543Z","id":"624fa53f-7629-4a7a-9e38-c1f4ce322c1d","identity":{"_links":{"self":{"href":"./identities/f047ac96-dc3a-408a-a6f2-0ba487c08ef9"}},"id":"f047ac96-dc3a-408a-a6f2-0ba487c08ef9","name":"updb--0f245140-7f2e-4326-badf-6aba55e52475","urlName":"identities"},"method":"updb","tags":null,"token":"1e727c8f-07e4-4a1d-a8b0-da0c7a01c6e1","updatedAt":"0001-01-01T00:00:00Z","username":"example-username"} -// -// swagger:model enrollmentDetail -type EnrollmentDetail struct { - BaseEntity - - // ca Id - CaID *string `json:"caId,omitempty"` - - // edge router - EdgeRouter *EntityRef `json:"edgeRouter,omitempty"` - - // edge router Id - EdgeRouterID string `json:"edgeRouterId,omitempty"` - - // expires at - // Required: true - // Format: date-time - ExpiresAt *strfmt.DateTime `json:"expiresAt"` - - // identity - Identity *EntityRef `json:"identity,omitempty"` - - // identity Id - IdentityID string `json:"identityId,omitempty"` - - // jwt - JWT string `json:"jwt,omitempty"` - - // method - // Required: true - Method *string `json:"method"` - - // token - // Required: true - Token *string `json:"token"` - - // transit router - TransitRouter *EntityRef `json:"transitRouter,omitempty"` - - // transit router Id - TransitRouterID string `json:"transitRouterId,omitempty"` - - // username - Username string `json:"username,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *EnrollmentDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - CaID *string `json:"caId,omitempty"` - - EdgeRouter *EntityRef `json:"edgeRouter,omitempty"` - - EdgeRouterID string `json:"edgeRouterId,omitempty"` - - ExpiresAt *strfmt.DateTime `json:"expiresAt"` - - Identity *EntityRef `json:"identity,omitempty"` - - IdentityID string `json:"identityId,omitempty"` - - JWT string `json:"jwt,omitempty"` - - Method *string `json:"method"` - - Token *string `json:"token"` - - TransitRouter *EntityRef `json:"transitRouter,omitempty"` - - TransitRouterID string `json:"transitRouterId,omitempty"` - - Username string `json:"username,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.CaID = dataAO1.CaID - - m.EdgeRouter = dataAO1.EdgeRouter - - m.EdgeRouterID = dataAO1.EdgeRouterID - - m.ExpiresAt = dataAO1.ExpiresAt - - m.Identity = dataAO1.Identity - - m.IdentityID = dataAO1.IdentityID - - m.JWT = dataAO1.JWT - - m.Method = dataAO1.Method - - m.Token = dataAO1.Token - - m.TransitRouter = dataAO1.TransitRouter - - m.TransitRouterID = dataAO1.TransitRouterID - - m.Username = dataAO1.Username - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m EnrollmentDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - CaID *string `json:"caId,omitempty"` - - EdgeRouter *EntityRef `json:"edgeRouter,omitempty"` - - EdgeRouterID string `json:"edgeRouterId,omitempty"` - - ExpiresAt *strfmt.DateTime `json:"expiresAt"` - - Identity *EntityRef `json:"identity,omitempty"` - - IdentityID string `json:"identityId,omitempty"` - - JWT string `json:"jwt,omitempty"` - - Method *string `json:"method"` - - Token *string `json:"token"` - - TransitRouter *EntityRef `json:"transitRouter,omitempty"` - - TransitRouterID string `json:"transitRouterId,omitempty"` - - Username string `json:"username,omitempty"` - } - - dataAO1.CaID = m.CaID - - dataAO1.EdgeRouter = m.EdgeRouter - - dataAO1.EdgeRouterID = m.EdgeRouterID - - dataAO1.ExpiresAt = m.ExpiresAt - - dataAO1.Identity = m.Identity - - dataAO1.IdentityID = m.IdentityID - - dataAO1.JWT = m.JWT - - dataAO1.Method = m.Method - - dataAO1.Token = m.Token - - dataAO1.TransitRouter = m.TransitRouter - - dataAO1.TransitRouterID = m.TransitRouterID - - dataAO1.Username = m.Username - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this enrollment detail -func (m *EnrollmentDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdgeRouter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransitRouter(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnrollmentDetail) validateEdgeRouter(formats strfmt.Registry) error { - - if swag.IsZero(m.EdgeRouter) { // not required - return nil - } - - if m.EdgeRouter != nil { - if err := m.EdgeRouter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouter") - } - return err - } - } - - return nil -} - -func (m *EnrollmentDetail) validateExpiresAt(formats strfmt.Registry) error { - - if err := validate.Required("expiresAt", "body", m.ExpiresAt); err != nil { - return err - } - - if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EnrollmentDetail) validateIdentity(formats strfmt.Registry) error { - - if swag.IsZero(m.Identity) { // not required - return nil - } - - if m.Identity != nil { - if err := m.Identity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *EnrollmentDetail) validateMethod(formats strfmt.Registry) error { - - if err := validate.Required("method", "body", m.Method); err != nil { - return err - } - - return nil -} - -func (m *EnrollmentDetail) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - - return nil -} - -func (m *EnrollmentDetail) validateTransitRouter(formats strfmt.Registry) error { - - if swag.IsZero(m.TransitRouter) { // not required - return nil - } - - if m.TransitRouter != nil { - if err := m.TransitRouter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transitRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transitRouter") - } - return err - } - } - - return nil -} - -// ContextValidate validate this enrollment detail based on the context it is used -func (m *EnrollmentDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEdgeRouter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransitRouter(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnrollmentDetail) contextValidateEdgeRouter(ctx context.Context, formats strfmt.Registry) error { - - if m.EdgeRouter != nil { - if err := m.EdgeRouter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouter") - } - return err - } - } - - return nil -} - -func (m *EnrollmentDetail) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *EnrollmentDetail) contextValidateTransitRouter(ctx context.Context, formats strfmt.Registry) error { - - if m.TransitRouter != nil { - if err := m.TransitRouter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transitRouter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transitRouter") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EnrollmentDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnrollmentDetail) UnmarshalBinary(b []byte) error { - var res EnrollmentDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/enrollment_list.go b/rest_model/enrollment_list.go deleted file mode 100644 index 2d6dd7a91..000000000 --- a/rest_model/enrollment_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnrollmentList An array of enrollment resources -// -// swagger:model enrollmentList -type EnrollmentList []*EnrollmentDetail - -// Validate validates this enrollment list -func (m EnrollmentList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this enrollment list based on the context it is used -func (m EnrollmentList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/enrollment_refresh.go b/rest_model/enrollment_refresh.go deleted file mode 100644 index d24fd61e9..000000000 --- a/rest_model/enrollment_refresh.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EnrollmentRefresh enrollment refresh -// -// swagger:model enrollmentRefresh -type EnrollmentRefresh struct { - - // expires at - // Required: true - // Format: date-time - ExpiresAt *strfmt.DateTime `json:"expiresAt"` -} - -// Validate validates this enrollment refresh -func (m *EnrollmentRefresh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EnrollmentRefresh) validateExpiresAt(formats strfmt.Registry) error { - - if err := validate.Required("expiresAt", "body", m.ExpiresAt); err != nil { - return err - } - - if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this enrollment refresh based on context it is used -func (m *EnrollmentRefresh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EnrollmentRefresh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnrollmentRefresh) UnmarshalBinary(b []byte) error { - var res EnrollmentRefresh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/entity_ref.go b/rest_model/entity_ref.go deleted file mode 100644 index e3c36030b..000000000 --- a/rest_model/entity_ref.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EntityRef A reference to another resource and links to interact with it -// -// swagger:model entityRef -type EntityRef struct { - - // links - Links Links `json:"_links"` - - // entity - Entity string `json:"entity,omitempty"` - - // id - ID string `json:"id,omitempty"` - - // name - Name string `json:"name,omitempty"` -} - -// Validate validates this entity ref -func (m *EntityRef) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EntityRef) validateLinks(formats strfmt.Registry) error { - if swag.IsZero(m.Links) { // not required - return nil - } - - if m.Links != nil { - if err := m.Links.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -// ContextValidate validate this entity ref based on the context it is used -func (m *EntityRef) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EntityRef) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EntityRef) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EntityRef) UnmarshalBinary(b []byte) error { - var res EntityRef - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/env_info.go b/rest_model/env_info.go deleted file mode 100644 index f7991c4c5..000000000 --- a/rest_model/env_info.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EnvInfo Environment information an authenticating client may provide -// -// swagger:model envInfo -type EnvInfo struct { - - // arch - Arch string `json:"arch,omitempty"` - - // os - Os string `json:"os,omitempty"` - - // os release - OsRelease string `json:"osRelease,omitempty"` - - // os version - OsVersion string `json:"osVersion,omitempty"` -} - -// Validate validates this env info -func (m *EnvInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this env info based on context it is used -func (m *EnvInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *EnvInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EnvInfo) UnmarshalBinary(b []byte) error { - var res EnvInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/external_id_claim.go b/rest_model/external_id_claim.go deleted file mode 100644 index ef5013d49..000000000 --- a/rest_model/external_id_claim.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExternalIDClaim external Id claim -// -// swagger:model externalIdClaim -type ExternalIDClaim struct { - - // index - // Required: true - Index *int64 `json:"index"` - - // location - // Required: true - // Enum: [COMMON_NAME SAN_URI SAN_EMAIL] - Location *string `json:"location"` - - // matcher - // Required: true - // Enum: [ALL PREFIX SUFFIX SCHEME] - Matcher *string `json:"matcher"` - - // matcher criteria - // Required: true - MatcherCriteria *string `json:"matcherCriteria"` - - // parser - // Required: true - // Enum: [NONE SPLIT] - Parser *string `json:"parser"` - - // parser criteria - // Required: true - ParserCriteria *string `json:"parserCriteria"` -} - -// Validate validates this external Id claim -func (m *ExternalIDClaim) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIndex(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMatcher(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMatcherCriteria(formats); err != nil { - res = append(res, err) - } - - if err := m.validateParser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateParserCriteria(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalIDClaim) validateIndex(formats strfmt.Registry) error { - - if err := validate.Required("index", "body", m.Index); err != nil { - return err - } - - return nil -} - -var externalIdClaimTypeLocationPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["COMMON_NAME","SAN_URI","SAN_EMAIL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - externalIdClaimTypeLocationPropEnum = append(externalIdClaimTypeLocationPropEnum, v) - } -} - -const ( - - // ExternalIDClaimLocationCOMMONNAME captures enum value "COMMON_NAME" - ExternalIDClaimLocationCOMMONNAME string = "COMMON_NAME" - - // ExternalIDClaimLocationSANURI captures enum value "SAN_URI" - ExternalIDClaimLocationSANURI string = "SAN_URI" - - // ExternalIDClaimLocationSANEMAIL captures enum value "SAN_EMAIL" - ExternalIDClaimLocationSANEMAIL string = "SAN_EMAIL" -) - -// prop value enum -func (m *ExternalIDClaim) validateLocationEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, externalIdClaimTypeLocationPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ExternalIDClaim) validateLocation(formats strfmt.Registry) error { - - if err := validate.Required("location", "body", m.Location); err != nil { - return err - } - - // value enum - if err := m.validateLocationEnum("location", "body", *m.Location); err != nil { - return err - } - - return nil -} - -var externalIdClaimTypeMatcherPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ALL","PREFIX","SUFFIX","SCHEME"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - externalIdClaimTypeMatcherPropEnum = append(externalIdClaimTypeMatcherPropEnum, v) - } -} - -const ( - - // ExternalIDClaimMatcherALL captures enum value "ALL" - ExternalIDClaimMatcherALL string = "ALL" - - // ExternalIDClaimMatcherPREFIX captures enum value "PREFIX" - ExternalIDClaimMatcherPREFIX string = "PREFIX" - - // ExternalIDClaimMatcherSUFFIX captures enum value "SUFFIX" - ExternalIDClaimMatcherSUFFIX string = "SUFFIX" - - // ExternalIDClaimMatcherSCHEME captures enum value "SCHEME" - ExternalIDClaimMatcherSCHEME string = "SCHEME" -) - -// prop value enum -func (m *ExternalIDClaim) validateMatcherEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, externalIdClaimTypeMatcherPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ExternalIDClaim) validateMatcher(formats strfmt.Registry) error { - - if err := validate.Required("matcher", "body", m.Matcher); err != nil { - return err - } - - // value enum - if err := m.validateMatcherEnum("matcher", "body", *m.Matcher); err != nil { - return err - } - - return nil -} - -func (m *ExternalIDClaim) validateMatcherCriteria(formats strfmt.Registry) error { - - if err := validate.Required("matcherCriteria", "body", m.MatcherCriteria); err != nil { - return err - } - - return nil -} - -var externalIdClaimTypeParserPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["NONE","SPLIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - externalIdClaimTypeParserPropEnum = append(externalIdClaimTypeParserPropEnum, v) - } -} - -const ( - - // ExternalIDClaimParserNONE captures enum value "NONE" - ExternalIDClaimParserNONE string = "NONE" - - // ExternalIDClaimParserSPLIT captures enum value "SPLIT" - ExternalIDClaimParserSPLIT string = "SPLIT" -) - -// prop value enum -func (m *ExternalIDClaim) validateParserEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, externalIdClaimTypeParserPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ExternalIDClaim) validateParser(formats strfmt.Registry) error { - - if err := validate.Required("parser", "body", m.Parser); err != nil { - return err - } - - // value enum - if err := m.validateParserEnum("parser", "body", *m.Parser); err != nil { - return err - } - - return nil -} - -func (m *ExternalIDClaim) validateParserCriteria(formats strfmt.Registry) error { - - if err := validate.Required("parserCriteria", "body", m.ParserCriteria); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this external Id claim based on context it is used -func (m *ExternalIDClaim) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ExternalIDClaim) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExternalIDClaim) UnmarshalBinary(b []byte) error { - var res ExternalIDClaim - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/external_id_claim_patch.go b/rest_model/external_id_claim_patch.go deleted file mode 100644 index 5f8848562..000000000 --- a/rest_model/external_id_claim_patch.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExternalIDClaimPatch external Id claim patch -// -// swagger:model externalIdClaimPatch -type ExternalIDClaimPatch struct { - - // index - Index *int64 `json:"index,omitempty"` - - // location - // Enum: [COMMON_NAME SAN_URI SAN_EMAIL] - Location *string `json:"location,omitempty"` - - // matcher - // Enum: [ALL PREFIX SUFFIX SCHEME] - Matcher *string `json:"matcher,omitempty"` - - // matcher criteria - MatcherCriteria *string `json:"matcherCriteria,omitempty"` - - // parser - // Enum: [NONE SPLIT] - Parser *string `json:"parser,omitempty"` - - // parser criteria - ParserCriteria *string `json:"parserCriteria,omitempty"` -} - -// Validate validates this external Id claim patch -func (m *ExternalIDClaimPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMatcher(formats); err != nil { - res = append(res, err) - } - - if err := m.validateParser(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var externalIdClaimPatchTypeLocationPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["COMMON_NAME","SAN_URI","SAN_EMAIL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - externalIdClaimPatchTypeLocationPropEnum = append(externalIdClaimPatchTypeLocationPropEnum, v) - } -} - -const ( - - // ExternalIDClaimPatchLocationCOMMONNAME captures enum value "COMMON_NAME" - ExternalIDClaimPatchLocationCOMMONNAME string = "COMMON_NAME" - - // ExternalIDClaimPatchLocationSANURI captures enum value "SAN_URI" - ExternalIDClaimPatchLocationSANURI string = "SAN_URI" - - // ExternalIDClaimPatchLocationSANEMAIL captures enum value "SAN_EMAIL" - ExternalIDClaimPatchLocationSANEMAIL string = "SAN_EMAIL" -) - -// prop value enum -func (m *ExternalIDClaimPatch) validateLocationEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, externalIdClaimPatchTypeLocationPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ExternalIDClaimPatch) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(m.Location) { // not required - return nil - } - - // value enum - if err := m.validateLocationEnum("location", "body", *m.Location); err != nil { - return err - } - - return nil -} - -var externalIdClaimPatchTypeMatcherPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ALL","PREFIX","SUFFIX","SCHEME"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - externalIdClaimPatchTypeMatcherPropEnum = append(externalIdClaimPatchTypeMatcherPropEnum, v) - } -} - -const ( - - // ExternalIDClaimPatchMatcherALL captures enum value "ALL" - ExternalIDClaimPatchMatcherALL string = "ALL" - - // ExternalIDClaimPatchMatcherPREFIX captures enum value "PREFIX" - ExternalIDClaimPatchMatcherPREFIX string = "PREFIX" - - // ExternalIDClaimPatchMatcherSUFFIX captures enum value "SUFFIX" - ExternalIDClaimPatchMatcherSUFFIX string = "SUFFIX" - - // ExternalIDClaimPatchMatcherSCHEME captures enum value "SCHEME" - ExternalIDClaimPatchMatcherSCHEME string = "SCHEME" -) - -// prop value enum -func (m *ExternalIDClaimPatch) validateMatcherEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, externalIdClaimPatchTypeMatcherPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ExternalIDClaimPatch) validateMatcher(formats strfmt.Registry) error { - if swag.IsZero(m.Matcher) { // not required - return nil - } - - // value enum - if err := m.validateMatcherEnum("matcher", "body", *m.Matcher); err != nil { - return err - } - - return nil -} - -var externalIdClaimPatchTypeParserPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["NONE","SPLIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - externalIdClaimPatchTypeParserPropEnum = append(externalIdClaimPatchTypeParserPropEnum, v) - } -} - -const ( - - // ExternalIDClaimPatchParserNONE captures enum value "NONE" - ExternalIDClaimPatchParserNONE string = "NONE" - - // ExternalIDClaimPatchParserSPLIT captures enum value "SPLIT" - ExternalIDClaimPatchParserSPLIT string = "SPLIT" -) - -// prop value enum -func (m *ExternalIDClaimPatch) validateParserEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, externalIdClaimPatchTypeParserPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ExternalIDClaimPatch) validateParser(formats strfmt.Registry) error { - if swag.IsZero(m.Parser) { // not required - return nil - } - - // value enum - if err := m.validateParserEnum("parser", "body", *m.Parser); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this external Id claim patch based on context it is used -func (m *ExternalIDClaimPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ExternalIDClaimPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExternalIDClaimPatch) UnmarshalBinary(b []byte) error { - var res ExternalIDClaimPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/external_jwt_signer_create.go b/rest_model/external_jwt_signer_create.go deleted file mode 100644 index 1ee7eb863..000000000 --- a/rest_model/external_jwt_signer_create.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExternalJWTSignerCreate A create Certificate Authority (CA) object -// -// swagger:model externalJwtSignerCreate -type ExternalJWTSignerCreate struct { - - // audience - // Required: true - Audience *string `json:"audience"` - - // cert pem - CertPem *string `json:"certPem,omitempty"` - - // claims property - ClaimsProperty *string `json:"claimsProperty,omitempty"` - - // enabled - // Required: true - Enabled *bool `json:"enabled"` - - // external auth Url - ExternalAuthURL *string `json:"externalAuthUrl,omitempty"` - - // issuer - // Required: true - Issuer *string `json:"issuer"` - - // jwks endpoint - // Format: uri - JwksEndpoint *strfmt.URI `json:"jwksEndpoint,omitempty"` - - // kid - Kid *string `json:"kid,omitempty"` - - // name - // Example: MyApps Signer - // Required: true - Name *string `json:"name"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // use external Id - UseExternalID *bool `json:"useExternalId,omitempty"` -} - -// Validate validates this external Jwt signer create -func (m *ExternalJWTSignerCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAudience(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssuer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJwksEndpoint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerCreate) validateAudience(formats strfmt.Registry) error { - - if err := validate.Required("audience", "body", m.Audience); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerCreate) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerCreate) validateIssuer(formats strfmt.Registry) error { - - if err := validate.Required("issuer", "body", m.Issuer); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerCreate) validateJwksEndpoint(formats strfmt.Registry) error { - if swag.IsZero(m.JwksEndpoint) { // not required - return nil - } - - if err := validate.FormatOf("jwksEndpoint", "body", "uri", m.JwksEndpoint.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this external Jwt signer create based on the context it is used -func (m *ExternalJWTSignerCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExternalJWTSignerCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExternalJWTSignerCreate) UnmarshalBinary(b []byte) error { - var res ExternalJWTSignerCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/external_jwt_signer_detail.go b/rest_model/external_jwt_signer_detail.go deleted file mode 100644 index 15113e94f..000000000 --- a/rest_model/external_jwt_signer_detail.go +++ /dev/null @@ -1,497 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExternalJWTSignerDetail A External JWT Signer resource -// -// swagger:model externalJwtSignerDetail -type ExternalJWTSignerDetail struct { - BaseEntity - - // audience - // Required: true - Audience *string `json:"audience"` - - // cert pem - // Required: true - CertPem *string `json:"certPem"` - - // claims property - // Required: true - ClaimsProperty *string `json:"claimsProperty"` - - // common name - // Required: true - CommonName *string `json:"commonName"` - - // enabled - // Required: true - Enabled *bool `json:"enabled"` - - // external auth Url - // Required: true - ExternalAuthURL *string `json:"externalAuthUrl"` - - // fingerprint - // Required: true - Fingerprint *string `json:"fingerprint"` - - // issuer - // Required: true - Issuer *string `json:"issuer"` - - // jwks endpoint - // Required: true - // Format: uri - JwksEndpoint *strfmt.URI `json:"jwksEndpoint"` - - // kid - // Required: true - Kid *string `json:"kid"` - - // name - // Example: MyApps Signer - // Required: true - Name *string `json:"name"` - - // not after - // Required: true - // Format: date-time - NotAfter *strfmt.DateTime `json:"notAfter"` - - // not before - // Required: true - // Format: date-time - NotBefore *strfmt.DateTime `json:"notBefore"` - - // use external Id - // Required: true - UseExternalID *bool `json:"useExternalId"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ExternalJWTSignerDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Audience *string `json:"audience"` - - CertPem *string `json:"certPem"` - - ClaimsProperty *string `json:"claimsProperty"` - - CommonName *string `json:"commonName"` - - Enabled *bool `json:"enabled"` - - ExternalAuthURL *string `json:"externalAuthUrl"` - - Fingerprint *string `json:"fingerprint"` - - Issuer *string `json:"issuer"` - - JwksEndpoint *strfmt.URI `json:"jwksEndpoint"` - - Kid *string `json:"kid"` - - Name *string `json:"name"` - - NotAfter *strfmt.DateTime `json:"notAfter"` - - NotBefore *strfmt.DateTime `json:"notBefore"` - - UseExternalID *bool `json:"useExternalId"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Audience = dataAO1.Audience - - m.CertPem = dataAO1.CertPem - - m.ClaimsProperty = dataAO1.ClaimsProperty - - m.CommonName = dataAO1.CommonName - - m.Enabled = dataAO1.Enabled - - m.ExternalAuthURL = dataAO1.ExternalAuthURL - - m.Fingerprint = dataAO1.Fingerprint - - m.Issuer = dataAO1.Issuer - - m.JwksEndpoint = dataAO1.JwksEndpoint - - m.Kid = dataAO1.Kid - - m.Name = dataAO1.Name - - m.NotAfter = dataAO1.NotAfter - - m.NotBefore = dataAO1.NotBefore - - m.UseExternalID = dataAO1.UseExternalID - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ExternalJWTSignerDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Audience *string `json:"audience"` - - CertPem *string `json:"certPem"` - - ClaimsProperty *string `json:"claimsProperty"` - - CommonName *string `json:"commonName"` - - Enabled *bool `json:"enabled"` - - ExternalAuthURL *string `json:"externalAuthUrl"` - - Fingerprint *string `json:"fingerprint"` - - Issuer *string `json:"issuer"` - - JwksEndpoint *strfmt.URI `json:"jwksEndpoint"` - - Kid *string `json:"kid"` - - Name *string `json:"name"` - - NotAfter *strfmt.DateTime `json:"notAfter"` - - NotBefore *strfmt.DateTime `json:"notBefore"` - - UseExternalID *bool `json:"useExternalId"` - } - - dataAO1.Audience = m.Audience - - dataAO1.CertPem = m.CertPem - - dataAO1.ClaimsProperty = m.ClaimsProperty - - dataAO1.CommonName = m.CommonName - - dataAO1.Enabled = m.Enabled - - dataAO1.ExternalAuthURL = m.ExternalAuthURL - - dataAO1.Fingerprint = m.Fingerprint - - dataAO1.Issuer = m.Issuer - - dataAO1.JwksEndpoint = m.JwksEndpoint - - dataAO1.Kid = m.Kid - - dataAO1.Name = m.Name - - dataAO1.NotAfter = m.NotAfter - - dataAO1.NotBefore = m.NotBefore - - dataAO1.UseExternalID = m.UseExternalID - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this external Jwt signer detail -func (m *ExternalJWTSignerDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAudience(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertPem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateClaimsProperty(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCommonName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalAuthURL(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFingerprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssuer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJwksEndpoint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKid(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotAfter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotBefore(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUseExternalID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerDetail) validateAudience(formats strfmt.Registry) error { - - if err := validate.Required("audience", "body", m.Audience); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateCertPem(formats strfmt.Registry) error { - - if err := validate.Required("certPem", "body", m.CertPem); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateClaimsProperty(formats strfmt.Registry) error { - - if err := validate.Required("claimsProperty", "body", m.ClaimsProperty); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateCommonName(formats strfmt.Registry) error { - - if err := validate.Required("commonName", "body", m.CommonName); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateExternalAuthURL(formats strfmt.Registry) error { - - if err := validate.Required("externalAuthUrl", "body", m.ExternalAuthURL); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateFingerprint(formats strfmt.Registry) error { - - if err := validate.Required("fingerprint", "body", m.Fingerprint); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateIssuer(formats strfmt.Registry) error { - - if err := validate.Required("issuer", "body", m.Issuer); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateJwksEndpoint(formats strfmt.Registry) error { - - if err := validate.Required("jwksEndpoint", "body", m.JwksEndpoint); err != nil { - return err - } - - if err := validate.FormatOf("jwksEndpoint", "body", "uri", m.JwksEndpoint.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateKid(formats strfmt.Registry) error { - - if err := validate.Required("kid", "body", m.Kid); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateNotAfter(formats strfmt.Registry) error { - - if err := validate.Required("notAfter", "body", m.NotAfter); err != nil { - return err - } - - if err := validate.FormatOf("notAfter", "body", "date-time", m.NotAfter.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateNotBefore(formats strfmt.Registry) error { - - if err := validate.Required("notBefore", "body", m.NotBefore); err != nil { - return err - } - - if err := validate.FormatOf("notBefore", "body", "date-time", m.NotBefore.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerDetail) validateUseExternalID(formats strfmt.Registry) error { - - if err := validate.Required("useExternalId", "body", m.UseExternalID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this external Jwt signer detail based on the context it is used -func (m *ExternalJWTSignerDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ExternalJWTSignerDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExternalJWTSignerDetail) UnmarshalBinary(b []byte) error { - var res ExternalJWTSignerDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/external_jwt_signer_list.go b/rest_model/external_jwt_signer_list.go deleted file mode 100644 index f4a07eabb..000000000 --- a/rest_model/external_jwt_signer_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ExternalJWTSignerList An array of External JWT Signers resources -// -// swagger:model externalJwtSignerList -type ExternalJWTSignerList []*ExternalJWTSignerDetail - -// Validate validates this external Jwt signer list -func (m ExternalJWTSignerList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this external Jwt signer list based on the context it is used -func (m ExternalJWTSignerList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/external_jwt_signer_patch.go b/rest_model/external_jwt_signer_patch.go deleted file mode 100644 index eb15caa5b..000000000 --- a/rest_model/external_jwt_signer_patch.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExternalJWTSignerPatch external Jwt signer patch -// -// swagger:model externalJwtSignerPatch -type ExternalJWTSignerPatch struct { - - // audience - Audience *string `json:"audience,omitempty"` - - // cert pem - CertPem *string `json:"certPem,omitempty"` - - // claims property - ClaimsProperty *string `json:"claimsProperty,omitempty"` - - // enabled - Enabled *bool `json:"enabled,omitempty"` - - // external auth Url - ExternalAuthURL *string `json:"externalAuthUrl,omitempty"` - - // issuer - Issuer *string `json:"issuer,omitempty"` - - // jwks endpoint - // Format: uri - JwksEndpoint *strfmt.URI `json:"jwksEndpoint,omitempty"` - - // kid - Kid *string `json:"kid,omitempty"` - - // name - // Example: MyApps Signer - Name *string `json:"name,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // use external Id - UseExternalID *bool `json:"useExternalId,omitempty"` -} - -// Validate validates this external Jwt signer patch -func (m *ExternalJWTSignerPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateJwksEndpoint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerPatch) validateJwksEndpoint(formats strfmt.Registry) error { - if swag.IsZero(m.JwksEndpoint) { // not required - return nil - } - - if err := validate.FormatOf("jwksEndpoint", "body", "uri", m.JwksEndpoint.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this external Jwt signer patch based on the context it is used -func (m *ExternalJWTSignerPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExternalJWTSignerPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExternalJWTSignerPatch) UnmarshalBinary(b []byte) error { - var res ExternalJWTSignerPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/external_jwt_signer_update.go b/rest_model/external_jwt_signer_update.go deleted file mode 100644 index 183974661..000000000 --- a/rest_model/external_jwt_signer_update.go +++ /dev/null @@ -1,233 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExternalJWTSignerUpdate external Jwt signer update -// -// swagger:model externalJwtSignerUpdate -type ExternalJWTSignerUpdate struct { - - // audience - // Required: true - Audience *string `json:"audience"` - - // cert pem - CertPem *string `json:"certPem,omitempty"` - - // claims property - ClaimsProperty *string `json:"claimsProperty,omitempty"` - - // enabled - // Required: true - Enabled *bool `json:"enabled"` - - // external auth Url - ExternalAuthURL *string `json:"externalAuthUrl,omitempty"` - - // issuer - // Required: true - Issuer *string `json:"issuer"` - - // jwks endpoint - // Format: uri - JwksEndpoint *strfmt.URI `json:"jwksEndpoint,omitempty"` - - // kid - Kid *string `json:"kid,omitempty"` - - // name - // Example: MyApps Signer - // Required: true - Name *string `json:"name"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // use external Id - UseExternalID *bool `json:"useExternalId,omitempty"` -} - -// Validate validates this external Jwt signer update -func (m *ExternalJWTSignerUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAudience(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssuer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateJwksEndpoint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerUpdate) validateAudience(formats strfmt.Registry) error { - - if err := validate.Required("audience", "body", m.Audience); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerUpdate) validateEnabled(formats strfmt.Registry) error { - - if err := validate.Required("enabled", "body", m.Enabled); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerUpdate) validateIssuer(formats strfmt.Registry) error { - - if err := validate.Required("issuer", "body", m.Issuer); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerUpdate) validateJwksEndpoint(formats strfmt.Registry) error { - if swag.IsZero(m.JwksEndpoint) { // not required - return nil - } - - if err := validate.FormatOf("jwksEndpoint", "body", "uri", m.JwksEndpoint.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ExternalJWTSignerUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this external Jwt signer update based on the context it is used -func (m *ExternalJWTSignerUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExternalJWTSignerUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExternalJWTSignerUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExternalJWTSignerUpdate) UnmarshalBinary(b []byte) error { - var res ExternalJWTSignerUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/failed_service_request.go b/rest_model/failed_service_request.go deleted file mode 100644 index 60609bc6c..000000000 --- a/rest_model/failed_service_request.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FailedServiceRequest failed service request -// -// swagger:model failedServiceRequest -type FailedServiceRequest struct { - - // api session Id - APISessionID string `json:"apiSessionId,omitempty"` - - // policy failures - PolicyFailures []*PolicyFailure `json:"policyFailures"` - - // service Id - ServiceID string `json:"serviceId,omitempty"` - - // service name - ServiceName string `json:"serviceName,omitempty"` - - // session type - SessionType DialBind `json:"sessionType,omitempty"` - - // when - // Format: date-time - When strfmt.DateTime `json:"when,omitempty"` -} - -// Validate validates this failed service request -func (m *FailedServiceRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePolicyFailures(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWhen(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FailedServiceRequest) validatePolicyFailures(formats strfmt.Registry) error { - if swag.IsZero(m.PolicyFailures) { // not required - return nil - } - - for i := 0; i < len(m.PolicyFailures); i++ { - if swag.IsZero(m.PolicyFailures[i]) { // not required - continue - } - - if m.PolicyFailures[i] != nil { - if err := m.PolicyFailures[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("policyFailures" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("policyFailures" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *FailedServiceRequest) validateSessionType(formats strfmt.Registry) error { - if swag.IsZero(m.SessionType) { // not required - return nil - } - - if err := m.SessionType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sessionType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sessionType") - } - return err - } - - return nil -} - -func (m *FailedServiceRequest) validateWhen(formats strfmt.Registry) error { - if swag.IsZero(m.When) { // not required - return nil - } - - if err := validate.FormatOf("when", "body", "date-time", m.When.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this failed service request based on the context it is used -func (m *FailedServiceRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePolicyFailures(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSessionType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FailedServiceRequest) contextValidatePolicyFailures(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PolicyFailures); i++ { - - if m.PolicyFailures[i] != nil { - if err := m.PolicyFailures[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("policyFailures" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("policyFailures" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *FailedServiceRequest) contextValidateSessionType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SessionType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sessionType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sessionType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *FailedServiceRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FailedServiceRequest) UnmarshalBinary(b []byte) error { - var res FailedServiceRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/failed_service_request_envelope.go b/rest_model/failed_service_request_envelope.go deleted file mode 100644 index 52eacbc2f..000000000 --- a/rest_model/failed_service_request_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FailedServiceRequestEnvelope failed service request envelope -// -// swagger:model failedServiceRequestEnvelope -type FailedServiceRequestEnvelope struct { - - // data - // Required: true - Data FailedServiceRequestList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this failed service request envelope -func (m *FailedServiceRequestEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FailedServiceRequestEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *FailedServiceRequestEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this failed service request envelope based on the context it is used -func (m *FailedServiceRequestEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FailedServiceRequestEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *FailedServiceRequestEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *FailedServiceRequestEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FailedServiceRequestEnvelope) UnmarshalBinary(b []byte) error { - var res FailedServiceRequestEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/failed_service_request_list.go b/rest_model/failed_service_request_list.go deleted file mode 100644 index 82d3efe5e..000000000 --- a/rest_model/failed_service_request_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// FailedServiceRequestList failed service request list -// -// swagger:model failedServiceRequestList -type FailedServiceRequestList []*FailedServiceRequest - -// Validate validates this failed service request list -func (m FailedServiceRequestList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this failed service request list based on the context it is used -func (m FailedServiceRequestList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/get_identity_policy_advice_envelope.go b/rest_model/get_identity_policy_advice_envelope.go deleted file mode 100644 index ec35502b7..000000000 --- a/rest_model/get_identity_policy_advice_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GetIdentityPolicyAdviceEnvelope get identity policy advice envelope -// -// swagger:model getIdentityPolicyAdviceEnvelope -type GetIdentityPolicyAdviceEnvelope struct { - - // data - // Required: true - Data *PolicyAdvice `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this get identity policy advice envelope -func (m *GetIdentityPolicyAdviceEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetIdentityPolicyAdviceEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *GetIdentityPolicyAdviceEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this get identity policy advice envelope based on the context it is used -func (m *GetIdentityPolicyAdviceEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GetIdentityPolicyAdviceEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *GetIdentityPolicyAdviceEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GetIdentityPolicyAdviceEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GetIdentityPolicyAdviceEnvelope) UnmarshalBinary(b []byte) error { - var res GetIdentityPolicyAdviceEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_authenticators.go b/rest_model/identity_authenticators.go deleted file mode 100644 index 4b243de2a..000000000 --- a/rest_model/identity_authenticators.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityAuthenticators identity authenticators -// -// swagger:model identityAuthenticators -type IdentityAuthenticators struct { - - // cert - Cert *IdentityAuthenticatorsCert `json:"cert,omitempty"` - - // updb - Updb *IdentityAuthenticatorsUpdb `json:"updb,omitempty"` -} - -// Validate validates this identity authenticators -func (m *IdentityAuthenticators) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCert(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdb(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityAuthenticators) validateCert(formats strfmt.Registry) error { - if swag.IsZero(m.Cert) { // not required - return nil - } - - if m.Cert != nil { - if err := m.Cert.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cert") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cert") - } - return err - } - } - - return nil -} - -func (m *IdentityAuthenticators) validateUpdb(formats strfmt.Registry) error { - if swag.IsZero(m.Updb) { // not required - return nil - } - - if m.Updb != nil { - if err := m.Updb.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// ContextValidate validate this identity authenticators based on the context it is used -func (m *IdentityAuthenticators) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCert(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdb(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityAuthenticators) contextValidateCert(ctx context.Context, formats strfmt.Registry) error { - - if m.Cert != nil { - if err := m.Cert.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cert") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cert") - } - return err - } - } - - return nil -} - -func (m *IdentityAuthenticators) contextValidateUpdb(ctx context.Context, formats strfmt.Registry) error { - - if m.Updb != nil { - if err := m.Updb.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityAuthenticators) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityAuthenticators) UnmarshalBinary(b []byte) error { - var res IdentityAuthenticators - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// IdentityAuthenticatorsCert identity authenticators cert -// -// swagger:model IdentityAuthenticatorsCert -type IdentityAuthenticatorsCert struct { - - // fingerprint - Fingerprint string `json:"fingerprint,omitempty"` - - // id - ID string `json:"id,omitempty"` -} - -// Validate validates this identity authenticators cert -func (m *IdentityAuthenticatorsCert) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this identity authenticators cert based on context it is used -func (m *IdentityAuthenticatorsCert) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityAuthenticatorsCert) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityAuthenticatorsCert) UnmarshalBinary(b []byte) error { - var res IdentityAuthenticatorsCert - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// IdentityAuthenticatorsUpdb identity authenticators updb -// -// swagger:model IdentityAuthenticatorsUpdb -type IdentityAuthenticatorsUpdb struct { - - // id - ID string `json:"id,omitempty"` - - // username - Username string `json:"username,omitempty"` -} - -// Validate validates this identity authenticators updb -func (m *IdentityAuthenticatorsUpdb) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this identity authenticators updb based on context it is used -func (m *IdentityAuthenticatorsUpdb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityAuthenticatorsUpdb) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityAuthenticatorsUpdb) UnmarshalBinary(b []byte) error { - var res IdentityAuthenticatorsUpdb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_create.go b/rest_model/identity_create.go deleted file mode 100644 index c43663fc8..000000000 --- a/rest_model/identity_create.go +++ /dev/null @@ -1,578 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IdentityCreate An identity to create -// -// swagger:model identityCreate -type IdentityCreate struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // auth policy Id - AuthPolicyID *string `json:"authPolicyId,omitempty"` - - // default hosting cost - DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"` - - // default hosting precedence - DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` - - // enrollment - Enrollment *IdentityCreateEnrollment `json:"enrollment,omitempty"` - - // external Id - ExternalID *string `json:"externalId,omitempty"` - - // is admin - // Required: true - IsAdmin *bool `json:"isAdmin"` - - // name - // Required: true - Name *string `json:"name"` - - // role attributes - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - // service hosting costs - ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts,omitempty"` - - // service hosting precedences - ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - // Required: true - Type *IdentityType `json:"type"` -} - -// Validate validates this identity create -func (m *IdentityCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingPrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrollment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAdmin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingCosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingPrecedences(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityCreate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required - return nil - } - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingPrecedence) { // not required - return nil - } - - if err := m.DefaultHostingPrecedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityCreate) validateEnrollment(formats strfmt.Registry) error { - if swag.IsZero(m.Enrollment) { // not required - return nil - } - - if m.Enrollment != nil { - if err := m.Enrollment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrollment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrollment") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateIsAdmin(formats strfmt.Registry) error { - - if err := validate.Required("isAdmin", "body", m.IsAdmin); err != nil { - return err - } - - return nil -} - -func (m *IdentityCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *IdentityCreate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required - return nil - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateServiceHostingCosts(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingCosts) { // not required - return nil - } - - if m.ServiceHostingCosts != nil { - if err := m.ServiceHostingCosts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateServiceHostingPrecedences(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingPrecedences) { // not required - return nil - } - - if m.ServiceHostingPrecedences != nil { - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this identity create based on the context it is used -func (m *IdentityCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingPrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnrollment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingCosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingPrecedences(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityCreate) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) contextValidateDefaultHostingCost(ctx context.Context, formats strfmt.Registry) error { - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) contextValidateDefaultHostingPrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DefaultHostingPrecedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityCreate) contextValidateEnrollment(ctx context.Context, formats strfmt.Registry) error { - - if m.Enrollment != nil { - if err := m.Enrollment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrollment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrollment") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) contextValidateServiceHostingCosts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingCosts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - - return nil -} - -func (m *IdentityCreate) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - - return nil -} - -func (m *IdentityCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *IdentityCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityCreate) UnmarshalBinary(b []byte) error { - var res IdentityCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// IdentityCreateEnrollment identity create enrollment -// -// swagger:model IdentityCreateEnrollment -type IdentityCreateEnrollment struct { - - // ott - Ott bool `json:"ott,omitempty"` - - // ottca - Ottca string `json:"ottca,omitempty"` - - // updb - Updb string `json:"updb,omitempty"` -} - -// Validate validates this identity create enrollment -func (m *IdentityCreateEnrollment) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this identity create enrollment based on context it is used -func (m *IdentityCreateEnrollment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityCreateEnrollment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityCreateEnrollment) UnmarshalBinary(b []byte) error { - var res IdentityCreateEnrollment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_detail.go b/rest_model/identity_detail.go deleted file mode 100644 index f711e4fab..000000000 --- a/rest_model/identity_detail.go +++ /dev/null @@ -1,1049 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IdentityDetail Detail of a specific identity -// -// swagger:model identityDetail -type IdentityDetail struct { - BaseEntity - - // app data - AppData *Tags `json:"appData,omitempty"` - - // auth policy Id - // Required: true - AuthPolicyID *string `json:"authPolicyId"` - - // authenticators - // Required: true - Authenticators *IdentityAuthenticators `json:"authenticators"` - - // default hosting cost - // Required: true - DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"` - - // default hosting precedence - DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` - - // disabled - // Required: true - Disabled *bool `json:"disabled"` - - // disabled at - // Format: date-time - DisabledAt *strfmt.DateTime `json:"disabledAt,omitempty"` - - // disabled until - // Format: date-time - DisabledUntil *strfmt.DateTime `json:"disabledUntil,omitempty"` - - // enrollment - // Required: true - Enrollment *IdentityEnrollments `json:"enrollment"` - - // env info - // Required: true - EnvInfo *EnvInfo `json:"envInfo"` - - // external Id - // Required: true - ExternalID *string `json:"externalId"` - - // has Api session - // Required: true - HasAPISession *bool `json:"hasApiSession"` - - // has edge router connection - // Required: true - HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"` - - // is admin - // Required: true - IsAdmin *bool `json:"isAdmin"` - - // is default admin - // Required: true - IsDefaultAdmin *bool `json:"isDefaultAdmin"` - - // is mfa enabled - // Required: true - IsMfaEnabled *bool `json:"isMfaEnabled"` - - // name - // Required: true - Name *string `json:"name"` - - // role attributes - // Required: true - RoleAttributes *Attributes `json:"roleAttributes"` - - // sdk info - // Required: true - SdkInfo *SdkInfo `json:"sdkInfo"` - - // service hosting costs - // Required: true - ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts"` - - // service hosting precedences - // Required: true - ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences"` - - // type - // Required: true - Type *EntityRef `json:"type"` - - // type Id - // Required: true - TypeID *string `json:"typeId"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *IdentityDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - AppData *Tags `json:"appData,omitempty"` - - AuthPolicyID *string `json:"authPolicyId"` - - Authenticators *IdentityAuthenticators `json:"authenticators"` - - DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"` - - DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` - - Disabled *bool `json:"disabled"` - - DisabledAt *strfmt.DateTime `json:"disabledAt,omitempty"` - - DisabledUntil *strfmt.DateTime `json:"disabledUntil,omitempty"` - - Enrollment *IdentityEnrollments `json:"enrollment"` - - EnvInfo *EnvInfo `json:"envInfo"` - - ExternalID *string `json:"externalId"` - - HasAPISession *bool `json:"hasApiSession"` - - HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"` - - IsAdmin *bool `json:"isAdmin"` - - IsDefaultAdmin *bool `json:"isDefaultAdmin"` - - IsMfaEnabled *bool `json:"isMfaEnabled"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - SdkInfo *SdkInfo `json:"sdkInfo"` - - ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts"` - - ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences"` - - Type *EntityRef `json:"type"` - - TypeID *string `json:"typeId"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.AppData = dataAO1.AppData - - m.AuthPolicyID = dataAO1.AuthPolicyID - - m.Authenticators = dataAO1.Authenticators - - m.DefaultHostingCost = dataAO1.DefaultHostingCost - - m.DefaultHostingPrecedence = dataAO1.DefaultHostingPrecedence - - m.Disabled = dataAO1.Disabled - - m.DisabledAt = dataAO1.DisabledAt - - m.DisabledUntil = dataAO1.DisabledUntil - - m.Enrollment = dataAO1.Enrollment - - m.EnvInfo = dataAO1.EnvInfo - - m.ExternalID = dataAO1.ExternalID - - m.HasAPISession = dataAO1.HasAPISession - - m.HasEdgeRouterConnection = dataAO1.HasEdgeRouterConnection - - m.IsAdmin = dataAO1.IsAdmin - - m.IsDefaultAdmin = dataAO1.IsDefaultAdmin - - m.IsMfaEnabled = dataAO1.IsMfaEnabled - - m.Name = dataAO1.Name - - m.RoleAttributes = dataAO1.RoleAttributes - - m.SdkInfo = dataAO1.SdkInfo - - m.ServiceHostingCosts = dataAO1.ServiceHostingCosts - - m.ServiceHostingPrecedences = dataAO1.ServiceHostingPrecedences - - m.Type = dataAO1.Type - - m.TypeID = dataAO1.TypeID - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m IdentityDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - AppData *Tags `json:"appData,omitempty"` - - AuthPolicyID *string `json:"authPolicyId"` - - Authenticators *IdentityAuthenticators `json:"authenticators"` - - DefaultHostingCost *TerminatorCost `json:"defaultHostingCost"` - - DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` - - Disabled *bool `json:"disabled"` - - DisabledAt *strfmt.DateTime `json:"disabledAt,omitempty"` - - DisabledUntil *strfmt.DateTime `json:"disabledUntil,omitempty"` - - Enrollment *IdentityEnrollments `json:"enrollment"` - - EnvInfo *EnvInfo `json:"envInfo"` - - ExternalID *string `json:"externalId"` - - HasAPISession *bool `json:"hasApiSession"` - - HasEdgeRouterConnection *bool `json:"hasEdgeRouterConnection"` - - IsAdmin *bool `json:"isAdmin"` - - IsDefaultAdmin *bool `json:"isDefaultAdmin"` - - IsMfaEnabled *bool `json:"isMfaEnabled"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - SdkInfo *SdkInfo `json:"sdkInfo"` - - ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts"` - - ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences"` - - Type *EntityRef `json:"type"` - - TypeID *string `json:"typeId"` - } - - dataAO1.AppData = m.AppData - - dataAO1.AuthPolicyID = m.AuthPolicyID - - dataAO1.Authenticators = m.Authenticators - - dataAO1.DefaultHostingCost = m.DefaultHostingCost - - dataAO1.DefaultHostingPrecedence = m.DefaultHostingPrecedence - - dataAO1.Disabled = m.Disabled - - dataAO1.DisabledAt = m.DisabledAt - - dataAO1.DisabledUntil = m.DisabledUntil - - dataAO1.Enrollment = m.Enrollment - - dataAO1.EnvInfo = m.EnvInfo - - dataAO1.ExternalID = m.ExternalID - - dataAO1.HasAPISession = m.HasAPISession - - dataAO1.HasEdgeRouterConnection = m.HasEdgeRouterConnection - - dataAO1.IsAdmin = m.IsAdmin - - dataAO1.IsDefaultAdmin = m.IsDefaultAdmin - - dataAO1.IsMfaEnabled = m.IsMfaEnabled - - dataAO1.Name = m.Name - - dataAO1.RoleAttributes = m.RoleAttributes - - dataAO1.SdkInfo = m.SdkInfo - - dataAO1.ServiceHostingCosts = m.ServiceHostingCosts - - dataAO1.ServiceHostingPrecedences = m.ServiceHostingPrecedences - - dataAO1.Type = m.Type - - dataAO1.TypeID = m.TypeID - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this identity detail -func (m *IdentityDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAuthPolicyID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAuthenticators(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingPrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisabledAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDisabledUntil(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrollment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnvInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExternalID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasAPISession(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasEdgeRouterConnection(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAdmin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsDefaultAdmin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsMfaEnabled(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSdkInfo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingCosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingPrecedences(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTypeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityDetail) validateAppData(formats strfmt.Registry) error { - - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateAuthPolicyID(formats strfmt.Registry) error { - - if err := validate.Required("authPolicyId", "body", m.AuthPolicyID); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateAuthenticators(formats strfmt.Registry) error { - - if err := validate.Required("authenticators", "body", m.Authenticators); err != nil { - return err - } - - if m.Authenticators != nil { - if err := m.Authenticators.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authenticators") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authenticators") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateDefaultHostingCost(formats strfmt.Registry) error { - - if err := validate.Required("defaultHostingCost", "body", m.DefaultHostingCost); err != nil { - return err - } - - if err := validate.Required("defaultHostingCost", "body", m.DefaultHostingCost); err != nil { - return err - } - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - - if swag.IsZero(m.DefaultHostingPrecedence) { // not required - return nil - } - - if err := m.DefaultHostingPrecedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityDetail) validateDisabled(formats strfmt.Registry) error { - - if err := validate.Required("disabled", "body", m.Disabled); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateDisabledAt(formats strfmt.Registry) error { - - if swag.IsZero(m.DisabledAt) { // not required - return nil - } - - if err := validate.FormatOf("disabledAt", "body", "date-time", m.DisabledAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateDisabledUntil(formats strfmt.Registry) error { - - if swag.IsZero(m.DisabledUntil) { // not required - return nil - } - - if err := validate.FormatOf("disabledUntil", "body", "date-time", m.DisabledUntil.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateEnrollment(formats strfmt.Registry) error { - - if err := validate.Required("enrollment", "body", m.Enrollment); err != nil { - return err - } - - if m.Enrollment != nil { - if err := m.Enrollment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrollment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrollment") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateEnvInfo(formats strfmt.Registry) error { - - if err := validate.Required("envInfo", "body", m.EnvInfo); err != nil { - return err - } - - if m.EnvInfo != nil { - if err := m.EnvInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("envInfo") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateExternalID(formats strfmt.Registry) error { - - if err := validate.Required("externalId", "body", m.ExternalID); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateHasAPISession(formats strfmt.Registry) error { - - if err := validate.Required("hasApiSession", "body", m.HasAPISession); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateHasEdgeRouterConnection(formats strfmt.Registry) error { - - if err := validate.Required("hasEdgeRouterConnection", "body", m.HasEdgeRouterConnection); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateIsAdmin(formats strfmt.Registry) error { - - if err := validate.Required("isAdmin", "body", m.IsAdmin); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateIsDefaultAdmin(formats strfmt.Registry) error { - - if err := validate.Required("isDefaultAdmin", "body", m.IsDefaultAdmin); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateIsMfaEnabled(formats strfmt.Registry) error { - - if err := validate.Required("isMfaEnabled", "body", m.IsMfaEnabled); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *IdentityDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes); err != nil { - return err - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateSdkInfo(formats strfmt.Registry) error { - - if err := validate.Required("sdkInfo", "body", m.SdkInfo); err != nil { - return err - } - - if m.SdkInfo != nil { - if err := m.SdkInfo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sdkInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sdkInfo") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateServiceHostingCosts(formats strfmt.Registry) error { - - if err := validate.Required("serviceHostingCosts", "body", m.ServiceHostingCosts); err != nil { - return err - } - - if m.ServiceHostingCosts != nil { - if err := m.ServiceHostingCosts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateServiceHostingPrecedences(formats strfmt.Registry) error { - - if err := validate.Required("serviceHostingPrecedences", "body", m.ServiceHostingPrecedences); err != nil { - return err - } - - if m.ServiceHostingPrecedences != nil { - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) validateTypeID(formats strfmt.Registry) error { - - if err := validate.Required("typeId", "body", m.TypeID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this identity detail based on the context it is used -func (m *IdentityDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAuthenticators(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingPrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnrollment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEnvInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSdkInfo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingCosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingPrecedences(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityDetail) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateAuthenticators(ctx context.Context, formats strfmt.Registry) error { - - if m.Authenticators != nil { - if err := m.Authenticators.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("authenticators") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("authenticators") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateDefaultHostingCost(ctx context.Context, formats strfmt.Registry) error { - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateDefaultHostingPrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DefaultHostingPrecedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityDetail) contextValidateEnrollment(ctx context.Context, formats strfmt.Registry) error { - - if m.Enrollment != nil { - if err := m.Enrollment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("enrollment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("enrollment") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateEnvInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.EnvInfo != nil { - if err := m.EnvInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("envInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("envInfo") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateSdkInfo(ctx context.Context, formats strfmt.Registry) error { - - if m.SdkInfo != nil { - if err := m.SdkInfo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sdkInfo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sdkInfo") - } - return err - } - } - - return nil -} - -func (m *IdentityDetail) contextValidateServiceHostingCosts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingCosts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - - return nil -} - -func (m *IdentityDetail) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - - return nil -} - -func (m *IdentityDetail) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityDetail) UnmarshalBinary(b []byte) error { - var res IdentityDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_enrollments.go b/rest_model/identity_enrollments.go deleted file mode 100644 index 40b746a96..000000000 --- a/rest_model/identity_enrollments.go +++ /dev/null @@ -1,479 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IdentityEnrollments identity enrollments -// -// swagger:model identityEnrollments -type IdentityEnrollments struct { - - // ott - Ott *IdentityEnrollmentsOtt `json:"ott,omitempty"` - - // ottca - Ottca *IdentityEnrollmentsOttca `json:"ottca,omitempty"` - - // updb - Updb *IdentityEnrollmentsUpdb `json:"updb,omitempty"` -} - -// Validate validates this identity enrollments -func (m *IdentityEnrollments) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOtt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOttca(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdb(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityEnrollments) validateOtt(formats strfmt.Registry) error { - if swag.IsZero(m.Ott) { // not required - return nil - } - - if m.Ott != nil { - if err := m.Ott.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ott") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ott") - } - return err - } - } - - return nil -} - -func (m *IdentityEnrollments) validateOttca(formats strfmt.Registry) error { - if swag.IsZero(m.Ottca) { // not required - return nil - } - - if m.Ottca != nil { - if err := m.Ottca.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ottca") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ottca") - } - return err - } - } - - return nil -} - -func (m *IdentityEnrollments) validateUpdb(formats strfmt.Registry) error { - if swag.IsZero(m.Updb) { // not required - return nil - } - - if m.Updb != nil { - if err := m.Updb.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// ContextValidate validate this identity enrollments based on the context it is used -func (m *IdentityEnrollments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOtt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOttca(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdb(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityEnrollments) contextValidateOtt(ctx context.Context, formats strfmt.Registry) error { - - if m.Ott != nil { - if err := m.Ott.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ott") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ott") - } - return err - } - } - - return nil -} - -func (m *IdentityEnrollments) contextValidateOttca(ctx context.Context, formats strfmt.Registry) error { - - if m.Ottca != nil { - if err := m.Ottca.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ottca") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ottca") - } - return err - } - } - - return nil -} - -func (m *IdentityEnrollments) contextValidateUpdb(ctx context.Context, formats strfmt.Registry) error { - - if m.Updb != nil { - if err := m.Updb.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("updb") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("updb") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityEnrollments) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityEnrollments) UnmarshalBinary(b []byte) error { - var res IdentityEnrollments - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// IdentityEnrollmentsOtt identity enrollments ott -// -// swagger:model IdentityEnrollmentsOtt -type IdentityEnrollmentsOtt struct { - - // expires at - // Format: date-time - ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"` - - // id - ID string `json:"id,omitempty"` - - // jwt - JWT string `json:"jwt,omitempty"` - - // token - Token string `json:"token,omitempty"` -} - -// Validate validates this identity enrollments ott -func (m *IdentityEnrollmentsOtt) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityEnrollmentsOtt) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("ott"+"."+"expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this identity enrollments ott based on context it is used -func (m *IdentityEnrollmentsOtt) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityEnrollmentsOtt) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityEnrollmentsOtt) UnmarshalBinary(b []byte) error { - var res IdentityEnrollmentsOtt - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// IdentityEnrollmentsOttca identity enrollments ottca -// -// swagger:model IdentityEnrollmentsOttca -type IdentityEnrollmentsOttca struct { - - // ca - Ca *EntityRef `json:"ca,omitempty"` - - // ca Id - CaID string `json:"caId,omitempty"` - - // expires at - // Format: date-time - ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"` - - // id - ID string `json:"id,omitempty"` - - // jwt - JWT string `json:"jwt,omitempty"` - - // token - Token string `json:"token,omitempty"` -} - -// Validate validates this identity enrollments ottca -func (m *IdentityEnrollmentsOttca) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCa(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityEnrollmentsOttca) validateCa(formats strfmt.Registry) error { - if swag.IsZero(m.Ca) { // not required - return nil - } - - if m.Ca != nil { - if err := m.Ca.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ottca" + "." + "ca") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ottca" + "." + "ca") - } - return err - } - } - - return nil -} - -func (m *IdentityEnrollmentsOttca) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("ottca"+"."+"expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this identity enrollments ottca based on the context it is used -func (m *IdentityEnrollmentsOttca) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCa(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityEnrollmentsOttca) contextValidateCa(ctx context.Context, formats strfmt.Registry) error { - - if m.Ca != nil { - if err := m.Ca.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ottca" + "." + "ca") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ottca" + "." + "ca") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityEnrollmentsOttca) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityEnrollmentsOttca) UnmarshalBinary(b []byte) error { - var res IdentityEnrollmentsOttca - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// IdentityEnrollmentsUpdb identity enrollments updb -// -// swagger:model IdentityEnrollmentsUpdb -type IdentityEnrollmentsUpdb struct { - - // expires at - // Format: date-time - ExpiresAt strfmt.DateTime `json:"expiresAt,omitempty"` - - // id - ID string `json:"id,omitempty"` - - // jwt - JWT string `json:"jwt,omitempty"` - - // token - Token string `json:"token,omitempty"` -} - -// Validate validates this identity enrollments updb -func (m *IdentityEnrollmentsUpdb) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityEnrollmentsUpdb) validateExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("updb"+"."+"expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this identity enrollments updb based on context it is used -func (m *IdentityEnrollmentsUpdb) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityEnrollmentsUpdb) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityEnrollmentsUpdb) UnmarshalBinary(b []byte) error { - var res IdentityEnrollmentsUpdb - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_extend_certs.go b/rest_model/identity_extend_certs.go deleted file mode 100644 index 1120c5384..000000000 --- a/rest_model/identity_extend_certs.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityExtendCerts identity extend certs -// -// swagger:model identityExtendCerts -type IdentityExtendCerts struct { - - // A PEM encoded set of CA certificates - Ca string `json:"ca,omitempty"` - - // A PEM encoded client certificate - ClientCert string `json:"clientCert,omitempty"` -} - -// Validate validates this identity extend certs -func (m *IdentityExtendCerts) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this identity extend certs based on context it is used -func (m *IdentityExtendCerts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityExtendCerts) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityExtendCerts) UnmarshalBinary(b []byte) error { - var res IdentityExtendCerts - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_extend_enrollment_envelope.go b/rest_model/identity_extend_enrollment_envelope.go deleted file mode 100644 index b195921f4..000000000 --- a/rest_model/identity_extend_enrollment_envelope.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityExtendEnrollmentEnvelope identity extend enrollment envelope -// -// swagger:model identityExtendEnrollmentEnvelope -type IdentityExtendEnrollmentEnvelope struct { - - // data - Data *IdentityExtendCerts `json:"data,omitempty"` - - // meta - Meta *Meta `json:"meta,omitempty"` -} - -// Validate validates this identity extend enrollment envelope -func (m *IdentityExtendEnrollmentEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityExtendEnrollmentEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *IdentityExtendEnrollmentEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this identity extend enrollment envelope based on the context it is used -func (m *IdentityExtendEnrollmentEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityExtendEnrollmentEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *IdentityExtendEnrollmentEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityExtendEnrollmentEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityExtendEnrollmentEnvelope) UnmarshalBinary(b []byte) error { - var res IdentityExtendEnrollmentEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_extend_enrollment_request.go b/rest_model/identity_extend_enrollment_request.go deleted file mode 100644 index 6306f03be..000000000 --- a/rest_model/identity_extend_enrollment_request.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IdentityExtendEnrollmentRequest identity extend enrollment request -// -// swagger:model identityExtendEnrollmentRequest -type IdentityExtendEnrollmentRequest struct { - - // client cert csr - // Required: true - ClientCertCsr *string `json:"clientCertCsr"` -} - -// Validate validates this identity extend enrollment request -func (m *IdentityExtendEnrollmentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClientCertCsr(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityExtendEnrollmentRequest) validateClientCertCsr(formats strfmt.Registry) error { - - if err := validate.Required("clientCertCsr", "body", m.ClientCertCsr); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this identity extend enrollment request based on context it is used -func (m *IdentityExtendEnrollmentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityExtendEnrollmentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityExtendEnrollmentRequest) UnmarshalBinary(b []byte) error { - var res IdentityExtendEnrollmentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_extend_validate_enrollment_request.go b/rest_model/identity_extend_validate_enrollment_request.go deleted file mode 100644 index f8dfaff6f..000000000 --- a/rest_model/identity_extend_validate_enrollment_request.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IdentityExtendValidateEnrollmentRequest identity extend validate enrollment request -// -// swagger:model identityExtendValidateEnrollmentRequest -type IdentityExtendValidateEnrollmentRequest struct { - - // A PEM encoded client certificate previously returned after an extension request - // Required: true - ClientCert *string `json:"clientCert"` -} - -// Validate validates this identity extend validate enrollment request -func (m *IdentityExtendValidateEnrollmentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateClientCert(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityExtendValidateEnrollmentRequest) validateClientCert(formats strfmt.Registry) error { - - if err := validate.Required("clientCert", "body", m.ClientCert); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this identity extend validate enrollment request based on context it is used -func (m *IdentityExtendValidateEnrollmentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityExtendValidateEnrollmentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityExtendValidateEnrollmentRequest) UnmarshalBinary(b []byte) error { - var res IdentityExtendValidateEnrollmentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_list.go b/rest_model/identity_list.go deleted file mode 100644 index be98ce91a..000000000 --- a/rest_model/identity_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityList A list of identities -// -// swagger:model identityList -type IdentityList []*IdentityDetail - -// Validate validates this identity list -func (m IdentityList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this identity list based on the context it is used -func (m IdentityList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/identity_patch.go b/rest_model/identity_patch.go deleted file mode 100644 index 54d2dfd59..000000000 --- a/rest_model/identity_patch.go +++ /dev/null @@ -1,450 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityPatch identity patch -// -// swagger:model identityPatch -type IdentityPatch struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // auth policy Id - AuthPolicyID *string `json:"authPolicyId,omitempty"` - - // default hosting cost - DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"` - - // default hosting precedence - DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` - - // external Id - ExternalID *string `json:"externalId,omitempty"` - - // is admin - IsAdmin *bool `json:"isAdmin,omitempty"` - - // name - Name *string `json:"name,omitempty"` - - // role attributes - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - // service hosting costs - ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts,omitempty"` - - // service hosting precedences - ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - Type IdentityType `json:"type,omitempty"` -} - -// Validate validates this identity patch -func (m *IdentityPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingPrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingCosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingPrecedences(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityPatch) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required - return nil - } - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingPrecedence) { // not required - return nil - } - - if err := m.DefaultHostingPrecedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityPatch) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required - return nil - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) validateServiceHostingCosts(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingCosts) { // not required - return nil - } - - if m.ServiceHostingCosts != nil { - if err := m.ServiceHostingCosts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) validateServiceHostingPrecedences(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingPrecedences) { // not required - return nil - } - - if m.ServiceHostingPrecedences != nil { - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this identity patch based on the context it is used -func (m *IdentityPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingPrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingCosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingPrecedences(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityPatch) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) contextValidateDefaultHostingCost(ctx context.Context, formats strfmt.Registry) error { - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) contextValidateDefaultHostingPrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DefaultHostingPrecedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) contextValidateServiceHostingCosts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingCosts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - - return nil -} - -func (m *IdentityPatch) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - - return nil -} - -func (m *IdentityPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *IdentityPatch) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityPatch) UnmarshalBinary(b []byte) error { - var res IdentityPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_type.go b/rest_model/identity_type.go deleted file mode 100644 index e24bc28a7..000000000 --- a/rest_model/identity_type.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// IdentityType identity type -// -// swagger:model identityType -type IdentityType string - -func NewIdentityType(value IdentityType) *IdentityType { - v := value - return &v -} - -const ( - - // IdentityTypeUser captures enum value "User" - IdentityTypeUser IdentityType = "User" - - // IdentityTypeDevice captures enum value "Device" - IdentityTypeDevice IdentityType = "Device" - - // IdentityTypeService captures enum value "Service" - IdentityTypeService IdentityType = "Service" - - // IdentityTypeRouter captures enum value "Router" - IdentityTypeRouter IdentityType = "Router" -) - -// for schema -var identityTypeEnum []interface{} - -func init() { - var res []IdentityType - if err := json.Unmarshal([]byte(`["User","Device","Service","Router"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - identityTypeEnum = append(identityTypeEnum, v) - } -} - -func (m IdentityType) validateIdentityTypeEnum(path, location string, value IdentityType) error { - if err := validate.EnumCase(path, location, value, identityTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this identity type -func (m IdentityType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateIdentityTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this identity type based on context it is used -func (m IdentityType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/identity_type_detail.go b/rest_model/identity_type_detail.go deleted file mode 100644 index 39e05307b..000000000 --- a/rest_model/identity_type_detail.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityTypeDetail identity type detail -// -// swagger:model identityTypeDetail -type IdentityTypeDetail struct { - BaseEntity - - // name - Name string `json:"name,omitempty"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *IdentityTypeDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Name string `json:"name,omitempty"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Name = dataAO1.Name - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m IdentityTypeDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Name string `json:"name,omitempty"` - } - - dataAO1.Name = m.Name - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this identity type detail -func (m *IdentityTypeDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this identity type detail based on the context it is used -func (m *IdentityTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityTypeDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityTypeDetail) UnmarshalBinary(b []byte) error { - var res IdentityTypeDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/identity_type_list.go b/rest_model/identity_type_list.go deleted file mode 100644 index c6949cc43..000000000 --- a/rest_model/identity_type_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IdentityTypeList identity type list -// -// swagger:model identityTypeList -type IdentityTypeList []*IdentityTypeDetail - -// Validate validates this identity type list -func (m IdentityTypeList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this identity type list based on the context it is used -func (m IdentityTypeList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/identity_update.go b/rest_model/identity_update.go deleted file mode 100644 index 79ea753f0..000000000 --- a/rest_model/identity_update.go +++ /dev/null @@ -1,489 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IdentityUpdate identity update -// -// swagger:model identityUpdate -type IdentityUpdate struct { - - // app data - AppData *Tags `json:"appData,omitempty"` - - // auth policy Id - AuthPolicyID *string `json:"authPolicyId,omitempty"` - - // default hosting cost - DefaultHostingCost *TerminatorCost `json:"defaultHostingCost,omitempty"` - - // default hosting precedence - DefaultHostingPrecedence TerminatorPrecedence `json:"defaultHostingPrecedence,omitempty"` - - // external Id - ExternalID *string `json:"externalId,omitempty"` - - // is admin - // Required: true - IsAdmin *bool `json:"isAdmin"` - - // name - // Required: true - Name *string `json:"name"` - - // role attributes - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - // service hosting costs - ServiceHostingCosts TerminatorCostMap `json:"serviceHostingCosts,omitempty"` - - // service hosting precedences - ServiceHostingPrecedences TerminatorPrecedenceMap `json:"serviceHostingPrecedences,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - // Required: true - Type *IdentityType `json:"type"` -} - -// Validate validates this identity update -func (m *IdentityUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDefaultHostingPrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsAdmin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingCosts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceHostingPrecedences(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityUpdate) validateAppData(formats strfmt.Registry) error { - if swag.IsZero(m.AppData) { // not required - return nil - } - - if m.AppData != nil { - if err := m.AppData.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) validateDefaultHostingCost(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingCost) { // not required - return nil - } - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) validateDefaultHostingPrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.DefaultHostingPrecedence) { // not required - return nil - } - - if err := m.DefaultHostingPrecedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityUpdate) validateIsAdmin(formats strfmt.Registry) error { - - if err := validate.Required("isAdmin", "body", m.IsAdmin); err != nil { - return err - } - - return nil -} - -func (m *IdentityUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *IdentityUpdate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes) { // not required - return nil - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) validateServiceHostingCosts(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingCosts) { // not required - return nil - } - - if m.ServiceHostingCosts != nil { - if err := m.ServiceHostingCosts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) validateServiceHostingPrecedences(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceHostingPrecedences) { // not required - return nil - } - - if m.ServiceHostingPrecedences != nil { - if err := m.ServiceHostingPrecedences.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this identity update based on the context it is used -func (m *IdentityUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDefaultHostingPrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingCosts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceHostingPrecedences(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IdentityUpdate) contextValidateAppData(ctx context.Context, formats strfmt.Registry) error { - - if m.AppData != nil { - if err := m.AppData.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appData") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appData") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) contextValidateDefaultHostingCost(ctx context.Context, formats strfmt.Registry) error { - - if m.DefaultHostingCost != nil { - if err := m.DefaultHostingCost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingCost") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) contextValidateDefaultHostingPrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.DefaultHostingPrecedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("defaultHostingPrecedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("defaultHostingPrecedence") - } - return err - } - - return nil -} - -func (m *IdentityUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) contextValidateServiceHostingCosts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingCosts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingCosts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingCosts") - } - return err - } - - return nil -} - -func (m *IdentityUpdate) contextValidateServiceHostingPrecedences(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceHostingPrecedences.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceHostingPrecedences") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceHostingPrecedences") - } - return err - } - - return nil -} - -func (m *IdentityUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *IdentityUpdate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IdentityUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IdentityUpdate) UnmarshalBinary(b []byte) error { - var res IdentityUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/link.go b/rest_model/link.go deleted file mode 100644 index fbec31d64..000000000 --- a/rest_model/link.go +++ /dev/null @@ -1,106 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Link A link to another resource -// -// swagger:model link -type Link struct { - - // comment - Comment string `json:"comment,omitempty"` - - // href - // Required: true - // Format: uri - Href *strfmt.URI `json:"href"` - - // method - Method string `json:"method,omitempty"` -} - -// Validate validates this link -func (m *Link) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHref(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Link) validateHref(formats strfmt.Registry) error { - - if err := validate.Required("href", "body", m.Href); err != nil { - return err - } - - if err := validate.FormatOf("href", "body", "uri", m.Href.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this link based on context it is used -func (m *Link) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Link) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Link) UnmarshalBinary(b []byte) error { - var res Link - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/links.go b/rest_model/links.go deleted file mode 100644 index e6a7bb18b..000000000 --- a/rest_model/links.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Links A map of named links -// -// swagger:model links -type Links map[string]Link - -// Validate validates this links -func (m Links) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this links based on the context it is used -func (m Links) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/list_api_sessions_envelope.go b/rest_model/list_api_sessions_envelope.go deleted file mode 100644 index d3862f245..000000000 --- a/rest_model/list_api_sessions_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListAPISessionsEnvelope list Api sessions envelope -// -// swagger:model listApiSessionsEnvelope -type ListAPISessionsEnvelope struct { - - // data - // Required: true - Data APISessionList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list Api sessions envelope -func (m *ListAPISessionsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListAPISessionsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListAPISessionsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list Api sessions envelope based on the context it is used -func (m *ListAPISessionsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListAPISessionsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListAPISessionsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListAPISessionsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListAPISessionsEnvelope) UnmarshalBinary(b []byte) error { - var res ListAPISessionsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_auth_policies_envelope.go b/rest_model/list_auth_policies_envelope.go deleted file mode 100644 index 67a3febea..000000000 --- a/rest_model/list_auth_policies_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListAuthPoliciesEnvelope list auth policies envelope -// -// swagger:model listAuthPoliciesEnvelope -type ListAuthPoliciesEnvelope struct { - - // data - // Required: true - Data AuthPolicyList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list auth policies envelope -func (m *ListAuthPoliciesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListAuthPoliciesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListAuthPoliciesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list auth policies envelope based on the context it is used -func (m *ListAuthPoliciesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListAuthPoliciesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListAuthPoliciesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListAuthPoliciesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListAuthPoliciesEnvelope) UnmarshalBinary(b []byte) error { - var res ListAuthPoliciesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_authenticators_envelope.go b/rest_model/list_authenticators_envelope.go deleted file mode 100644 index 899a05319..000000000 --- a/rest_model/list_authenticators_envelope.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListAuthenticatorsEnvelope list authenticators envelope -// -// swagger:model listAuthenticatorsEnvelope -type ListAuthenticatorsEnvelope struct { - - // data - Data AuthenticatorList `json:"data,omitempty"` - - // meta - Meta *Meta `json:"meta,omitempty"` -} - -// Validate validates this list authenticators envelope -func (m *ListAuthenticatorsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListAuthenticatorsEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListAuthenticatorsEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list authenticators envelope based on the context it is used -func (m *ListAuthenticatorsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListAuthenticatorsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListAuthenticatorsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListAuthenticatorsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListAuthenticatorsEnvelope) UnmarshalBinary(b []byte) error { - var res ListAuthenticatorsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_cas_envelope.go b/rest_model/list_cas_envelope.go deleted file mode 100644 index 11a4cb65e..000000000 --- a/rest_model/list_cas_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListCasEnvelope list cas envelope -// -// swagger:model listCasEnvelope -type ListCasEnvelope struct { - - // data - // Required: true - Data CaList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list cas envelope -func (m *ListCasEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCasEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListCasEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list cas envelope based on the context it is used -func (m *ListCasEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCasEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListCasEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListCasEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListCasEnvelope) UnmarshalBinary(b []byte) error { - var res ListCasEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_client_external_jwt_signers_envelope.go b/rest_model/list_client_external_jwt_signers_envelope.go deleted file mode 100644 index 77834555c..000000000 --- a/rest_model/list_client_external_jwt_signers_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListClientExternalJWTSignersEnvelope list client external Jwt signers envelope -// -// swagger:model listClientExternalJwtSignersEnvelope -type ListClientExternalJWTSignersEnvelope struct { - - // data - // Required: true - Data ClientExternalJWTSignerList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list client external Jwt signers envelope -func (m *ListClientExternalJWTSignersEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListClientExternalJWTSignersEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListClientExternalJWTSignersEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list client external Jwt signers envelope based on the context it is used -func (m *ListClientExternalJWTSignersEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListClientExternalJWTSignersEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListClientExternalJWTSignersEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListClientExternalJWTSignersEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListClientExternalJWTSignersEnvelope) UnmarshalBinary(b []byte) error { - var res ListClientExternalJWTSignersEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_client_terminators_envelope.go b/rest_model/list_client_terminators_envelope.go deleted file mode 100644 index 0cc49e4e0..000000000 --- a/rest_model/list_client_terminators_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListClientTerminatorsEnvelope list client terminators envelope -// -// swagger:model listClientTerminatorsEnvelope -type ListClientTerminatorsEnvelope struct { - - // data - // Required: true - Data TerminatorClientList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list client terminators envelope -func (m *ListClientTerminatorsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListClientTerminatorsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListClientTerminatorsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list client terminators envelope based on the context it is used -func (m *ListClientTerminatorsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListClientTerminatorsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListClientTerminatorsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListClientTerminatorsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListClientTerminatorsEnvelope) UnmarshalBinary(b []byte) error { - var res ListClientTerminatorsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_config_types_envelope.go b/rest_model/list_config_types_envelope.go deleted file mode 100644 index 01fcd61e0..000000000 --- a/rest_model/list_config_types_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListConfigTypesEnvelope list config types envelope -// -// swagger:model listConfigTypesEnvelope -type ListConfigTypesEnvelope struct { - - // data - // Required: true - Data ConfigTypeList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list config types envelope -func (m *ListConfigTypesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListConfigTypesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListConfigTypesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list config types envelope based on the context it is used -func (m *ListConfigTypesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListConfigTypesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListConfigTypesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListConfigTypesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListConfigTypesEnvelope) UnmarshalBinary(b []byte) error { - var res ListConfigTypesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_configs_envelope.go b/rest_model/list_configs_envelope.go deleted file mode 100644 index 052fd34c7..000000000 --- a/rest_model/list_configs_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListConfigsEnvelope list configs envelope -// -// swagger:model listConfigsEnvelope -type ListConfigsEnvelope struct { - - // data - // Required: true - Data ConfigList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list configs envelope -func (m *ListConfigsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListConfigsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListConfigsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list configs envelope based on the context it is used -func (m *ListConfigsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListConfigsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListConfigsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListConfigsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListConfigsEnvelope) UnmarshalBinary(b []byte) error { - var res ListConfigsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_current_api_session_certificates_envelope.go b/rest_model/list_current_api_session_certificates_envelope.go deleted file mode 100644 index 3c453049f..000000000 --- a/rest_model/list_current_api_session_certificates_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListCurrentAPISessionCertificatesEnvelope list current Api session certificates envelope -// -// swagger:model listCurrentApiSessionCertificatesEnvelope -type ListCurrentAPISessionCertificatesEnvelope struct { - - // data - // Required: true - Data CurrentAPISessionCertificateList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list current Api session certificates envelope -func (m *ListCurrentAPISessionCertificatesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCurrentAPISessionCertificatesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListCurrentAPISessionCertificatesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list current Api session certificates envelope based on the context it is used -func (m *ListCurrentAPISessionCertificatesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCurrentAPISessionCertificatesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListCurrentAPISessionCertificatesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListCurrentAPISessionCertificatesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListCurrentAPISessionCertificatesEnvelope) UnmarshalBinary(b []byte) error { - var res ListCurrentAPISessionCertificatesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_current_api_session_service_updates_envelope.go b/rest_model/list_current_api_session_service_updates_envelope.go deleted file mode 100644 index 8cc56fce4..000000000 --- a/rest_model/list_current_api_session_service_updates_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListCurrentAPISessionServiceUpdatesEnvelope list current Api session service updates envelope -// -// swagger:model listCurrentApiSessionServiceUpdatesEnvelope -type ListCurrentAPISessionServiceUpdatesEnvelope struct { - - // data - // Required: true - Data *CurrentAPISessionServiceUpdateList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list current Api session service updates envelope -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list current Api session service updates envelope based on the context it is used -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListCurrentAPISessionServiceUpdatesEnvelope) UnmarshalBinary(b []byte) error { - var res ListCurrentAPISessionServiceUpdatesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_current_identity_edge_routers_envelope.go b/rest_model/list_current_identity_edge_routers_envelope.go deleted file mode 100644 index 0a6db5c96..000000000 --- a/rest_model/list_current_identity_edge_routers_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListCurrentIdentityEdgeRoutersEnvelope list current identity edge routers envelope -// -// swagger:model listCurrentIdentityEdgeRoutersEnvelope -type ListCurrentIdentityEdgeRoutersEnvelope struct { - - // data - // Required: true - Data CurrentIdentityEdgeRouterList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list current identity edge routers envelope -func (m *ListCurrentIdentityEdgeRoutersEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCurrentIdentityEdgeRoutersEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListCurrentIdentityEdgeRoutersEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list current identity edge routers envelope based on the context it is used -func (m *ListCurrentIdentityEdgeRoutersEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListCurrentIdentityEdgeRoutersEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListCurrentIdentityEdgeRoutersEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListCurrentIdentityEdgeRoutersEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListCurrentIdentityEdgeRoutersEnvelope) UnmarshalBinary(b []byte) error { - var res ListCurrentIdentityEdgeRoutersEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_edge_router_policies_envelope.go b/rest_model/list_edge_router_policies_envelope.go deleted file mode 100644 index df2992774..000000000 --- a/rest_model/list_edge_router_policies_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListEdgeRouterPoliciesEnvelope list edge router policies envelope -// -// swagger:model listEdgeRouterPoliciesEnvelope -type ListEdgeRouterPoliciesEnvelope struct { - - // data - // Required: true - Data EdgeRouterPolicyList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list edge router policies envelope -func (m *ListEdgeRouterPoliciesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListEdgeRouterPoliciesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListEdgeRouterPoliciesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list edge router policies envelope based on the context it is used -func (m *ListEdgeRouterPoliciesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListEdgeRouterPoliciesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListEdgeRouterPoliciesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListEdgeRouterPoliciesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListEdgeRouterPoliciesEnvelope) UnmarshalBinary(b []byte) error { - var res ListEdgeRouterPoliciesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_edge_routers_envelope.go b/rest_model/list_edge_routers_envelope.go deleted file mode 100644 index 3ef77f7a7..000000000 --- a/rest_model/list_edge_routers_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListEdgeRoutersEnvelope list edge routers envelope -// -// swagger:model listEdgeRoutersEnvelope -type ListEdgeRoutersEnvelope struct { - - // data - // Required: true - Data EdgeRouterList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list edge routers envelope -func (m *ListEdgeRoutersEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListEdgeRoutersEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListEdgeRoutersEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list edge routers envelope based on the context it is used -func (m *ListEdgeRoutersEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListEdgeRoutersEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListEdgeRoutersEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListEdgeRoutersEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListEdgeRoutersEnvelope) UnmarshalBinary(b []byte) error { - var res ListEdgeRoutersEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_enrollments_envelope.go b/rest_model/list_enrollments_envelope.go deleted file mode 100644 index 4bd9446a6..000000000 --- a/rest_model/list_enrollments_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListEnrollmentsEnvelope list enrollments envelope -// -// swagger:model listEnrollmentsEnvelope -type ListEnrollmentsEnvelope struct { - - // data - // Required: true - Data EnrollmentList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list enrollments envelope -func (m *ListEnrollmentsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListEnrollmentsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListEnrollmentsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list enrollments envelope based on the context it is used -func (m *ListEnrollmentsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListEnrollmentsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListEnrollmentsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListEnrollmentsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListEnrollmentsEnvelope) UnmarshalBinary(b []byte) error { - var res ListEnrollmentsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_external_jwt_signers_envelope.go b/rest_model/list_external_jwt_signers_envelope.go deleted file mode 100644 index 35fbbc954..000000000 --- a/rest_model/list_external_jwt_signers_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListExternalJWTSignersEnvelope list external Jwt signers envelope -// -// swagger:model listExternalJwtSignersEnvelope -type ListExternalJWTSignersEnvelope struct { - - // data - // Required: true - Data ExternalJWTSignerList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list external Jwt signers envelope -func (m *ListExternalJWTSignersEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListExternalJWTSignersEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListExternalJWTSignersEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list external Jwt signers envelope based on the context it is used -func (m *ListExternalJWTSignersEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListExternalJWTSignersEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListExternalJWTSignersEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListExternalJWTSignersEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListExternalJWTSignersEnvelope) UnmarshalBinary(b []byte) error { - var res ListExternalJWTSignersEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_identities_envelope.go b/rest_model/list_identities_envelope.go deleted file mode 100644 index 12d66b776..000000000 --- a/rest_model/list_identities_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListIdentitiesEnvelope list identities envelope -// -// swagger:model listIdentitiesEnvelope -type ListIdentitiesEnvelope struct { - - // data - // Required: true - Data IdentityList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list identities envelope -func (m *ListIdentitiesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListIdentitiesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListIdentitiesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list identities envelope based on the context it is used -func (m *ListIdentitiesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListIdentitiesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListIdentitiesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListIdentitiesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListIdentitiesEnvelope) UnmarshalBinary(b []byte) error { - var res ListIdentitiesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_identity_types_envelope.go b/rest_model/list_identity_types_envelope.go deleted file mode 100644 index 0597e0042..000000000 --- a/rest_model/list_identity_types_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListIdentityTypesEnvelope list identity types envelope -// -// swagger:model listIdentityTypesEnvelope -type ListIdentityTypesEnvelope struct { - - // data - // Required: true - Data IdentityTypeList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list identity types envelope -func (m *ListIdentityTypesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListIdentityTypesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListIdentityTypesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list identity types envelope based on the context it is used -func (m *ListIdentityTypesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListIdentityTypesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListIdentityTypesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListIdentityTypesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListIdentityTypesEnvelope) UnmarshalBinary(b []byte) error { - var res ListIdentityTypesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_posture_check_envelope.go b/rest_model/list_posture_check_envelope.go deleted file mode 100644 index 6338eb222..000000000 --- a/rest_model/list_posture_check_envelope.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListPostureCheckEnvelope list posture check envelope -// -// swagger:model listPostureCheckEnvelope -type ListPostureCheckEnvelope struct { - dataField []PostureCheckDetail - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Data gets the data of this base type -func (m *ListPostureCheckEnvelope) Data() []PostureCheckDetail { - return m.dataField -} - -// SetData sets the data of this base type -func (m *ListPostureCheckEnvelope) SetData(val []PostureCheckDetail) { - m.dataField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *ListPostureCheckEnvelope) UnmarshalJSON(raw []byte) error { - var data struct { - Data json.RawMessage `json:"data"` - - Meta *Meta `json:"meta"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propData, err := UnmarshalPostureCheckDetailSlice(bytes.NewBuffer(data.Data), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - - var result ListPostureCheckEnvelope - - // data - result.dataField = propData - - // meta - result.Meta = data.Meta - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m ListPostureCheckEnvelope) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - Meta *Meta `json:"meta"` - }{ - - Meta: m.Meta, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Data []PostureCheckDetail `json:"data"` - }{ - - Data: m.dataField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this list posture check envelope -func (m *ListPostureCheckEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPostureCheckEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data()); err != nil { - return err - } - - for i := 0; i < len(m.Data()); i++ { - - if err := m.dataField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *ListPostureCheckEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list posture check envelope based on the context it is used -func (m *ListPostureCheckEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPostureCheckEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Data()); i++ { - - if err := m.dataField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *ListPostureCheckEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListPostureCheckEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListPostureCheckEnvelope) UnmarshalBinary(b []byte) error { - var res ListPostureCheckEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_posture_check_types_envelope.go b/rest_model/list_posture_check_types_envelope.go deleted file mode 100644 index 869787a52..000000000 --- a/rest_model/list_posture_check_types_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListPostureCheckTypesEnvelope list posture check types envelope -// -// swagger:model listPostureCheckTypesEnvelope -type ListPostureCheckTypesEnvelope struct { - - // data - // Required: true - Data PostureCheckTypeList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list posture check types envelope -func (m *ListPostureCheckTypesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPostureCheckTypesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListPostureCheckTypesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list posture check types envelope based on the context it is used -func (m *ListPostureCheckTypesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPostureCheckTypesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListPostureCheckTypesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListPostureCheckTypesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListPostureCheckTypesEnvelope) UnmarshalBinary(b []byte) error { - var res ListPostureCheckTypesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_protocols.go b/rest_model/list_protocols.go deleted file mode 100644 index a87be8f9d..000000000 --- a/rest_model/list_protocols.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ListProtocols list protocols -// -// swagger:model listProtocols -type ListProtocols map[string]Protocol - -// Validate validates this list protocols -func (m ListProtocols) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this list protocols based on the context it is used -func (m ListProtocols) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/list_protocols_envelope.go b/rest_model/list_protocols_envelope.go deleted file mode 100644 index f43f32cea..000000000 --- a/rest_model/list_protocols_envelope.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListProtocolsEnvelope list protocols envelope -// -// swagger:model listProtocolsEnvelope -type ListProtocolsEnvelope struct { - - // data - // Required: true - Data ListProtocols `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list protocols envelope -func (m *ListProtocolsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListProtocolsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *ListProtocolsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list protocols envelope based on the context it is used -func (m *ListProtocolsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListProtocolsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListProtocolsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListProtocolsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListProtocolsEnvelope) UnmarshalBinary(b []byte) error { - var res ListProtocolsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_role_attributes_envelope.go b/rest_model/list_role_attributes_envelope.go deleted file mode 100644 index 0585fc4d2..000000000 --- a/rest_model/list_role_attributes_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListRoleAttributesEnvelope list role attributes envelope -// -// swagger:model listRoleAttributesEnvelope -type ListRoleAttributesEnvelope struct { - - // data - // Required: true - Data RoleAttributesList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list role attributes envelope -func (m *ListRoleAttributesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListRoleAttributesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListRoleAttributesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list role attributes envelope based on the context it is used -func (m *ListRoleAttributesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListRoleAttributesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListRoleAttributesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListRoleAttributesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListRoleAttributesEnvelope) UnmarshalBinary(b []byte) error { - var res ListRoleAttributesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_routers_envelope.go b/rest_model/list_routers_envelope.go deleted file mode 100644 index 9593cf933..000000000 --- a/rest_model/list_routers_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListRoutersEnvelope list routers envelope -// -// swagger:model listRoutersEnvelope -type ListRoutersEnvelope struct { - - // data - // Required: true - Data RouterList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list routers envelope -func (m *ListRoutersEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListRoutersEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListRoutersEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list routers envelope based on the context it is used -func (m *ListRoutersEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListRoutersEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListRoutersEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListRoutersEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListRoutersEnvelope) UnmarshalBinary(b []byte) error { - var res ListRoutersEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_service_configs_envelope.go b/rest_model/list_service_configs_envelope.go deleted file mode 100644 index 214073cd3..000000000 --- a/rest_model/list_service_configs_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListServiceConfigsEnvelope list service configs envelope -// -// swagger:model listServiceConfigsEnvelope -type ListServiceConfigsEnvelope struct { - - // data - // Required: true - Data ServiceConfigList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list service configs envelope -func (m *ListServiceConfigsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServiceConfigsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServiceConfigsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list service configs envelope based on the context it is used -func (m *ListServiceConfigsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServiceConfigsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServiceConfigsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListServiceConfigsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListServiceConfigsEnvelope) UnmarshalBinary(b []byte) error { - var res ListServiceConfigsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_service_edge_router_policies_envelope.go b/rest_model/list_service_edge_router_policies_envelope.go deleted file mode 100644 index 88f823b3f..000000000 --- a/rest_model/list_service_edge_router_policies_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListServiceEdgeRouterPoliciesEnvelope list service edge router policies envelope -// -// swagger:model listServiceEdgeRouterPoliciesEnvelope -type ListServiceEdgeRouterPoliciesEnvelope struct { - - // data - // Required: true - Data ServiceEdgeRouterPolicyList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list service edge router policies envelope -func (m *ListServiceEdgeRouterPoliciesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServiceEdgeRouterPoliciesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServiceEdgeRouterPoliciesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list service edge router policies envelope based on the context it is used -func (m *ListServiceEdgeRouterPoliciesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServiceEdgeRouterPoliciesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServiceEdgeRouterPoliciesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListServiceEdgeRouterPoliciesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListServiceEdgeRouterPoliciesEnvelope) UnmarshalBinary(b []byte) error { - var res ListServiceEdgeRouterPoliciesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_service_policies_envelope.go b/rest_model/list_service_policies_envelope.go deleted file mode 100644 index 9a924ae3a..000000000 --- a/rest_model/list_service_policies_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListServicePoliciesEnvelope list service policies envelope -// -// swagger:model listServicePoliciesEnvelope -type ListServicePoliciesEnvelope struct { - - // data - // Required: true - Data ServicePolicyList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list service policies envelope -func (m *ListServicePoliciesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServicePoliciesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServicePoliciesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list service policies envelope based on the context it is used -func (m *ListServicePoliciesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServicePoliciesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServicePoliciesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListServicePoliciesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListServicePoliciesEnvelope) UnmarshalBinary(b []byte) error { - var res ListServicePoliciesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_services_envelope.go b/rest_model/list_services_envelope.go deleted file mode 100644 index 7e809b13b..000000000 --- a/rest_model/list_services_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListServicesEnvelope list services envelope -// -// swagger:model listServicesEnvelope -type ListServicesEnvelope struct { - - // data - // Required: true - Data ServiceList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list services envelope -func (m *ListServicesEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServicesEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServicesEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list services envelope based on the context it is used -func (m *ListServicesEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListServicesEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListServicesEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListServicesEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListServicesEnvelope) UnmarshalBinary(b []byte) error { - var res ListServicesEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_sessions_envelope.go b/rest_model/list_sessions_envelope.go deleted file mode 100644 index 89ec2658c..000000000 --- a/rest_model/list_sessions_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListSessionsEnvelope list sessions envelope -// -// swagger:model listSessionsEnvelope -type ListSessionsEnvelope struct { - - // data - // Required: true - Data SessionList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list sessions envelope -func (m *ListSessionsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSessionsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSessionsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list sessions envelope based on the context it is used -func (m *ListSessionsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSessionsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSessionsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListSessionsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListSessionsEnvelope) UnmarshalBinary(b []byte) error { - var res ListSessionsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_sessions_management_envelope.go b/rest_model/list_sessions_management_envelope.go deleted file mode 100644 index f00b09cc1..000000000 --- a/rest_model/list_sessions_management_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListSessionsManagementEnvelope list sessions management envelope -// -// swagger:model listSessionsManagementEnvelope -type ListSessionsManagementEnvelope struct { - - // data - // Required: true - Data SessionManagementList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list sessions management envelope -func (m *ListSessionsManagementEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSessionsManagementEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSessionsManagementEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list sessions management envelope based on the context it is used -func (m *ListSessionsManagementEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSessionsManagementEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSessionsManagementEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListSessionsManagementEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListSessionsManagementEnvelope) UnmarshalBinary(b []byte) error { - var res ListSessionsManagementEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_specs_envelope.go b/rest_model/list_specs_envelope.go deleted file mode 100644 index 7dcb848ab..000000000 --- a/rest_model/list_specs_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListSpecsEnvelope list specs envelope -// -// swagger:model listSpecsEnvelope -type ListSpecsEnvelope struct { - - // data - // Required: true - Data SpecList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list specs envelope -func (m *ListSpecsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSpecsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSpecsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list specs envelope based on the context it is used -func (m *ListSpecsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSpecsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSpecsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListSpecsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListSpecsEnvelope) UnmarshalBinary(b []byte) error { - var res ListSpecsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_summary_counts.go b/rest_model/list_summary_counts.go deleted file mode 100644 index 9356fcf8e..000000000 --- a/rest_model/list_summary_counts.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// ListSummaryCounts list summary counts -// -// swagger:model listSummaryCounts -type ListSummaryCounts map[string]int64 - -// Validate validates this list summary counts -func (m ListSummaryCounts) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this list summary counts based on context it is used -func (m ListSummaryCounts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/list_summary_counts_envelope.go b/rest_model/list_summary_counts_envelope.go deleted file mode 100644 index f0756855c..000000000 --- a/rest_model/list_summary_counts_envelope.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListSummaryCountsEnvelope list summary counts envelope -// -// swagger:model listSummaryCountsEnvelope -type ListSummaryCountsEnvelope struct { - - // data - // Required: true - Data ListSummaryCounts `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list summary counts envelope -func (m *ListSummaryCountsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSummaryCountsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *ListSummaryCountsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list summary counts envelope based on the context it is used -func (m *ListSummaryCountsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListSummaryCountsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListSummaryCountsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListSummaryCountsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListSummaryCountsEnvelope) UnmarshalBinary(b []byte) error { - var res ListSummaryCountsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_terminators_envelope.go b/rest_model/list_terminators_envelope.go deleted file mode 100644 index 29e2c5a52..000000000 --- a/rest_model/list_terminators_envelope.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListTerminatorsEnvelope list terminators envelope -// -// swagger:model listTerminatorsEnvelope -type ListTerminatorsEnvelope struct { - - // data - // Required: true - Data TerminatorList `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list terminators envelope -func (m *ListTerminatorsEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListTerminatorsEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListTerminatorsEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list terminators envelope based on the context it is used -func (m *ListTerminatorsEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListTerminatorsEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - - return nil -} - -func (m *ListTerminatorsEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListTerminatorsEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListTerminatorsEnvelope) UnmarshalBinary(b []byte) error { - var res ListTerminatorsEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/list_version_envelope.go b/rest_model/list_version_envelope.go deleted file mode 100644 index f9cee9500..000000000 --- a/rest_model/list_version_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListVersionEnvelope list version envelope -// -// swagger:model listVersionEnvelope -type ListVersionEnvelope struct { - - // data - // Required: true - Data *Version `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this list version envelope -func (m *ListVersionEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListVersionEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *ListVersionEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this list version envelope based on the context it is used -func (m *ListVersionEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListVersionEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *ListVersionEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListVersionEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListVersionEnvelope) UnmarshalBinary(b []byte) error { - var res ListVersionEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/meta.go b/rest_model/meta.go deleted file mode 100644 index 2f957a3af..000000000 --- a/rest_model/meta.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Meta meta -// -// swagger:model meta -type Meta struct { - - // api enrollment version - APIEnrollmentVersion string `json:"apiEnrollmentVersion,omitempty"` - - // api version - APIVersion string `json:"apiVersion,omitempty"` - - // filterable fields - FilterableFields []string `json:"filterableFields,omitempty"` - - // pagination - Pagination *Pagination `json:"pagination,omitempty"` -} - -// Validate validates this meta -func (m *Meta) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePagination(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Meta) validatePagination(formats strfmt.Registry) error { - if swag.IsZero(m.Pagination) { // not required - return nil - } - - if m.Pagination != nil { - if err := m.Pagination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// ContextValidate validate this meta based on the context it is used -func (m *Meta) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePagination(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Meta) contextValidatePagination(ctx context.Context, formats strfmt.Registry) error { - - if m.Pagination != nil { - if err := m.Pagination.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pagination") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pagination") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Meta) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Meta) UnmarshalBinary(b []byte) error { - var res Meta - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/mfa_code.go b/rest_model/mfa_code.go deleted file mode 100644 index b075e4e2c..000000000 --- a/rest_model/mfa_code.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MfaCode mfa code -// -// swagger:model mfaCode -type MfaCode struct { - - // code - // Required: true - Code *string `json:"code"` -} - -// Validate validates this mfa code -func (m *MfaCode) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MfaCode) validateCode(formats strfmt.Registry) error { - - if err := validate.Required("code", "body", m.Code); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this mfa code based on context it is used -func (m *MfaCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MfaCode) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MfaCode) UnmarshalBinary(b []byte) error { - var res MfaCode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/mfa_formats.go b/rest_model/mfa_formats.go deleted file mode 100644 index b5c3be7d9..000000000 --- a/rest_model/mfa_formats.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MfaFormats mfa formats -// -// swagger:model mfaFormats -type MfaFormats string - -func NewMfaFormats(value MfaFormats) *MfaFormats { - v := value - return &v -} - -const ( - - // MfaFormatsNumeric captures enum value "numeric" - MfaFormatsNumeric MfaFormats = "numeric" - - // MfaFormatsAlpha captures enum value "alpha" - MfaFormatsAlpha MfaFormats = "alpha" - - // MfaFormatsAlphaNumeric captures enum value "alphaNumeric" - MfaFormatsAlphaNumeric MfaFormats = "alphaNumeric" -) - -// for schema -var mfaFormatsEnum []interface{} - -func init() { - var res []MfaFormats - if err := json.Unmarshal([]byte(`["numeric","alpha","alphaNumeric"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mfaFormatsEnum = append(mfaFormatsEnum, v) - } -} - -func (m MfaFormats) validateMfaFormatsEnum(path, location string, value MfaFormats) error { - if err := validate.EnumCase(path, location, value, mfaFormatsEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this mfa formats -func (m MfaFormats) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMfaFormatsEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this mfa formats based on context it is used -func (m MfaFormats) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/mfa_providers.go b/rest_model/mfa_providers.go deleted file mode 100644 index 3db9d81ee..000000000 --- a/rest_model/mfa_providers.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MfaProviders mfa providers -// -// swagger:model mfaProviders -type MfaProviders string - -func NewMfaProviders(value MfaProviders) *MfaProviders { - v := value - return &v -} - -const ( - - // MfaProvidersZiti captures enum value "ziti" - MfaProvidersZiti MfaProviders = "ziti" - - // MfaProvidersURL captures enum value "url" - MfaProvidersURL MfaProviders = "url" -) - -// for schema -var mfaProvidersEnum []interface{} - -func init() { - var res []MfaProviders - if err := json.Unmarshal([]byte(`["ziti","url"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mfaProvidersEnum = append(mfaProvidersEnum, v) - } -} - -func (m MfaProviders) validateMfaProvidersEnum(path, location string, value MfaProviders) error { - if err := validate.EnumCase(path, location, value, mfaProvidersEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this mfa providers -func (m MfaProviders) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMfaProvidersEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this mfa providers based on context it is used -func (m MfaProviders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/named_role.go b/rest_model/named_role.go deleted file mode 100644 index 56d214a75..000000000 --- a/rest_model/named_role.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NamedRole named role -// -// swagger:model namedRole -type NamedRole struct { - - // name - Name string `json:"name,omitempty"` - - // role - Role string `json:"role,omitempty"` -} - -// Validate validates this named role -func (m *NamedRole) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this named role based on context it is used -func (m *NamedRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *NamedRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *NamedRole) UnmarshalBinary(b []byte) error { - var res NamedRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/named_roles.go b/rest_model/named_roles.go deleted file mode 100644 index ab51fc97b..000000000 --- a/rest_model/named_roles.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NamedRoles named roles -// -// swagger:model namedRoles -type NamedRoles []*NamedRole - -// Validate validates this named roles -func (m NamedRoles) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this named roles based on the context it is used -func (m NamedRoles) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/operating_system.go b/rest_model/operating_system.go deleted file mode 100644 index 085794c08..000000000 --- a/rest_model/operating_system.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OperatingSystem operating system -// -// swagger:model operatingSystem -type OperatingSystem struct { - - // type - // Required: true - Type *OsType `json:"type"` - - // versions - // Required: true - Versions []string `json:"versions"` -} - -// Validate validates this operating system -func (m *OperatingSystem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OperatingSystem) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -func (m *OperatingSystem) validateVersions(formats strfmt.Registry) error { - - if err := validate.Required("versions", "body", m.Versions); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this operating system based on the context it is used -func (m *OperatingSystem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OperatingSystem) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OperatingSystem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OperatingSystem) UnmarshalBinary(b []byte) error { - var res OperatingSystem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/os_type.go b/rest_model/os_type.go deleted file mode 100644 index 31928cb1f..000000000 --- a/rest_model/os_type.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OsType os type -// -// swagger:model osType -type OsType string - -func NewOsType(value OsType) *OsType { - v := value - return &v -} - -const ( - - // OsTypeWindows captures enum value "Windows" - OsTypeWindows OsType = "Windows" - - // OsTypeWindowsServer captures enum value "WindowsServer" - OsTypeWindowsServer OsType = "WindowsServer" - - // OsTypeAndroid captures enum value "Android" - OsTypeAndroid OsType = "Android" - - // OsTypeIOS captures enum value "iOS" - OsTypeIOS OsType = "iOS" - - // OsTypeLinux captures enum value "Linux" - OsTypeLinux OsType = "Linux" - - // OsTypeMacOS captures enum value "macOS" - OsTypeMacOS OsType = "macOS" -) - -// for schema -var osTypeEnum []interface{} - -func init() { - var res []OsType - if err := json.Unmarshal([]byte(`["Windows","WindowsServer","Android","iOS","Linux","macOS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - osTypeEnum = append(osTypeEnum, v) - } -} - -func (m OsType) validateOsTypeEnum(path, location string, value OsType) error { - if err := validate.EnumCase(path, location, value, osTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this os type -func (m OsType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOsTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this os type based on context it is used -func (m OsType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/pagination.go b/rest_model/pagination.go deleted file mode 100644 index 8c97f9838..000000000 --- a/rest_model/pagination.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Pagination pagination -// -// swagger:model pagination -type Pagination struct { - - // limit - // Required: true - Limit *int64 `json:"limit"` - - // offset - // Required: true - Offset *int64 `json:"offset"` - - // total count - // Required: true - TotalCount *int64 `json:"totalCount"` -} - -// Validate validates this pagination -func (m *Pagination) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLimit(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOffset(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalCount(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Pagination) validateLimit(formats strfmt.Registry) error { - - if err := validate.Required("limit", "body", m.Limit); err != nil { - return err - } - - return nil -} - -func (m *Pagination) validateOffset(formats strfmt.Registry) error { - - if err := validate.Required("offset", "body", m.Offset); err != nil { - return err - } - - return nil -} - -func (m *Pagination) validateTotalCount(formats strfmt.Registry) error { - - if err := validate.Required("totalCount", "body", m.TotalCount); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this pagination based on context it is used -func (m *Pagination) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Pagination) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Pagination) UnmarshalBinary(b []byte) error { - var res Pagination - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/password.go b/rest_model/password.go deleted file mode 100644 index d28855df2..000000000 --- a/rest_model/password.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Password password -// -// swagger:model password -type Password string - -// Validate validates this password -func (m Password) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.MinLength("", "body", string(m), 5); err != nil { - return err - } - - if err := validate.MaxLength("", "body", string(m), 100); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this password based on context it is used -func (m Password) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/password_nullable.go b/rest_model/password_nullable.go deleted file mode 100644 index 543757f29..000000000 --- a/rest_model/password_nullable.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PasswordNullable password nullable -// -// swagger:model passwordNullable -type PasswordNullable string - -// Validate validates this password nullable -func (m PasswordNullable) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.MinLength("", "body", string(m), 5); err != nil { - return err - } - - if err := validate.MaxLength("", "body", string(m), 100); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this password nullable based on context it is used -func (m PasswordNullable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/policy_advice.go b/rest_model/policy_advice.go deleted file mode 100644 index 195333c04..000000000 --- a/rest_model/policy_advice.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PolicyAdvice policy advice -// -// swagger:model policyAdvice -type PolicyAdvice struct { - - // common routers - CommonRouters []*RouterEntityRef `json:"commonRouters"` - - // identity - Identity *EntityRef `json:"identity,omitempty"` - - // identity Id - IdentityID string `json:"identityId,omitempty"` - - // identity router count - IdentityRouterCount int32 `json:"identityRouterCount,omitempty"` - - // is bind allowed - IsBindAllowed bool `json:"isBindAllowed,omitempty"` - - // is dial allowed - IsDialAllowed bool `json:"isDialAllowed,omitempty"` - - // service - Service *EntityRef `json:"service,omitempty"` - - // service Id - ServiceID string `json:"serviceId,omitempty"` - - // service router count - ServiceRouterCount int32 `json:"serviceRouterCount,omitempty"` -} - -// Validate validates this policy advice -func (m *PolicyAdvice) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCommonRouters(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PolicyAdvice) validateCommonRouters(formats strfmt.Registry) error { - if swag.IsZero(m.CommonRouters) { // not required - return nil - } - - for i := 0; i < len(m.CommonRouters); i++ { - if swag.IsZero(m.CommonRouters[i]) { // not required - continue - } - - if m.CommonRouters[i] != nil { - if err := m.CommonRouters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("commonRouters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("commonRouters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PolicyAdvice) validateIdentity(formats strfmt.Registry) error { - if swag.IsZero(m.Identity) { // not required - return nil - } - - if m.Identity != nil { - if err := m.Identity.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *PolicyAdvice) validateService(formats strfmt.Registry) error { - if swag.IsZero(m.Service) { // not required - return nil - } - - if m.Service != nil { - if err := m.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -// ContextValidate validate this policy advice based on the context it is used -func (m *PolicyAdvice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCommonRouters(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentity(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PolicyAdvice) contextValidateCommonRouters(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CommonRouters); i++ { - - if m.CommonRouters[i] != nil { - if err := m.CommonRouters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("commonRouters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("commonRouters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PolicyAdvice) contextValidateIdentity(ctx context.Context, formats strfmt.Registry) error { - - if m.Identity != nil { - if err := m.Identity.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identity") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identity") - } - return err - } - } - - return nil -} - -func (m *PolicyAdvice) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - - if m.Service != nil { - if err := m.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PolicyAdvice) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PolicyAdvice) UnmarshalBinary(b []byte) error { - var res PolicyAdvice - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/policy_failure.go b/rest_model/policy_failure.go deleted file mode 100644 index 187c968e1..000000000 --- a/rest_model/policy_failure.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PolicyFailure policy failure -// -// swagger:model policyFailure -type PolicyFailure struct { - checksField []PostureCheckFailure - - // policy Id - PolicyID string `json:"policyId,omitempty"` - - // policy name - PolicyName string `json:"policyName,omitempty"` -} - -// Checks gets the checks of this base type -func (m *PolicyFailure) Checks() []PostureCheckFailure { - return m.checksField -} - -// SetChecks sets the checks of this base type -func (m *PolicyFailure) SetChecks(val []PostureCheckFailure) { - m.checksField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PolicyFailure) UnmarshalJSON(raw []byte) error { - var data struct { - Checks json.RawMessage `json:"checks"` - - PolicyID string `json:"policyId,omitempty"` - - PolicyName string `json:"policyName,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var propChecks []PostureCheckFailure - if string(data.Checks) != "null" { - checks, err := UnmarshalPostureCheckFailureSlice(bytes.NewBuffer(data.Checks), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - propChecks = checks - } - - var result PolicyFailure - - // checks - result.checksField = propChecks - - // policyId - result.PolicyID = data.PolicyID - - // policyName - result.PolicyName = data.PolicyName - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PolicyFailure) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - PolicyID string `json:"policyId,omitempty"` - - PolicyName string `json:"policyName,omitempty"` - }{ - - PolicyID: m.PolicyID, - - PolicyName: m.PolicyName, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Checks []PostureCheckFailure `json:"checks"` - }{ - - Checks: m.checksField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this policy failure -func (m *PolicyFailure) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateChecks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PolicyFailure) validateChecks(formats strfmt.Registry) error { - if swag.IsZero(m.Checks()) { // not required - return nil - } - - for i := 0; i < len(m.Checks()); i++ { - - if err := m.checksField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("checks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("checks" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this policy failure based on the context it is used -func (m *PolicyFailure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateChecks(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PolicyFailure) contextValidateChecks(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Checks()); i++ { - - if err := m.checksField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("checks" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("checks" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PolicyFailure) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PolicyFailure) UnmarshalBinary(b []byte) error { - var res PolicyFailure - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_create.go b/rest_model/posture_check_create.go deleted file mode 100644 index 2e712b05c..000000000 --- a/rest_model/posture_check_create.go +++ /dev/null @@ -1,351 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "io/ioutil" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckCreate posture check create -// -// swagger:discriminator postureCheckCreate typeId -type PostureCheckCreate interface { - runtime.Validatable - runtime.ContextValidatable - - // name - // Required: true - Name() *string - SetName(*string) - - // role attributes - RoleAttributes() *Attributes - SetRoleAttributes(*Attributes) - - // tags - Tags() *Tags - SetTags(*Tags) - - // type Id - // Required: true - TypeID() PostureCheckType - SetTypeID(PostureCheckType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type postureCheckCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - typeIdField PostureCheckType -} - -// Name gets the name of this polymorphic type -func (m *postureCheckCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this polymorphic type -func (m *postureCheckCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this polymorphic type -func (m *postureCheckCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this polymorphic type -func (m *postureCheckCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this polymorphic type -func (m *postureCheckCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this polymorphic type -func (m *postureCheckCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this polymorphic type -func (m *postureCheckCreate) TypeID() PostureCheckType { - return "postureCheckCreate" -} - -// SetTypeID sets the type Id of this polymorphic type -func (m *postureCheckCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalPostureCheckCreateSlice unmarshals polymorphic slices of PostureCheckCreate -func UnmarshalPostureCheckCreateSlice(reader io.Reader, consumer runtime.Consumer) ([]PostureCheckCreate, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []PostureCheckCreate - for _, element := range elements { - obj, err := unmarshalPostureCheckCreate(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalPostureCheckCreate unmarshals polymorphic PostureCheckCreate -func UnmarshalPostureCheckCreate(reader io.Reader, consumer runtime.Consumer) (PostureCheckCreate, error) { - // we need to read this twice, so first into a buffer - data, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalPostureCheckCreate(data, consumer) -} - -func unmarshalPostureCheckCreate(data []byte, consumer runtime.Consumer) (PostureCheckCreate, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the typeId property. - var getType struct { - TypeID string `json:"typeId"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("typeId", "body", getType.TypeID); err != nil { - return nil, err - } - - // The value of typeId is used to determine which type to create and unmarshal the data into - switch getType.TypeID { - case "DOMAIN": - var result PostureCheckDomainCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MAC": - var result PostureCheckMacAddressCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MFA": - var result PostureCheckMfaCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "OS": - var result PostureCheckOperatingSystemCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS": - var result PostureCheckProcessCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS_MULTI": - var result PostureCheckProcessMultiCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "postureCheckCreate": - var result postureCheckCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid typeId value: %q", getType.TypeID) -} - -// Validate validates this posture check create -func (m *postureCheckCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *postureCheckCreate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check create based on the context it is used -func (m *postureCheckCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *postureCheckCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} diff --git a/rest_model/posture_check_detail.go b/rest_model/posture_check_detail.go deleted file mode 100644 index f09bedb43..000000000 --- a/rest_model/posture_check_detail.go +++ /dev/null @@ -1,525 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "io/ioutil" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PostureCheckDetail posture check detail -// -// swagger:discriminator postureCheckDetail typeId -type PostureCheckDetail interface { - runtime.Validatable - runtime.ContextValidatable - - // links - // Required: true - Links() Links - SetLinks(Links) - - // created at - // Required: true - // Format: date-time - CreatedAt() *strfmt.DateTime - SetCreatedAt(*strfmt.DateTime) - - // id - // Required: true - ID() *string - SetID(*string) - - // name - // Required: true - Name() *string - SetName(*string) - - // role attributes - // Required: true - RoleAttributes() *Attributes - SetRoleAttributes(*Attributes) - - // tags - // Required: true - Tags() *Tags - SetTags(*Tags) - - // type Id - // Required: true - TypeID() string - SetTypeID(string) - - // updated at - // Required: true - // Format: date-time - UpdatedAt() *strfmt.DateTime - SetUpdatedAt(*strfmt.DateTime) - - // version - // Required: true - Version() *int64 - SetVersion(*int64) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type postureCheckDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - typeIdField string - - updatedAtField *strfmt.DateTime - - versionField *int64 -} - -// Links gets the links of this polymorphic type -func (m *postureCheckDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this polymorphic type -func (m *postureCheckDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this polymorphic type -func (m *postureCheckDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this polymorphic type -func (m *postureCheckDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this polymorphic type -func (m *postureCheckDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *postureCheckDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this polymorphic type -func (m *postureCheckDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this polymorphic type -func (m *postureCheckDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this polymorphic type -func (m *postureCheckDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this polymorphic type -func (m *postureCheckDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this polymorphic type -func (m *postureCheckDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this polymorphic type -func (m *postureCheckDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this polymorphic type -func (m *postureCheckDetail) TypeID() string { - return "postureCheckDetail" -} - -// SetTypeID sets the type Id of this polymorphic type -func (m *postureCheckDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this polymorphic type -func (m *postureCheckDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this polymorphic type -func (m *postureCheckDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this polymorphic type -func (m *postureCheckDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this polymorphic type -func (m *postureCheckDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalPostureCheckDetailSlice unmarshals polymorphic slices of PostureCheckDetail -func UnmarshalPostureCheckDetailSlice(reader io.Reader, consumer runtime.Consumer) ([]PostureCheckDetail, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []PostureCheckDetail - for _, element := range elements { - obj, err := unmarshalPostureCheckDetail(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalPostureCheckDetail unmarshals polymorphic PostureCheckDetail -func UnmarshalPostureCheckDetail(reader io.Reader, consumer runtime.Consumer) (PostureCheckDetail, error) { - // we need to read this twice, so first into a buffer - data, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalPostureCheckDetail(data, consumer) -} - -func unmarshalPostureCheckDetail(data []byte, consumer runtime.Consumer) (PostureCheckDetail, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the typeId property. - var getType struct { - TypeID string `json:"typeId"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("typeId", "body", getType.TypeID); err != nil { - return nil, err - } - - // The value of typeId is used to determine which type to create and unmarshal the data into - switch getType.TypeID { - case "DOMAIN": - var result PostureCheckDomainDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MAC": - var result PostureCheckMacAddressDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MFA": - var result PostureCheckMfaDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "OS": - var result PostureCheckOperatingSystemDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS": - var result PostureCheckProcessDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS_MULTI": - var result PostureCheckProcessMultiDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "postureCheckDetail": - var result postureCheckDetail - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid typeId value: %q", getType.TypeID) -} - -// Validate validates this posture check detail -func (m *postureCheckDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *postureCheckDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *postureCheckDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *postureCheckDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *postureCheckDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *postureCheckDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *postureCheckDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check detail based on the context it is used -func (m *postureCheckDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *postureCheckDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} diff --git a/rest_model/posture_check_domain_create.go b/rest_model/posture_check_domain_create.go deleted file mode 100644 index 4d40f86e6..000000000 --- a/rest_model/posture_check_domain_create.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckDomainCreate posture check domain create -// -// swagger:model postureCheckDomainCreate -type PostureCheckDomainCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` -} - -// Name gets the name of this subtype -func (m *PostureCheckDomainCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckDomainCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckDomainCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckDomainCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckDomainCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckDomainCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckDomainCreate) TypeID() PostureCheckType { - return "DOMAIN" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckDomainCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckDomainCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckDomainCreate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Domains = data.Domains - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckDomainCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` - }{ - - Domains: m.Domains, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check domain create -func (m *PostureCheckDomainCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomains(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainCreate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainCreate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainCreate) validateDomains(formats strfmt.Registry) error { - - if err := validate.Required("domains", "body", m.Domains); err != nil { - return err - } - - iDomainsSize := int64(len(m.Domains)) - - if err := validate.MinItems("domains", "body", iDomainsSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check domain create based on the context it is used -func (m *PostureCheckDomainCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckDomainCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckDomainCreate) UnmarshalBinary(b []byte) error { - var res PostureCheckDomainCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_domain_detail.go b/rest_model/posture_check_domain_detail.go deleted file mode 100644 index d41842525..000000000 --- a/rest_model/posture_check_domain_detail.go +++ /dev/null @@ -1,553 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckDomainDetail posture check domain detail -// -// swagger:model postureCheckDomainDetail -type PostureCheckDomainDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - updatedAtField *strfmt.DateTime - - versionField *int64 - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` -} - -// Links gets the links of this subtype -func (m *PostureCheckDomainDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this subtype -func (m *PostureCheckDomainDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this subtype -func (m *PostureCheckDomainDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this subtype -func (m *PostureCheckDomainDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this subtype -func (m *PostureCheckDomainDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureCheckDomainDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this subtype -func (m *PostureCheckDomainDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckDomainDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckDomainDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckDomainDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckDomainDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckDomainDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckDomainDetail) TypeID() string { - return "DOMAIN" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckDomainDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this subtype -func (m *PostureCheckDomainDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this subtype -func (m *PostureCheckDomainDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this subtype -func (m *PostureCheckDomainDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this subtype -func (m *PostureCheckDomainDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckDomainDetail) UnmarshalJSON(raw []byte) error { - var data struct { - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckDomainDetail - - result.linksField = base.Links - - result.createdAtField = base.CreatedAt - - result.idField = base.ID - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.updatedAtField = base.UpdatedAt - - result.versionField = base.Version - - result.Domains = data.Domains - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckDomainDetail) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` - }{ - - Domains: m.Domains, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - }{ - - Links: m.Links(), - - CreatedAt: m.CreatedAt(), - - ID: m.ID(), - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - - UpdatedAt: m.UpdatedAt(), - - Version: m.Version(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check domain detail -func (m *PostureCheckDomainDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomains(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainDetail) validateDomains(formats strfmt.Registry) error { - - if err := validate.Required("domains", "body", m.Domains); err != nil { - return err - } - - iDomainsSize := int64(len(m.Domains)) - - if err := validate.MinItems("domains", "body", iDomainsSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check domain detail based on the context it is used -func (m *PostureCheckDomainDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *PostureCheckDomainDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckDomainDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckDomainDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckDomainDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_domain_patch.go b/rest_model/posture_check_domain_patch.go deleted file mode 100644 index 20f412907..000000000 --- a/rest_model/posture_check_domain_patch.go +++ /dev/null @@ -1,350 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckDomainPatch posture check domain patch -// -// swagger:model postureCheckDomainPatch -type PostureCheckDomainPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - // domains - // Min Items: 1 - Domains []string `json:"domains"` -} - -// Name gets the name of this subtype -func (m *PostureCheckDomainPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckDomainPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckDomainPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckDomainPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckDomainPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckDomainPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckDomainPatch) TypeID() PostureCheckType { - return "DOMAIN" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckDomainPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckDomainPatch) UnmarshalJSON(raw []byte) error { - var data struct { - - // domains - // Min Items: 1 - Domains []string `json:"domains"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckDomainPatch - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Domains = data.Domains - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckDomainPatch) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // domains - // Min Items: 1 - Domains []string `json:"domains"` - }{ - - Domains: m.Domains, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check domain patch -func (m *PostureCheckDomainPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomains(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainPatch) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainPatch) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainPatch) validateDomains(formats strfmt.Registry) error { - - if swag.IsZero(m.Domains) { // not required - return nil - } - - iDomainsSize := int64(len(m.Domains)) - - if err := validate.MinItems("domains", "body", iDomainsSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check domain patch based on the context it is used -func (m *PostureCheckDomainPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckDomainPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckDomainPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckDomainPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_domain_update.go b/rest_model/posture_check_domain_update.go deleted file mode 100644 index 01ff306e7..000000000 --- a/rest_model/posture_check_domain_update.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckDomainUpdate posture check domain update -// -// swagger:model postureCheckDomainUpdate -type PostureCheckDomainUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` -} - -// Name gets the name of this subtype -func (m *PostureCheckDomainUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckDomainUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckDomainUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckDomainUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckDomainUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckDomainUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckDomainUpdate) TypeID() PostureCheckType { - return "DOMAIN" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckDomainUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckDomainUpdate) UnmarshalJSON(raw []byte) error { - var data struct { - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckDomainUpdate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Domains = data.Domains - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckDomainUpdate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // domains - // Required: true - // Min Items: 1 - Domains []string `json:"domains"` - }{ - - Domains: m.Domains, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check domain update -func (m *PostureCheckDomainUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomains(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckDomainUpdate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainUpdate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainUpdate) validateDomains(formats strfmt.Registry) error { - - if err := validate.Required("domains", "body", m.Domains); err != nil { - return err - } - - iDomainsSize := int64(len(m.Domains)) - - if err := validate.MinItems("domains", "body", iDomainsSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check domain update based on the context it is used -func (m *PostureCheckDomainUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckDomainUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckDomainUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckDomainUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckDomainUpdate) UnmarshalBinary(b []byte) error { - var res PostureCheckDomainUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure.go b/rest_model/posture_check_failure.go deleted file mode 100644 index 4e8875344..000000000 --- a/rest_model/posture_check_failure.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "io/ioutil" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PostureCheckFailure posture check failure -// -// swagger:discriminator postureCheckFailure postureCheckType -type PostureCheckFailure interface { - runtime.Validatable - runtime.ContextValidatable - - // posture check Id - // Required: true - PostureCheckID() *string - SetPostureCheckID(*string) - - // posture check name - // Required: true - PostureCheckName() *string - SetPostureCheckName(*string) - - // posture check type - // Required: true - PostureCheckType() string - SetPostureCheckType(string) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type postureCheckFailure struct { - postureCheckIdField *string - - postureCheckNameField *string - - postureCheckTypeField string -} - -// PostureCheckID gets the posture check Id of this polymorphic type -func (m *postureCheckFailure) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this polymorphic type -func (m *postureCheckFailure) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this polymorphic type -func (m *postureCheckFailure) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this polymorphic type -func (m *postureCheckFailure) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this polymorphic type -func (m *postureCheckFailure) PostureCheckType() string { - return "postureCheckFailure" -} - -// SetPostureCheckType sets the posture check type of this polymorphic type -func (m *postureCheckFailure) SetPostureCheckType(val string) { -} - -// UnmarshalPostureCheckFailureSlice unmarshals polymorphic slices of PostureCheckFailure -func UnmarshalPostureCheckFailureSlice(reader io.Reader, consumer runtime.Consumer) ([]PostureCheckFailure, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []PostureCheckFailure - for _, element := range elements { - obj, err := unmarshalPostureCheckFailure(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalPostureCheckFailure unmarshals polymorphic PostureCheckFailure -func UnmarshalPostureCheckFailure(reader io.Reader, consumer runtime.Consumer) (PostureCheckFailure, error) { - // we need to read this twice, so first into a buffer - data, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalPostureCheckFailure(data, consumer) -} - -func unmarshalPostureCheckFailure(data []byte, consumer runtime.Consumer) (PostureCheckFailure, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the postureCheckType property. - var getType struct { - PostureCheckType string `json:"postureCheckType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("postureCheckType", "body", getType.PostureCheckType); err != nil { - return nil, err - } - - // The value of postureCheckType is used to determine which type to create and unmarshal the data into - switch getType.PostureCheckType { - case "DOMAIN": - var result PostureCheckFailureDomain - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MAC": - var result PostureCheckFailureMacAddress - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MFA": - var result PostureCheckFailureMfa - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "OS": - var result PostureCheckFailureOperatingSystem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS": - var result PostureCheckFailureProcess - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS_MULTI": - var result PostureCheckFailureProcessMulti - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "postureCheckFailure": - var result postureCheckFailure - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid postureCheckType value: %q", getType.PostureCheckType) -} - -// Validate validates this posture check failure -func (m *postureCheckFailure) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckFailure) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *postureCheckFailure) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture check failure based on context it is used -func (m *postureCheckFailure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/posture_check_failure_domain.go b/rest_model/posture_check_failure_domain.go deleted file mode 100644 index 6922967c0..000000000 --- a/rest_model/posture_check_failure_domain.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureDomain posture check failure domain -// -// swagger:model postureCheckFailureDomain -type PostureCheckFailureDomain struct { - postureCheckIdField *string - - postureCheckNameField *string - - // actual value - // Required: true - ActualValue *string `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []string `json:"expectedValue"` -} - -// PostureCheckID gets the posture check Id of this subtype -func (m *PostureCheckFailureDomain) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this subtype -func (m *PostureCheckFailureDomain) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this subtype -func (m *PostureCheckFailureDomain) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this subtype -func (m *PostureCheckFailureDomain) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this subtype -func (m *PostureCheckFailureDomain) PostureCheckType() string { - return "DOMAIN" -} - -// SetPostureCheckType sets the posture check type of this subtype -func (m *PostureCheckFailureDomain) SetPostureCheckType(val string) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckFailureDomain) UnmarshalJSON(raw []byte) error { - var data struct { - - // actual value - // Required: true - ActualValue *string `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []string `json:"expectedValue"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckFailureDomain - - result.postureCheckIdField = base.PostureCheckID - - result.postureCheckNameField = base.PostureCheckName - - if base.PostureCheckType != result.PostureCheckType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid postureCheckType value: %q", base.PostureCheckType) - } - - result.ActualValue = data.ActualValue - result.ExpectedValue = data.ExpectedValue - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckFailureDomain) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // actual value - // Required: true - ActualValue *string `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []string `json:"expectedValue"` - }{ - - ActualValue: m.ActualValue, - - ExpectedValue: m.ExpectedValue, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - }{ - - PostureCheckID: m.PostureCheckID(), - - PostureCheckName: m.PostureCheckName(), - - PostureCheckType: m.PostureCheckType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check failure domain -func (m *PostureCheckFailureDomain) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureDomain) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureDomain) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureDomain) validateActualValue(formats strfmt.Registry) error { - - if err := validate.Required("actualValue", "body", m.ActualValue); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureDomain) validateExpectedValue(formats strfmt.Registry) error { - - if err := validate.Required("expectedValue", "body", m.ExpectedValue); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check failure domain based on the context it is used -func (m *PostureCheckFailureDomain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureDomain) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureDomain) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureDomain - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_mac_address.go b/rest_model/posture_check_failure_mac_address.go deleted file mode 100644 index 5d04cc816..000000000 --- a/rest_model/posture_check_failure_mac_address.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureMacAddress posture check failure mac address -// -// swagger:model postureCheckFailureMacAddress -type PostureCheckFailureMacAddress struct { - postureCheckIdField *string - - postureCheckNameField *string - - // actual value - // Required: true - ActualValue []string `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []string `json:"expectedValue"` -} - -// PostureCheckID gets the posture check Id of this subtype -func (m *PostureCheckFailureMacAddress) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this subtype -func (m *PostureCheckFailureMacAddress) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this subtype -func (m *PostureCheckFailureMacAddress) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this subtype -func (m *PostureCheckFailureMacAddress) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this subtype -func (m *PostureCheckFailureMacAddress) PostureCheckType() string { - return "MAC" -} - -// SetPostureCheckType sets the posture check type of this subtype -func (m *PostureCheckFailureMacAddress) SetPostureCheckType(val string) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckFailureMacAddress) UnmarshalJSON(raw []byte) error { - var data struct { - - // actual value - // Required: true - ActualValue []string `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []string `json:"expectedValue"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckFailureMacAddress - - result.postureCheckIdField = base.PostureCheckID - - result.postureCheckNameField = base.PostureCheckName - - if base.PostureCheckType != result.PostureCheckType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid postureCheckType value: %q", base.PostureCheckType) - } - - result.ActualValue = data.ActualValue - result.ExpectedValue = data.ExpectedValue - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckFailureMacAddress) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // actual value - // Required: true - ActualValue []string `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []string `json:"expectedValue"` - }{ - - ActualValue: m.ActualValue, - - ExpectedValue: m.ExpectedValue, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - }{ - - PostureCheckID: m.PostureCheckID(), - - PostureCheckName: m.PostureCheckName(), - - PostureCheckType: m.PostureCheckType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check failure mac address -func (m *PostureCheckFailureMacAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureMacAddress) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureMacAddress) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureMacAddress) validateActualValue(formats strfmt.Registry) error { - - if err := validate.Required("actualValue", "body", m.ActualValue); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureMacAddress) validateExpectedValue(formats strfmt.Registry) error { - - if err := validate.Required("expectedValue", "body", m.ExpectedValue); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check failure mac address based on the context it is used -func (m *PostureCheckFailureMacAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureMacAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureMacAddress) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureMacAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_mfa.go b/rest_model/posture_check_failure_mfa.go deleted file mode 100644 index 23bde19d7..000000000 --- a/rest_model/posture_check_failure_mfa.go +++ /dev/null @@ -1,397 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureMfa posture check failure mfa -// -// swagger:model postureCheckFailureMfa -type PostureCheckFailureMfa struct { - postureCheckIdField *string - - postureCheckNameField *string - - // actual value - // Required: true - ActualValue *PostureChecksFailureMfaValues `json:"actualValue"` - - // criteria - // Required: true - Criteria *PostureChecksFailureMfaCriteria `json:"criteria"` - - // expected value - // Required: true - ExpectedValue *PostureChecksFailureMfaValues `json:"expectedValue"` -} - -// PostureCheckID gets the posture check Id of this subtype -func (m *PostureCheckFailureMfa) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this subtype -func (m *PostureCheckFailureMfa) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this subtype -func (m *PostureCheckFailureMfa) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this subtype -func (m *PostureCheckFailureMfa) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this subtype -func (m *PostureCheckFailureMfa) PostureCheckType() string { - return "MFA" -} - -// SetPostureCheckType sets the posture check type of this subtype -func (m *PostureCheckFailureMfa) SetPostureCheckType(val string) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckFailureMfa) UnmarshalJSON(raw []byte) error { - var data struct { - - // actual value - // Required: true - ActualValue *PostureChecksFailureMfaValues `json:"actualValue"` - - // criteria - // Required: true - Criteria *PostureChecksFailureMfaCriteria `json:"criteria"` - - // expected value - // Required: true - ExpectedValue *PostureChecksFailureMfaValues `json:"expectedValue"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckFailureMfa - - result.postureCheckIdField = base.PostureCheckID - - result.postureCheckNameField = base.PostureCheckName - - if base.PostureCheckType != result.PostureCheckType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid postureCheckType value: %q", base.PostureCheckType) - } - - result.ActualValue = data.ActualValue - result.Criteria = data.Criteria - result.ExpectedValue = data.ExpectedValue - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckFailureMfa) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // actual value - // Required: true - ActualValue *PostureChecksFailureMfaValues `json:"actualValue"` - - // criteria - // Required: true - Criteria *PostureChecksFailureMfaCriteria `json:"criteria"` - - // expected value - // Required: true - ExpectedValue *PostureChecksFailureMfaValues `json:"expectedValue"` - }{ - - ActualValue: m.ActualValue, - - Criteria: m.Criteria, - - ExpectedValue: m.ExpectedValue, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - }{ - - PostureCheckID: m.PostureCheckID(), - - PostureCheckName: m.PostureCheckName(), - - PostureCheckType: m.PostureCheckType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check failure mfa -func (m *PostureCheckFailureMfa) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCriteria(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureMfa) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureMfa) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureMfa) validateActualValue(formats strfmt.Registry) error { - - if err := validate.Required("actualValue", "body", m.ActualValue); err != nil { - return err - } - - if m.ActualValue != nil { - if err := m.ActualValue.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureMfa) validateCriteria(formats strfmt.Registry) error { - - if err := validate.Required("criteria", "body", m.Criteria); err != nil { - return err - } - - if m.Criteria != nil { - if err := m.Criteria.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("criteria") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("criteria") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureMfa) validateExpectedValue(formats strfmt.Registry) error { - - if err := validate.Required("expectedValue", "body", m.ExpectedValue); err != nil { - return err - } - - if m.ExpectedValue != nil { - if err := m.ExpectedValue.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check failure mfa based on the context it is used -func (m *PostureCheckFailureMfa) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActualValue(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCriteria(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExpectedValue(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureMfa) contextValidateActualValue(ctx context.Context, formats strfmt.Registry) error { - - if m.ActualValue != nil { - if err := m.ActualValue.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureMfa) contextValidateCriteria(ctx context.Context, formats strfmt.Registry) error { - - if m.Criteria != nil { - if err := m.Criteria.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("criteria") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("criteria") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureMfa) contextValidateExpectedValue(ctx context.Context, formats strfmt.Registry) error { - - if m.ExpectedValue != nil { - if err := m.ExpectedValue.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureMfa) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureMfa) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureMfa - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_operating_system.go b/rest_model/posture_check_failure_operating_system.go deleted file mode 100644 index 28d50fa5d..000000000 --- a/rest_model/posture_check_failure_operating_system.go +++ /dev/null @@ -1,359 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureOperatingSystem posture check failure operating system -// -// swagger:model postureCheckFailureOperatingSystem -type PostureCheckFailureOperatingSystem struct { - postureCheckIdField *string - - postureCheckNameField *string - - // actual value - // Required: true - ActualValue *PostureCheckFailureOperatingSystemActual `json:"actualValue"` - - // expected value - // Required: true - // Min Items: 1 - ExpectedValue []*OperatingSystem `json:"expectedValue"` -} - -// PostureCheckID gets the posture check Id of this subtype -func (m *PostureCheckFailureOperatingSystem) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this subtype -func (m *PostureCheckFailureOperatingSystem) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this subtype -func (m *PostureCheckFailureOperatingSystem) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this subtype -func (m *PostureCheckFailureOperatingSystem) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this subtype -func (m *PostureCheckFailureOperatingSystem) PostureCheckType() string { - return "OS" -} - -// SetPostureCheckType sets the posture check type of this subtype -func (m *PostureCheckFailureOperatingSystem) SetPostureCheckType(val string) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckFailureOperatingSystem) UnmarshalJSON(raw []byte) error { - var data struct { - - // actual value - // Required: true - ActualValue *PostureCheckFailureOperatingSystemActual `json:"actualValue"` - - // expected value - // Required: true - // Min Items: 1 - ExpectedValue []*OperatingSystem `json:"expectedValue"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckFailureOperatingSystem - - result.postureCheckIdField = base.PostureCheckID - - result.postureCheckNameField = base.PostureCheckName - - if base.PostureCheckType != result.PostureCheckType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid postureCheckType value: %q", base.PostureCheckType) - } - - result.ActualValue = data.ActualValue - result.ExpectedValue = data.ExpectedValue - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckFailureOperatingSystem) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // actual value - // Required: true - ActualValue *PostureCheckFailureOperatingSystemActual `json:"actualValue"` - - // expected value - // Required: true - // Min Items: 1 - ExpectedValue []*OperatingSystem `json:"expectedValue"` - }{ - - ActualValue: m.ActualValue, - - ExpectedValue: m.ExpectedValue, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - }{ - - PostureCheckID: m.PostureCheckID(), - - PostureCheckName: m.PostureCheckName(), - - PostureCheckType: m.PostureCheckType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check failure operating system -func (m *PostureCheckFailureOperatingSystem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureOperatingSystem) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureOperatingSystem) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureOperatingSystem) validateActualValue(formats strfmt.Registry) error { - - if err := validate.Required("actualValue", "body", m.ActualValue); err != nil { - return err - } - - if m.ActualValue != nil { - if err := m.ActualValue.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureOperatingSystem) validateExpectedValue(formats strfmt.Registry) error { - - if err := validate.Required("expectedValue", "body", m.ExpectedValue); err != nil { - return err - } - - iExpectedValueSize := int64(len(m.ExpectedValue)) - - if err := validate.MinItems("expectedValue", "body", iExpectedValueSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.ExpectedValue); i++ { - if swag.IsZero(m.ExpectedValue[i]) { // not required - continue - } - - if m.ExpectedValue[i] != nil { - if err := m.ExpectedValue[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture check failure operating system based on the context it is used -func (m *PostureCheckFailureOperatingSystem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActualValue(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExpectedValue(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureOperatingSystem) contextValidateActualValue(ctx context.Context, formats strfmt.Registry) error { - - if m.ActualValue != nil { - if err := m.ActualValue.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureOperatingSystem) contextValidateExpectedValue(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ExpectedValue); i++ { - - if m.ExpectedValue[i] != nil { - if err := m.ExpectedValue[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureOperatingSystem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureOperatingSystem) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureOperatingSystem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_operating_system_actual.go b/rest_model/posture_check_failure_operating_system_actual.go deleted file mode 100644 index 603cf8ed0..000000000 --- a/rest_model/posture_check_failure_operating_system_actual.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureOperatingSystemActual posture check failure operating system actual -// -// swagger:model postureCheckFailureOperatingSystemActual -type PostureCheckFailureOperatingSystemActual struct { - - // type - // Required: true - Type *string `json:"type"` - - // version - // Required: true - Version *string `json:"version"` -} - -// Validate validates this posture check failure operating system actual -func (m *PostureCheckFailureOperatingSystemActual) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureOperatingSystemActual) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureOperatingSystemActual) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture check failure operating system actual based on context it is used -func (m *PostureCheckFailureOperatingSystemActual) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureOperatingSystemActual) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureOperatingSystemActual) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureOperatingSystemActual - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_process.go b/rest_model/posture_check_failure_process.go deleted file mode 100644 index 1ccb9e3c5..000000000 --- a/rest_model/posture_check_failure_process.go +++ /dev/null @@ -1,338 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureProcess posture check failure process -// -// swagger:model postureCheckFailureProcess -type PostureCheckFailureProcess struct { - postureCheckIdField *string - - postureCheckNameField *string - - // actual value - // Required: true - ActualValue *PostureCheckFailureProcessActual `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue *Process `json:"expectedValue"` -} - -// PostureCheckID gets the posture check Id of this subtype -func (m *PostureCheckFailureProcess) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this subtype -func (m *PostureCheckFailureProcess) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this subtype -func (m *PostureCheckFailureProcess) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this subtype -func (m *PostureCheckFailureProcess) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this subtype -func (m *PostureCheckFailureProcess) PostureCheckType() string { - return "PROCESS" -} - -// SetPostureCheckType sets the posture check type of this subtype -func (m *PostureCheckFailureProcess) SetPostureCheckType(val string) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckFailureProcess) UnmarshalJSON(raw []byte) error { - var data struct { - - // actual value - // Required: true - ActualValue *PostureCheckFailureProcessActual `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue *Process `json:"expectedValue"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckFailureProcess - - result.postureCheckIdField = base.PostureCheckID - - result.postureCheckNameField = base.PostureCheckName - - if base.PostureCheckType != result.PostureCheckType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid postureCheckType value: %q", base.PostureCheckType) - } - - result.ActualValue = data.ActualValue - result.ExpectedValue = data.ExpectedValue - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckFailureProcess) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // actual value - // Required: true - ActualValue *PostureCheckFailureProcessActual `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue *Process `json:"expectedValue"` - }{ - - ActualValue: m.ActualValue, - - ExpectedValue: m.ExpectedValue, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - }{ - - PostureCheckID: m.PostureCheckID(), - - PostureCheckName: m.PostureCheckName(), - - PostureCheckType: m.PostureCheckType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check failure process -func (m *PostureCheckFailureProcess) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedValue(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureProcess) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureProcess) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureProcess) validateActualValue(formats strfmt.Registry) error { - - if err := validate.Required("actualValue", "body", m.ActualValue); err != nil { - return err - } - - if m.ActualValue != nil { - if err := m.ActualValue.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureProcess) validateExpectedValue(formats strfmt.Registry) error { - - if err := validate.Required("expectedValue", "body", m.ExpectedValue); err != nil { - return err - } - - if m.ExpectedValue != nil { - if err := m.ExpectedValue.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check failure process based on the context it is used -func (m *PostureCheckFailureProcess) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActualValue(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExpectedValue(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureProcess) contextValidateActualValue(ctx context.Context, formats strfmt.Registry) error { - - if m.ActualValue != nil { - if err := m.ActualValue.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue") - } - return err - } - } - - return nil -} - -func (m *PostureCheckFailureProcess) contextValidateExpectedValue(ctx context.Context, formats strfmt.Registry) error { - - if m.ExpectedValue != nil { - if err := m.ExpectedValue.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureProcess) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureProcess) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureProcess - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_process_actual.go b/rest_model/posture_check_failure_process_actual.go deleted file mode 100644 index 8e957b329..000000000 --- a/rest_model/posture_check_failure_process_actual.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureProcessActual posture check failure process actual -// -// swagger:model postureCheckFailureProcessActual -type PostureCheckFailureProcessActual struct { - - // hash - // Required: true - Hash *string `json:"hash"` - - // is running - // Required: true - IsRunning *bool `json:"isRunning"` - - // os type - OsType OsType `json:"osType,omitempty"` - - // path - Path string `json:"path,omitempty"` - - // signer fingerprints - // Required: true - SignerFingerprints []string `json:"signerFingerprints"` -} - -// Validate validates this posture check failure process actual -func (m *PostureCheckFailureProcessActual) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHash(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsRunning(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignerFingerprints(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureProcessActual) validateHash(formats strfmt.Registry) error { - - if err := validate.Required("hash", "body", m.Hash); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureProcessActual) validateIsRunning(formats strfmt.Registry) error { - - if err := validate.Required("isRunning", "body", m.IsRunning); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureProcessActual) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required - return nil - } - - if err := m.OsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - - return nil -} - -func (m *PostureCheckFailureProcessActual) validateSignerFingerprints(formats strfmt.Registry) error { - - if err := validate.Required("signerFingerprints", "body", m.SignerFingerprints); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check failure process actual based on the context it is used -func (m *PostureCheckFailureProcessActual) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOsType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureProcessActual) contextValidateOsType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OsType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureProcessActual) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureProcessActual) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureProcessActual - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_failure_process_multi.go b/rest_model/posture_check_failure_process_multi.go deleted file mode 100644 index 415f9cef2..000000000 --- a/rest_model/posture_check_failure_process_multi.go +++ /dev/null @@ -1,424 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckFailureProcessMulti posture check failure process multi -// -// swagger:model postureCheckFailureProcessMulti -type PostureCheckFailureProcessMulti struct { - postureCheckIdField *string - - postureCheckNameField *string - - // actual value - // Required: true - ActualValue []*PostureCheckFailureProcessActual `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []*ProcessMulti `json:"expectedValue"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` -} - -// PostureCheckID gets the posture check Id of this subtype -func (m *PostureCheckFailureProcessMulti) PostureCheckID() *string { - return m.postureCheckIdField -} - -// SetPostureCheckID sets the posture check Id of this subtype -func (m *PostureCheckFailureProcessMulti) SetPostureCheckID(val *string) { - m.postureCheckIdField = val -} - -// PostureCheckName gets the posture check name of this subtype -func (m *PostureCheckFailureProcessMulti) PostureCheckName() *string { - return m.postureCheckNameField -} - -// SetPostureCheckName sets the posture check name of this subtype -func (m *PostureCheckFailureProcessMulti) SetPostureCheckName(val *string) { - m.postureCheckNameField = val -} - -// PostureCheckType gets the posture check type of this subtype -func (m *PostureCheckFailureProcessMulti) PostureCheckType() string { - return "PROCESS_MULTI" -} - -// SetPostureCheckType sets the posture check type of this subtype -func (m *PostureCheckFailureProcessMulti) SetPostureCheckType(val string) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckFailureProcessMulti) UnmarshalJSON(raw []byte) error { - var data struct { - - // actual value - // Required: true - ActualValue []*PostureCheckFailureProcessActual `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []*ProcessMulti `json:"expectedValue"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckFailureProcessMulti - - result.postureCheckIdField = base.PostureCheckID - - result.postureCheckNameField = base.PostureCheckName - - if base.PostureCheckType != result.PostureCheckType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid postureCheckType value: %q", base.PostureCheckType) - } - - result.ActualValue = data.ActualValue - result.ExpectedValue = data.ExpectedValue - result.Semantic = data.Semantic - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckFailureProcessMulti) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // actual value - // Required: true - ActualValue []*PostureCheckFailureProcessActual `json:"actualValue"` - - // expected value - // Required: true - ExpectedValue []*ProcessMulti `json:"expectedValue"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - }{ - - ActualValue: m.ActualValue, - - ExpectedValue: m.ExpectedValue, - - Semantic: m.Semantic, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - PostureCheckID *string `json:"postureCheckId"` - - PostureCheckName *string `json:"postureCheckName"` - - PostureCheckType string `json:"postureCheckType"` - }{ - - PostureCheckID: m.PostureCheckID(), - - PostureCheckName: m.PostureCheckName(), - - PostureCheckType: m.PostureCheckType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check failure process multi -func (m *PostureCheckFailureProcessMulti) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedValue(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureProcessMulti) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureProcessMulti) validatePostureCheckName(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckName", "body", m.PostureCheckName()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckFailureProcessMulti) validateActualValue(formats strfmt.Registry) error { - - if err := validate.Required("actualValue", "body", m.ActualValue); err != nil { - return err - } - - for i := 0; i < len(m.ActualValue); i++ { - if swag.IsZero(m.ActualValue[i]) { // not required - continue - } - - if m.ActualValue[i] != nil { - if err := m.ActualValue[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckFailureProcessMulti) validateExpectedValue(formats strfmt.Registry) error { - - if err := validate.Required("expectedValue", "body", m.ExpectedValue); err != nil { - return err - } - - for i := 0; i < len(m.ExpectedValue); i++ { - if swag.IsZero(m.ExpectedValue[i]) { // not required - continue - } - - if m.ExpectedValue[i] != nil { - if err := m.ExpectedValue[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckFailureProcessMulti) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check failure process multi based on the context it is used -func (m *PostureCheckFailureProcessMulti) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateActualValue(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExpectedValue(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckFailureProcessMulti) contextValidateActualValue(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ActualValue); i++ { - - if m.ActualValue[i] != nil { - if err := m.ActualValue[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("actualValue" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("actualValue" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckFailureProcessMulti) contextValidateExpectedValue(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ExpectedValue); i++ { - - if m.ExpectedValue[i] != nil { - if err := m.ExpectedValue[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("expectedValue" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckFailureProcessMulti) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckFailureProcessMulti) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckFailureProcessMulti) UnmarshalBinary(b []byte) error { - var res PostureCheckFailureProcessMulti - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mac_address_create.go b/rest_model/posture_check_mac_address_create.go deleted file mode 100644 index 042be3cf2..000000000 --- a/rest_model/posture_check_mac_address_create.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMacAddressCreate posture check mac address create -// -// swagger:model postureCheckMacAddressCreate -type PostureCheckMacAddressCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` -} - -// Name gets the name of this subtype -func (m *PostureCheckMacAddressCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMacAddressCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMacAddressCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMacAddressCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMacAddressCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMacAddressCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMacAddressCreate) TypeID() PostureCheckType { - return "MAC" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMacAddressCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMacAddressCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMacAddressCreate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.MacAddresses = data.MacAddresses - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMacAddressCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - }{ - - MacAddresses: m.MacAddresses, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mac address create -func (m *PostureCheckMacAddressCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddresses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressCreate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressCreate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressCreate) validateMacAddresses(formats strfmt.Registry) error { - - if err := validate.Required("macAddresses", "body", m.MacAddresses); err != nil { - return err - } - - iMacAddressesSize := int64(len(m.MacAddresses)) - - if err := validate.MinItems("macAddresses", "body", iMacAddressesSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check mac address create based on the context it is used -func (m *PostureCheckMacAddressCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMacAddressCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMacAddressCreate) UnmarshalBinary(b []byte) error { - var res PostureCheckMacAddressCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mac_address_detail.go b/rest_model/posture_check_mac_address_detail.go deleted file mode 100644 index 20de90699..000000000 --- a/rest_model/posture_check_mac_address_detail.go +++ /dev/null @@ -1,553 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMacAddressDetail posture check mac address detail -// -// swagger:model postureCheckMacAddressDetail -type PostureCheckMacAddressDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - updatedAtField *strfmt.DateTime - - versionField *int64 - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` -} - -// Links gets the links of this subtype -func (m *PostureCheckMacAddressDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this subtype -func (m *PostureCheckMacAddressDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this subtype -func (m *PostureCheckMacAddressDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this subtype -func (m *PostureCheckMacAddressDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this subtype -func (m *PostureCheckMacAddressDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureCheckMacAddressDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this subtype -func (m *PostureCheckMacAddressDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMacAddressDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMacAddressDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMacAddressDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMacAddressDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMacAddressDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMacAddressDetail) TypeID() string { - return "MAC" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMacAddressDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this subtype -func (m *PostureCheckMacAddressDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this subtype -func (m *PostureCheckMacAddressDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this subtype -func (m *PostureCheckMacAddressDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this subtype -func (m *PostureCheckMacAddressDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMacAddressDetail) UnmarshalJSON(raw []byte) error { - var data struct { - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMacAddressDetail - - result.linksField = base.Links - - result.createdAtField = base.CreatedAt - - result.idField = base.ID - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.updatedAtField = base.UpdatedAt - - result.versionField = base.Version - - result.MacAddresses = data.MacAddresses - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMacAddressDetail) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - }{ - - MacAddresses: m.MacAddresses, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - }{ - - Links: m.Links(), - - CreatedAt: m.CreatedAt(), - - ID: m.ID(), - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - - UpdatedAt: m.UpdatedAt(), - - Version: m.Version(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mac address detail -func (m *PostureCheckMacAddressDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddresses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) validateMacAddresses(formats strfmt.Registry) error { - - if err := validate.Required("macAddresses", "body", m.MacAddresses); err != nil { - return err - } - - iMacAddressesSize := int64(len(m.MacAddresses)) - - if err := validate.MinItems("macAddresses", "body", iMacAddressesSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check mac address detail based on the context it is used -func (m *PostureCheckMacAddressDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMacAddressDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMacAddressDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckMacAddressDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mac_address_patch.go b/rest_model/posture_check_mac_address_patch.go deleted file mode 100644 index 17fa7618c..000000000 --- a/rest_model/posture_check_mac_address_patch.go +++ /dev/null @@ -1,350 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMacAddressPatch posture check mac address patch -// -// swagger:model postureCheckMacAddressPatch -type PostureCheckMacAddressPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - // mac addresses - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` -} - -// Name gets the name of this subtype -func (m *PostureCheckMacAddressPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMacAddressPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMacAddressPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMacAddressPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMacAddressPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMacAddressPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMacAddressPatch) TypeID() PostureCheckType { - return "MAC" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMacAddressPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMacAddressPatch) UnmarshalJSON(raw []byte) error { - var data struct { - - // mac addresses - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMacAddressPatch - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.MacAddresses = data.MacAddresses - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMacAddressPatch) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // mac addresses - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - }{ - - MacAddresses: m.MacAddresses, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mac address patch -func (m *PostureCheckMacAddressPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddresses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressPatch) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressPatch) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressPatch) validateMacAddresses(formats strfmt.Registry) error { - - if swag.IsZero(m.MacAddresses) { // not required - return nil - } - - iMacAddressesSize := int64(len(m.MacAddresses)) - - if err := validate.MinItems("macAddresses", "body", iMacAddressesSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check mac address patch based on the context it is used -func (m *PostureCheckMacAddressPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMacAddressPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMacAddressPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckMacAddressPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mac_address_update.go b/rest_model/posture_check_mac_address_update.go deleted file mode 100644 index 55be075b8..000000000 --- a/rest_model/posture_check_mac_address_update.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMacAddressUpdate posture check mac address update -// -// swagger:model postureCheckMacAddressUpdate -type PostureCheckMacAddressUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` -} - -// Name gets the name of this subtype -func (m *PostureCheckMacAddressUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMacAddressUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMacAddressUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMacAddressUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMacAddressUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMacAddressUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMacAddressUpdate) TypeID() PostureCheckType { - return "MAC" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMacAddressUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMacAddressUpdate) UnmarshalJSON(raw []byte) error { - var data struct { - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMacAddressUpdate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.MacAddresses = data.MacAddresses - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMacAddressUpdate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // mac addresses - // Required: true - // Min Items: 1 - MacAddresses []string `json:"macAddresses"` - }{ - - MacAddresses: m.MacAddresses, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mac address update -func (m *PostureCheckMacAddressUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddresses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMacAddressUpdate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressUpdate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressUpdate) validateMacAddresses(formats strfmt.Registry) error { - - if err := validate.Required("macAddresses", "body", m.MacAddresses); err != nil { - return err - } - - iMacAddressesSize := int64(len(m.MacAddresses)) - - if err := validate.MinItems("macAddresses", "body", iMacAddressesSize, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check mac address update based on the context it is used -func (m *PostureCheckMacAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMacAddressUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMacAddressUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMacAddressUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMacAddressUpdate) UnmarshalBinary(b []byte) error { - var res PostureCheckMacAddressUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mfa_create.go b/rest_model/posture_check_mfa_create.go deleted file mode 100644 index 0ed321e00..000000000 --- a/rest_model/posture_check_mfa_create.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMfaCreate posture check mfa create -// -// swagger:model postureCheckMfaCreate -type PostureCheckMfaCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - PostureCheckMfaProperties -} - -// Name gets the name of this subtype -func (m *PostureCheckMfaCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMfaCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMfaCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMfaCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMfaCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMfaCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMfaCreate) TypeID() PostureCheckType { - return "MFA" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMfaCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMfaCreate) UnmarshalJSON(raw []byte) error { - var data struct { - PostureCheckMfaProperties - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMfaCreate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.PostureCheckMfaProperties = data.PostureCheckMfaProperties - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMfaCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - PostureCheckMfaProperties - }{ - - PostureCheckMfaProperties: m.PostureCheckMfaProperties, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mfa create -func (m *PostureCheckMfaCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaProperties - if err := m.PostureCheckMfaProperties.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMfaCreate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaCreate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check mfa create based on the context it is used -func (m *PostureCheckMfaCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaProperties - if err := m.PostureCheckMfaProperties.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMfaCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMfaCreate) UnmarshalBinary(b []byte) error { - var res PostureCheckMfaCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mfa_detail.go b/rest_model/posture_check_mfa_detail.go deleted file mode 100644 index 10b26728a..000000000 --- a/rest_model/posture_check_mfa_detail.go +++ /dev/null @@ -1,533 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMfaDetail posture check mfa detail -// -// swagger:model postureCheckMfaDetail -type PostureCheckMfaDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - updatedAtField *strfmt.DateTime - - versionField *int64 - - PostureCheckMfaProperties -} - -// Links gets the links of this subtype -func (m *PostureCheckMfaDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this subtype -func (m *PostureCheckMfaDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this subtype -func (m *PostureCheckMfaDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this subtype -func (m *PostureCheckMfaDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this subtype -func (m *PostureCheckMfaDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureCheckMfaDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this subtype -func (m *PostureCheckMfaDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMfaDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMfaDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMfaDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMfaDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMfaDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMfaDetail) TypeID() string { - return "MFA" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMfaDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this subtype -func (m *PostureCheckMfaDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this subtype -func (m *PostureCheckMfaDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this subtype -func (m *PostureCheckMfaDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this subtype -func (m *PostureCheckMfaDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMfaDetail) UnmarshalJSON(raw []byte) error { - var data struct { - PostureCheckMfaProperties - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMfaDetail - - result.linksField = base.Links - - result.createdAtField = base.CreatedAt - - result.idField = base.ID - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.updatedAtField = base.UpdatedAt - - result.versionField = base.Version - - result.PostureCheckMfaProperties = data.PostureCheckMfaProperties - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMfaDetail) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - PostureCheckMfaProperties - }{ - - PostureCheckMfaProperties: m.PostureCheckMfaProperties, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - }{ - - Links: m.Links(), - - CreatedAt: m.CreatedAt(), - - ID: m.ID(), - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - - UpdatedAt: m.UpdatedAt(), - - Version: m.Version(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mfa detail -func (m *PostureCheckMfaDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaProperties - if err := m.PostureCheckMfaProperties.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMfaDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check mfa detail based on the context it is used -func (m *PostureCheckMfaDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaProperties - if err := m.PostureCheckMfaProperties.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *PostureCheckMfaDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMfaDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMfaDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckMfaDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mfa_patch.go b/rest_model/posture_check_mfa_patch.go deleted file mode 100644 index 23dd87ade..000000000 --- a/rest_model/posture_check_mfa_patch.go +++ /dev/null @@ -1,331 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureCheckMfaPatch posture check mfa patch -// -// swagger:model postureCheckMfaPatch -type PostureCheckMfaPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - PostureCheckMfaPropertiesPatch -} - -// Name gets the name of this subtype -func (m *PostureCheckMfaPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMfaPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMfaPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMfaPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMfaPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMfaPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMfaPatch) TypeID() PostureCheckType { - return "MFA" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMfaPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMfaPatch) UnmarshalJSON(raw []byte) error { - var data struct { - PostureCheckMfaPropertiesPatch - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMfaPatch - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.PostureCheckMfaPropertiesPatch = data.PostureCheckMfaPropertiesPatch - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMfaPatch) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - PostureCheckMfaPropertiesPatch - }{ - - PostureCheckMfaPropertiesPatch: m.PostureCheckMfaPropertiesPatch, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mfa patch -func (m *PostureCheckMfaPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaPropertiesPatch - if err := m.PostureCheckMfaPropertiesPatch.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaPatch) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaPatch) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check mfa patch based on the context it is used -func (m *PostureCheckMfaPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaPropertiesPatch - if err := m.PostureCheckMfaPropertiesPatch.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMfaPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMfaPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckMfaPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mfa_properties.go b/rest_model/posture_check_mfa_properties.go deleted file mode 100644 index bfcaddaab..000000000 --- a/rest_model/posture_check_mfa_properties.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureCheckMfaProperties posture check mfa properties -// -// swagger:model postureCheckMfaProperties -type PostureCheckMfaProperties struct { - - // ignore legacy endpoints - IgnoreLegacyEndpoints bool `json:"ignoreLegacyEndpoints,omitempty"` - - // prompt on unlock - PromptOnUnlock bool `json:"promptOnUnlock,omitempty"` - - // prompt on wake - PromptOnWake bool `json:"promptOnWake,omitempty"` - - // timeout seconds - TimeoutSeconds int64 `json:"timeoutSeconds,omitempty"` -} - -// Validate validates this posture check mfa properties -func (m *PostureCheckMfaProperties) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this posture check mfa properties based on context it is used -func (m *PostureCheckMfaProperties) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMfaProperties) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMfaProperties) UnmarshalBinary(b []byte) error { - var res PostureCheckMfaProperties - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mfa_properties_patch.go b/rest_model/posture_check_mfa_properties_patch.go deleted file mode 100644 index 63a2d8708..000000000 --- a/rest_model/posture_check_mfa_properties_patch.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureCheckMfaPropertiesPatch posture check mfa properties patch -// -// swagger:model postureCheckMfaPropertiesPatch -type PostureCheckMfaPropertiesPatch struct { - - // ignore legacy endpoints - IgnoreLegacyEndpoints *bool `json:"ignoreLegacyEndpoints,omitempty"` - - // prompt on unlock - PromptOnUnlock *bool `json:"promptOnUnlock,omitempty"` - - // prompt on wake - PromptOnWake *bool `json:"promptOnWake,omitempty"` - - // timeout seconds - TimeoutSeconds *int64 `json:"timeoutSeconds,omitempty"` -} - -// Validate validates this posture check mfa properties patch -func (m *PostureCheckMfaPropertiesPatch) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this posture check mfa properties patch based on context it is used -func (m *PostureCheckMfaPropertiesPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMfaPropertiesPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMfaPropertiesPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckMfaPropertiesPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_mfa_update.go b/rest_model/posture_check_mfa_update.go deleted file mode 100644 index f56990f52..000000000 --- a/rest_model/posture_check_mfa_update.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckMfaUpdate posture check mfa update -// -// swagger:model postureCheckMfaUpdate -type PostureCheckMfaUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - PostureCheckMfaProperties -} - -// Name gets the name of this subtype -func (m *PostureCheckMfaUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckMfaUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckMfaUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckMfaUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckMfaUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckMfaUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckMfaUpdate) TypeID() PostureCheckType { - return "MFA" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckMfaUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckMfaUpdate) UnmarshalJSON(raw []byte) error { - var data struct { - PostureCheckMfaProperties - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckMfaUpdate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.PostureCheckMfaProperties = data.PostureCheckMfaProperties - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckMfaUpdate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - PostureCheckMfaProperties - }{ - - PostureCheckMfaProperties: m.PostureCheckMfaProperties, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check mfa update -func (m *PostureCheckMfaUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaProperties - if err := m.PostureCheckMfaProperties.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckMfaUpdate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaUpdate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check mfa update based on the context it is used -func (m *PostureCheckMfaUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - // validation for a type composition with PostureCheckMfaProperties - if err := m.PostureCheckMfaProperties.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckMfaUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckMfaUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckMfaUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckMfaUpdate) UnmarshalBinary(b []byte) error { - var res PostureCheckMfaUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_operating_system_create.go b/rest_model/posture_check_operating_system_create.go deleted file mode 100644 index 8a0ccee0c..000000000 --- a/rest_model/posture_check_operating_system_create.go +++ /dev/null @@ -1,409 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckOperatingSystemCreate posture check operating system create -// -// swagger:model postureCheckOperatingSystemCreate -type PostureCheckOperatingSystemCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // operating systems - // Required: true - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` -} - -// Name gets the name of this subtype -func (m *PostureCheckOperatingSystemCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckOperatingSystemCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckOperatingSystemCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckOperatingSystemCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckOperatingSystemCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckOperatingSystemCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckOperatingSystemCreate) TypeID() PostureCheckType { - return "OS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckOperatingSystemCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckOperatingSystemCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // operating systems - // Required: true - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckOperatingSystemCreate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.OperatingSystems = data.OperatingSystems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckOperatingSystemCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // operating systems - // Required: true - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - }{ - - OperatingSystems: m.OperatingSystems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check operating system create -func (m *PostureCheckOperatingSystemCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingSystems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemCreate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemCreate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemCreate) validateOperatingSystems(formats strfmt.Registry) error { - - if err := validate.Required("operatingSystems", "body", m.OperatingSystems); err != nil { - return err - } - - iOperatingSystemsSize := int64(len(m.OperatingSystems)) - - if err := validate.MinItems("operatingSystems", "body", iOperatingSystemsSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.OperatingSystems); i++ { - if swag.IsZero(m.OperatingSystems[i]) { // not required - continue - } - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture check operating system create based on the context it is used -func (m *PostureCheckOperatingSystemCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperatingSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemCreate) contextValidateOperatingSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.OperatingSystems); i++ { - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckOperatingSystemCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckOperatingSystemCreate) UnmarshalBinary(b []byte) error { - var res PostureCheckOperatingSystemCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_operating_system_detail.go b/rest_model/posture_check_operating_system_detail.go deleted file mode 100644 index b9f35a0c2..000000000 --- a/rest_model/posture_check_operating_system_detail.go +++ /dev/null @@ -1,587 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckOperatingSystemDetail posture check operating system detail -// -// swagger:model postureCheckOperatingSystemDetail -type PostureCheckOperatingSystemDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - updatedAtField *strfmt.DateTime - - versionField *int64 - - // operating systems - // Required: true - OperatingSystems []*OperatingSystem `json:"operatingSystems"` -} - -// Links gets the links of this subtype -func (m *PostureCheckOperatingSystemDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this subtype -func (m *PostureCheckOperatingSystemDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this subtype -func (m *PostureCheckOperatingSystemDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this subtype -func (m *PostureCheckOperatingSystemDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this subtype -func (m *PostureCheckOperatingSystemDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureCheckOperatingSystemDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this subtype -func (m *PostureCheckOperatingSystemDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckOperatingSystemDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckOperatingSystemDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckOperatingSystemDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckOperatingSystemDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckOperatingSystemDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckOperatingSystemDetail) TypeID() string { - return "OS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckOperatingSystemDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this subtype -func (m *PostureCheckOperatingSystemDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this subtype -func (m *PostureCheckOperatingSystemDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this subtype -func (m *PostureCheckOperatingSystemDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this subtype -func (m *PostureCheckOperatingSystemDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckOperatingSystemDetail) UnmarshalJSON(raw []byte) error { - var data struct { - - // operating systems - // Required: true - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckOperatingSystemDetail - - result.linksField = base.Links - - result.createdAtField = base.CreatedAt - - result.idField = base.ID - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.updatedAtField = base.UpdatedAt - - result.versionField = base.Version - - result.OperatingSystems = data.OperatingSystems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckOperatingSystemDetail) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // operating systems - // Required: true - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - }{ - - OperatingSystems: m.OperatingSystems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - }{ - - Links: m.Links(), - - CreatedAt: m.CreatedAt(), - - ID: m.ID(), - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - - UpdatedAt: m.UpdatedAt(), - - Version: m.Version(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check operating system detail -func (m *PostureCheckOperatingSystemDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingSystems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) validateOperatingSystems(formats strfmt.Registry) error { - - if err := validate.Required("operatingSystems", "body", m.OperatingSystems); err != nil { - return err - } - - for i := 0; i < len(m.OperatingSystems); i++ { - if swag.IsZero(m.OperatingSystems[i]) { // not required - continue - } - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture check operating system detail based on the context it is used -func (m *PostureCheckOperatingSystemDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperatingSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemDetail) contextValidateOperatingSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.OperatingSystems); i++ { - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckOperatingSystemDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckOperatingSystemDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckOperatingSystemDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_operating_system_patch.go b/rest_model/posture_check_operating_system_patch.go deleted file mode 100644 index 4249c4307..000000000 --- a/rest_model/posture_check_operating_system_patch.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckOperatingSystemPatch posture check operating system patch -// -// swagger:model postureCheckOperatingSystemPatch -type PostureCheckOperatingSystemPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - // operating systems - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` -} - -// Name gets the name of this subtype -func (m *PostureCheckOperatingSystemPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckOperatingSystemPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckOperatingSystemPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckOperatingSystemPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckOperatingSystemPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckOperatingSystemPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckOperatingSystemPatch) TypeID() PostureCheckType { - return "OS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckOperatingSystemPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckOperatingSystemPatch) UnmarshalJSON(raw []byte) error { - var data struct { - - // operating systems - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckOperatingSystemPatch - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.OperatingSystems = data.OperatingSystems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckOperatingSystemPatch) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // operating systems - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - }{ - - OperatingSystems: m.OperatingSystems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check operating system patch -func (m *PostureCheckOperatingSystemPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingSystems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemPatch) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemPatch) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemPatch) validateOperatingSystems(formats strfmt.Registry) error { - - if swag.IsZero(m.OperatingSystems) { // not required - return nil - } - - iOperatingSystemsSize := int64(len(m.OperatingSystems)) - - if err := validate.MinItems("operatingSystems", "body", iOperatingSystemsSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.OperatingSystems); i++ { - if swag.IsZero(m.OperatingSystems[i]) { // not required - continue - } - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture check operating system patch based on the context it is used -func (m *PostureCheckOperatingSystemPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperatingSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemPatch) contextValidateOperatingSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.OperatingSystems); i++ { - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckOperatingSystemPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckOperatingSystemPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckOperatingSystemPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_operating_system_update.go b/rest_model/posture_check_operating_system_update.go deleted file mode 100644 index 15eddb6bf..000000000 --- a/rest_model/posture_check_operating_system_update.go +++ /dev/null @@ -1,409 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckOperatingSystemUpdate posture check operating system update -// -// swagger:model postureCheckOperatingSystemUpdate -type PostureCheckOperatingSystemUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // operating systems - // Required: true - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` -} - -// Name gets the name of this subtype -func (m *PostureCheckOperatingSystemUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckOperatingSystemUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckOperatingSystemUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckOperatingSystemUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckOperatingSystemUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckOperatingSystemUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckOperatingSystemUpdate) TypeID() PostureCheckType { - return "OS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckOperatingSystemUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckOperatingSystemUpdate) UnmarshalJSON(raw []byte) error { - var data struct { - - // operating systems - // Required: true - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckOperatingSystemUpdate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.OperatingSystems = data.OperatingSystems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckOperatingSystemUpdate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // operating systems - // Required: true - // Min Items: 1 - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - }{ - - OperatingSystems: m.OperatingSystems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check operating system update -func (m *PostureCheckOperatingSystemUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingSystems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) validateOperatingSystems(formats strfmt.Registry) error { - - if err := validate.Required("operatingSystems", "body", m.OperatingSystems); err != nil { - return err - } - - iOperatingSystemsSize := int64(len(m.OperatingSystems)) - - if err := validate.MinItems("operatingSystems", "body", iOperatingSystemsSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.OperatingSystems); i++ { - if swag.IsZero(m.OperatingSystems[i]) { // not required - continue - } - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture check operating system update based on the context it is used -func (m *PostureCheckOperatingSystemUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperatingSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckOperatingSystemUpdate) contextValidateOperatingSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.OperatingSystems); i++ { - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckOperatingSystemUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckOperatingSystemUpdate) UnmarshalBinary(b []byte) error { - var res PostureCheckOperatingSystemUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_patch.go b/rest_model/posture_check_patch.go deleted file mode 100644 index 91228993e..000000000 --- a/rest_model/posture_check_patch.go +++ /dev/null @@ -1,337 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "io/ioutil" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckPatch posture check patch -// -// swagger:discriminator postureCheckPatch typeId -type PostureCheckPatch interface { - runtime.Validatable - runtime.ContextValidatable - - // name - Name() string - SetName(string) - - // role attributes - RoleAttributes() *Attributes - SetRoleAttributes(*Attributes) - - // tags - Tags() *Tags - SetTags(*Tags) - - // type Id - // Required: true - TypeID() PostureCheckType - SetTypeID(PostureCheckType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type postureCheckPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - typeIdField PostureCheckType -} - -// Name gets the name of this polymorphic type -func (m *postureCheckPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this polymorphic type -func (m *postureCheckPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this polymorphic type -func (m *postureCheckPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this polymorphic type -func (m *postureCheckPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this polymorphic type -func (m *postureCheckPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this polymorphic type -func (m *postureCheckPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this polymorphic type -func (m *postureCheckPatch) TypeID() PostureCheckType { - return "postureCheckPatch" -} - -// SetTypeID sets the type Id of this polymorphic type -func (m *postureCheckPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalPostureCheckPatchSlice unmarshals polymorphic slices of PostureCheckPatch -func UnmarshalPostureCheckPatchSlice(reader io.Reader, consumer runtime.Consumer) ([]PostureCheckPatch, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []PostureCheckPatch - for _, element := range elements { - obj, err := unmarshalPostureCheckPatch(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalPostureCheckPatch unmarshals polymorphic PostureCheckPatch -func UnmarshalPostureCheckPatch(reader io.Reader, consumer runtime.Consumer) (PostureCheckPatch, error) { - // we need to read this twice, so first into a buffer - data, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalPostureCheckPatch(data, consumer) -} - -func unmarshalPostureCheckPatch(data []byte, consumer runtime.Consumer) (PostureCheckPatch, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the typeId property. - var getType struct { - TypeID string `json:"typeId"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("typeId", "body", getType.TypeID); err != nil { - return nil, err - } - - // The value of typeId is used to determine which type to create and unmarshal the data into - switch getType.TypeID { - case "DOMAIN": - var result PostureCheckDomainPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MAC": - var result PostureCheckMacAddressPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MFA": - var result PostureCheckMfaPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "OS": - var result PostureCheckOperatingSystemPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS": - var result PostureCheckProcessPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS_MULTI": - var result PostureCheckProcessMultiPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "postureCheckPatch": - var result postureCheckPatch - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid typeId value: %q", getType.TypeID) -} - -// Validate validates this posture check patch -func (m *postureCheckPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckPatch) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check patch based on the context it is used -func (m *postureCheckPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *postureCheckPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} diff --git a/rest_model/posture_check_process_create.go b/rest_model/posture_check_process_create.go deleted file mode 100644 index 679a17ff6..000000000 --- a/rest_model/posture_check_process_create.go +++ /dev/null @@ -1,388 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessCreate posture check process create -// -// swagger:model postureCheckProcessCreate -type PostureCheckProcessCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // process - // Required: true - Process *Process `json:"process"` -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessCreate) TypeID() PostureCheckType { - return "PROCESS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // process - // Required: true - Process *Process `json:"process"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessCreate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Process = data.Process - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // process - // Required: true - Process *Process `json:"process"` - }{ - - Process: m.Process, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process create -func (m *PostureCheckProcessCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcess(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessCreate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessCreate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessCreate) validateProcess(formats strfmt.Registry) error { - - if err := validate.Required("process", "body", m.Process); err != nil { - return err - } - - if m.Process != nil { - if err := m.Process.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process create based on the context it is used -func (m *PostureCheckProcessCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcess(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessCreate) contextValidateProcess(ctx context.Context, formats strfmt.Registry) error { - - if m.Process != nil { - if err := m.Process.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessCreate) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_detail.go b/rest_model/posture_check_process_detail.go deleted file mode 100644 index e23d54836..000000000 --- a/rest_model/posture_check_process_detail.go +++ /dev/null @@ -1,575 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessDetail posture check process detail -// -// swagger:model postureCheckProcessDetail -type PostureCheckProcessDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - updatedAtField *strfmt.DateTime - - versionField *int64 - - // process - // Required: true - Process *Process `json:"process"` -} - -// Links gets the links of this subtype -func (m *PostureCheckProcessDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this subtype -func (m *PostureCheckProcessDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this subtype -func (m *PostureCheckProcessDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this subtype -func (m *PostureCheckProcessDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this subtype -func (m *PostureCheckProcessDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureCheckProcessDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessDetail) TypeID() string { - return "PROCESS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this subtype -func (m *PostureCheckProcessDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this subtype -func (m *PostureCheckProcessDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this subtype -func (m *PostureCheckProcessDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this subtype -func (m *PostureCheckProcessDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessDetail) UnmarshalJSON(raw []byte) error { - var data struct { - - // process - // Required: true - Process *Process `json:"process"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessDetail - - result.linksField = base.Links - - result.createdAtField = base.CreatedAt - - result.idField = base.ID - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.updatedAtField = base.UpdatedAt - - result.versionField = base.Version - - result.Process = data.Process - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessDetail) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // process - // Required: true - Process *Process `json:"process"` - }{ - - Process: m.Process, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - }{ - - Links: m.Links(), - - CreatedAt: m.CreatedAt(), - - ID: m.ID(), - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - - UpdatedAt: m.UpdatedAt(), - - Version: m.Version(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process detail -func (m *PostureCheckProcessDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcess(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessDetail) validateProcess(formats strfmt.Registry) error { - - if err := validate.Required("process", "body", m.Process); err != nil { - return err - } - - if m.Process != nil { - if err := m.Process.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process detail based on the context it is used -func (m *PostureCheckProcessDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcess(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessDetail) contextValidateProcess(ctx context.Context, formats strfmt.Registry) error { - - if m.Process != nil { - if err := m.Process.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_multi_create.go b/rest_model/posture_check_process_multi_create.go deleted file mode 100644 index 539eec674..000000000 --- a/rest_model/posture_check_process_multi_create.go +++ /dev/null @@ -1,472 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessMultiCreate posture check process multi create -// -// swagger:model postureCheckProcessMultiCreate -type PostureCheckProcessMultiCreate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessMultiCreate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessMultiCreate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessMultiCreate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessMultiCreate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessMultiCreate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessMultiCreate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessMultiCreate) TypeID() PostureCheckType { - return "PROCESS_MULTI" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessMultiCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessMultiCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessMultiCreate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Processes = data.Processes - result.Semantic = data.Semantic - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessMultiCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - }{ - - Processes: m.Processes, - - Semantic: m.Semantic, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process multi create -func (m *PostureCheckProcessMultiCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcesses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) validateProcesses(formats strfmt.Registry) error { - - if err := validate.Required("processes", "body", m.Processes); err != nil { - return err - } - - iProcessesSize := int64(len(m.Processes)) - - if err := validate.MinItems("processes", "body", iProcessesSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.Processes); i++ { - if swag.IsZero(m.Processes[i]) { // not required - continue - } - - if m.Processes[i] != nil { - if err := m.Processes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process multi create based on the context it is used -func (m *PostureCheckProcessMultiCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcesses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiCreate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) contextValidateProcesses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Processes); i++ { - - if m.Processes[i] != nil { - if err := m.Processes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiCreate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessMultiCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessMultiCreate) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessMultiCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_multi_detail.go b/rest_model/posture_check_process_multi_detail.go deleted file mode 100644 index 194f99d0c..000000000 --- a/rest_model/posture_check_process_multi_detail.go +++ /dev/null @@ -1,659 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessMultiDetail posture check process multi detail -// -// swagger:model postureCheckProcessMultiDetail -type PostureCheckProcessMultiDetail struct { - linksField Links - - createdAtField *strfmt.DateTime - - idField *string - - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - updatedAtField *strfmt.DateTime - - versionField *int64 - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` -} - -// Links gets the links of this subtype -func (m *PostureCheckProcessMultiDetail) Links() Links { - return m.linksField -} - -// SetLinks sets the links of this subtype -func (m *PostureCheckProcessMultiDetail) SetLinks(val Links) { - m.linksField = val -} - -// CreatedAt gets the created at of this subtype -func (m *PostureCheckProcessMultiDetail) CreatedAt() *strfmt.DateTime { - return m.createdAtField -} - -// SetCreatedAt sets the created at of this subtype -func (m *PostureCheckProcessMultiDetail) SetCreatedAt(val *strfmt.DateTime) { - m.createdAtField = val -} - -// ID gets the id of this subtype -func (m *PostureCheckProcessMultiDetail) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureCheckProcessMultiDetail) SetID(val *string) { - m.idField = val -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessMultiDetail) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessMultiDetail) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessMultiDetail) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessMultiDetail) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessMultiDetail) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessMultiDetail) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessMultiDetail) TypeID() string { - return "PROCESS_MULTI" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessMultiDetail) SetTypeID(val string) { -} - -// UpdatedAt gets the updated at of this subtype -func (m *PostureCheckProcessMultiDetail) UpdatedAt() *strfmt.DateTime { - return m.updatedAtField -} - -// SetUpdatedAt sets the updated at of this subtype -func (m *PostureCheckProcessMultiDetail) SetUpdatedAt(val *strfmt.DateTime) { - m.updatedAtField = val -} - -// Version gets the version of this subtype -func (m *PostureCheckProcessMultiDetail) Version() *int64 { - return m.versionField -} - -// SetVersion sets the version of this subtype -func (m *PostureCheckProcessMultiDetail) SetVersion(val *int64) { - m.versionField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessMultiDetail) UnmarshalJSON(raw []byte) error { - var data struct { - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessMultiDetail - - result.linksField = base.Links - - result.createdAtField = base.CreatedAt - - result.idField = base.ID - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - result.updatedAtField = base.UpdatedAt - - result.versionField = base.Version - - result.Processes = data.Processes - result.Semantic = data.Semantic - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessMultiDetail) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - }{ - - Processes: m.Processes, - - Semantic: m.Semantic, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Links Links `json:"_links"` - - CreatedAt *strfmt.DateTime `json:"createdAt"` - - ID *string `json:"id"` - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - Tags *Tags `json:"tags"` - - TypeID string `json:"typeId"` - - UpdatedAt *strfmt.DateTime `json:"updatedAt"` - - Version *int64 `json:"version"` - }{ - - Links: m.Links(), - - CreatedAt: m.CreatedAt(), - - ID: m.ID(), - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - - UpdatedAt: m.UpdatedAt(), - - Version: m.Version(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process multi detail -func (m *PostureCheckProcessMultiDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLinks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcesses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateLinks(formats strfmt.Registry) error { - - if err := validate.Required("_links", "body", m.Links()); err != nil { - return err - } - - if m.Links() != nil { - if err := m.Links().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes()); err != nil { - return err - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateTags(formats strfmt.Registry) error { - - if err := validate.Required("tags", "body", m.Tags()); err != nil { - return err - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt()); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateProcesses(formats strfmt.Registry) error { - - if err := validate.Required("processes", "body", m.Processes); err != nil { - return err - } - - iProcessesSize := int64(len(m.Processes)) - - if err := validate.MinItems("processes", "body", iProcessesSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.Processes); i++ { - if swag.IsZero(m.Processes[i]) { // not required - continue - } - - if m.Processes[i] != nil { - if err := m.Processes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process multi detail based on the context it is used -func (m *PostureCheckProcessMultiDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateLinks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcesses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiDetail) contextValidateLinks(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Links().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("_links") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("_links") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) contextValidateProcesses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Processes); i++ { - - if m.Processes[i] != nil { - if err := m.Processes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiDetail) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessMultiDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessMultiDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessMultiDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_multi_patch.go b/rest_model/posture_check_process_multi_patch.go deleted file mode 100644 index 131d3bcd8..000000000 --- a/rest_model/posture_check_process_multi_patch.go +++ /dev/null @@ -1,445 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessMultiPatch posture check process multi patch -// -// swagger:model postureCheckProcessMultiPatch -type PostureCheckProcessMultiPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - // processes - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - Semantic Semantic `json:"semantic,omitempty"` -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessMultiPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessMultiPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessMultiPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessMultiPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessMultiPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessMultiPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessMultiPatch) TypeID() PostureCheckType { - return "PROCESS_MULTI" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessMultiPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessMultiPatch) UnmarshalJSON(raw []byte) error { - var data struct { - - // processes - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - Semantic Semantic `json:"semantic,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessMultiPatch - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Processes = data.Processes - result.Semantic = data.Semantic - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessMultiPatch) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // processes - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - Semantic Semantic `json:"semantic,omitempty"` - }{ - - Processes: m.Processes, - - Semantic: m.Semantic, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process multi patch -func (m *PostureCheckProcessMultiPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcesses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiPatch) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) validateProcesses(formats strfmt.Registry) error { - - if swag.IsZero(m.Processes) { // not required - return nil - } - - iProcessesSize := int64(len(m.Processes)) - - if err := validate.MinItems("processes", "body", iProcessesSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.Processes); i++ { - if swag.IsZero(m.Processes[i]) { // not required - continue - } - - if m.Processes[i] != nil { - if err := m.Processes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) validateSemantic(formats strfmt.Registry) error { - - if swag.IsZero(m.Semantic) { // not required - return nil - } - - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -// ContextValidate validate this posture check process multi patch based on the context it is used -func (m *PostureCheckProcessMultiPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcesses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) contextValidateProcesses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Processes); i++ { - - if m.Processes[i] != nil { - if err := m.Processes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiPatch) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessMultiPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessMultiPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessMultiPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_multi_update.go b/rest_model/posture_check_process_multi_update.go deleted file mode 100644 index 26944048c..000000000 --- a/rest_model/posture_check_process_multi_update.go +++ /dev/null @@ -1,472 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessMultiUpdate posture check process multi update -// -// swagger:model postureCheckProcessMultiUpdate -type PostureCheckProcessMultiUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessMultiUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessMultiUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessMultiUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessMultiUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessMultiUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessMultiUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessMultiUpdate) TypeID() PostureCheckType { - return "PROCESS_MULTI" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessMultiUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessMultiUpdate) UnmarshalJSON(raw []byte) error { - var data struct { - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessMultiUpdate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Processes = data.Processes - result.Semantic = data.Semantic - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessMultiUpdate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // processes - // Required: true - // Min Items: 1 - Processes []*ProcessMulti `json:"processes"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - }{ - - Processes: m.Processes, - - Semantic: m.Semantic, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process multi update -func (m *PostureCheckProcessMultiUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcesses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) validateProcesses(formats strfmt.Registry) error { - - if err := validate.Required("processes", "body", m.Processes); err != nil { - return err - } - - iProcessesSize := int64(len(m.Processes)) - - if err := validate.MinItems("processes", "body", iProcessesSize, 1); err != nil { - return err - } - - for i := 0; i < len(m.Processes); i++ { - if swag.IsZero(m.Processes[i]) { // not required - continue - } - - if m.Processes[i] != nil { - if err := m.Processes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process multi update based on the context it is used -func (m *PostureCheckProcessMultiUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcesses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessMultiUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) contextValidateProcesses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Processes); i++ { - - if m.Processes[i] != nil { - if err := m.Processes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckProcessMultiUpdate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessMultiUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessMultiUpdate) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessMultiUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_patch.go b/rest_model/posture_check_process_patch.go deleted file mode 100644 index 836f92f28..000000000 --- a/rest_model/posture_check_process_patch.go +++ /dev/null @@ -1,371 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureCheckProcessPatch posture check process patch -// -// swagger:model postureCheckProcessPatch -type PostureCheckProcessPatch struct { - nameField string - - roleAttributesField *Attributes - - tagsField *Tags - - // process - Process *Process `json:"process,omitempty"` -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessPatch) Name() string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessPatch) SetName(val string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessPatch) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessPatch) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessPatch) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessPatch) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessPatch) TypeID() PostureCheckType { - return "PROCESS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessPatch) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessPatch) UnmarshalJSON(raw []byte) error { - var data struct { - - // process - Process *Process `json:"process,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessPatch - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Process = data.Process - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessPatch) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // process - Process *Process `json:"process,omitempty"` - }{ - - Process: m.Process, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name string `json:"name,omitempty"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process patch -func (m *PostureCheckProcessPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcess(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessPatch) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessPatch) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessPatch) validateProcess(formats strfmt.Registry) error { - - if swag.IsZero(m.Process) { // not required - return nil - } - - if m.Process != nil { - if err := m.Process.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process patch based on the context it is used -func (m *PostureCheckProcessPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcess(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessPatch) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessPatch) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessPatch) contextValidateProcess(ctx context.Context, formats strfmt.Registry) error { - - if m.Process != nil { - if err := m.Process.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessPatch) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_process_update.go b/rest_model/posture_check_process_update.go deleted file mode 100644 index 4fa113d04..000000000 --- a/rest_model/posture_check_process_update.go +++ /dev/null @@ -1,388 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckProcessUpdate posture check process update -// -// swagger:model postureCheckProcessUpdate -type PostureCheckProcessUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - // process - // Required: true - Process *Process `json:"process"` -} - -// Name gets the name of this subtype -func (m *PostureCheckProcessUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this subtype -func (m *PostureCheckProcessUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this subtype -func (m *PostureCheckProcessUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this subtype -func (m *PostureCheckProcessUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this subtype -func (m *PostureCheckProcessUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this subtype -func (m *PostureCheckProcessUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureCheckProcessUpdate) TypeID() PostureCheckType { - return "PROCESS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureCheckProcessUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureCheckProcessUpdate) UnmarshalJSON(raw []byte) error { - var data struct { - - // process - // Required: true - Process *Process `json:"process"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureCheckProcessUpdate - - result.nameField = base.Name - - result.roleAttributesField = base.RoleAttributes - - result.tagsField = base.Tags - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Process = data.Process - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureCheckProcessUpdate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // process - // Required: true - Process *Process `json:"process"` - }{ - - Process: m.Process, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - Name *string `json:"name"` - - RoleAttributes *Attributes `json:"roleAttributes,omitempty"` - - Tags *Tags `json:"tags,omitempty"` - - TypeID PostureCheckType `json:"typeId,omitempty"` - }{ - - Name: m.Name(), - - RoleAttributes: m.RoleAttributes(), - - Tags: m.Tags(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture check process update -func (m *PostureCheckProcessUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcess(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckProcessUpdate) validateRoleAttributes(formats strfmt.Registry) error { - - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessUpdate) validateTags(formats strfmt.Registry) error { - - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessUpdate) validateProcess(formats strfmt.Registry) error { - - if err := validate.Required("process", "body", m.Process); err != nil { - return err - } - - if m.Process != nil { - if err := m.Process.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check process update based on the context it is used -func (m *PostureCheckProcessUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcess(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckProcessUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *PostureCheckProcessUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -func (m *PostureCheckProcessUpdate) contextValidateProcess(ctx context.Context, formats strfmt.Registry) error { - - if m.Process != nil { - if err := m.Process.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckProcessUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckProcessUpdate) UnmarshalBinary(b []byte) error { - var res PostureCheckProcessUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_type.go b/rest_model/posture_check_type.go deleted file mode 100644 index f219a3ead..000000000 --- a/rest_model/posture_check_type.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PostureCheckType posture check type -// -// swagger:model postureCheckType -type PostureCheckType string - -func NewPostureCheckType(value PostureCheckType) *PostureCheckType { - v := value - return &v -} - -const ( - - // PostureCheckTypeOS captures enum value "OS" - PostureCheckTypeOS PostureCheckType = "OS" - - // PostureCheckTypePROCESS captures enum value "PROCESS" - PostureCheckTypePROCESS PostureCheckType = "PROCESS" - - // PostureCheckTypeDOMAIN captures enum value "DOMAIN" - PostureCheckTypeDOMAIN PostureCheckType = "DOMAIN" - - // PostureCheckTypeMAC captures enum value "MAC" - PostureCheckTypeMAC PostureCheckType = "MAC" - - // PostureCheckTypeMFA captures enum value "MFA" - PostureCheckTypeMFA PostureCheckType = "MFA" - - // PostureCheckTypePROCESSMULTI captures enum value "PROCESS_MULTI" - PostureCheckTypePROCESSMULTI PostureCheckType = "PROCESS_MULTI" -) - -// for schema -var postureCheckTypeEnum []interface{} - -func init() { - var res []PostureCheckType - if err := json.Unmarshal([]byte(`["OS","PROCESS","DOMAIN","MAC","MFA","PROCESS_MULTI"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - postureCheckTypeEnum = append(postureCheckTypeEnum, v) - } -} - -func (m PostureCheckType) validatePostureCheckTypeEnum(path, location string, value PostureCheckType) error { - if err := validate.EnumCase(path, location, value, postureCheckTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this posture check type -func (m PostureCheckType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePostureCheckTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this posture check type based on context it is used -func (m PostureCheckType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/posture_check_type_detail.go b/rest_model/posture_check_type_detail.go deleted file mode 100644 index e866f9d17..000000000 --- a/rest_model/posture_check_type_detail.go +++ /dev/null @@ -1,249 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckTypeDetail posture check type detail -// -// swagger:model postureCheckTypeDetail -type PostureCheckTypeDetail struct { - BaseEntity - - // name - // Required: true - Name *string `json:"name"` - - // operating systems - // Required: true - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - - // version - // Required: true - Version *string `json:"version"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PostureCheckTypeDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Name *string `json:"name"` - - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - - Version *string `json:"version"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Name = dataAO1.Name - - m.OperatingSystems = dataAO1.OperatingSystems - - m.Version = dataAO1.Version - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PostureCheckTypeDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Name *string `json:"name"` - - OperatingSystems []*OperatingSystem `json:"operatingSystems"` - - Version *string `json:"version"` - } - - dataAO1.Name = m.Name - - dataAO1.OperatingSystems = m.OperatingSystems - - dataAO1.Version = m.Version - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this posture check type detail -func (m *PostureCheckTypeDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOperatingSystems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckTypeDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *PostureCheckTypeDetail) validateOperatingSystems(formats strfmt.Registry) error { - - if err := validate.Required("operatingSystems", "body", m.OperatingSystems); err != nil { - return err - } - - for i := 0; i < len(m.OperatingSystems); i++ { - if swag.IsZero(m.OperatingSystems[i]) { // not required - continue - } - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureCheckTypeDetail) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture check type detail based on the context it is used -func (m *PostureCheckTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOperatingSystems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureCheckTypeDetail) contextValidateOperatingSystems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.OperatingSystems); i++ { - - if m.OperatingSystems[i] != nil { - if err := m.OperatingSystems[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("operatingSystems" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureCheckTypeDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureCheckTypeDetail) UnmarshalBinary(b []byte) error { - var res PostureCheckTypeDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_check_type_list.go b/rest_model/posture_check_type_list.go deleted file mode 100644 index 9a2aa2427..000000000 --- a/rest_model/posture_check_type_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureCheckTypeList posture check type list -// -// swagger:model postureCheckTypeList -type PostureCheckTypeList []*PostureCheckTypeDetail - -// Validate validates this posture check type list -func (m PostureCheckTypeList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this posture check type list based on the context it is used -func (m PostureCheckTypeList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/posture_check_update.go b/rest_model/posture_check_update.go deleted file mode 100644 index c5d9f8fef..000000000 --- a/rest_model/posture_check_update.go +++ /dev/null @@ -1,350 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "io/ioutil" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureCheckUpdate posture check update -// -// swagger:discriminator postureCheckUpdate typeId -type PostureCheckUpdate interface { - runtime.Validatable - runtime.ContextValidatable - - // name - // Required: true - Name() *string - SetName(*string) - - // role attributes - RoleAttributes() *Attributes - SetRoleAttributes(*Attributes) - - // tags - Tags() *Tags - SetTags(*Tags) - - // type Id - TypeID() PostureCheckType - SetTypeID(PostureCheckType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type postureCheckUpdate struct { - nameField *string - - roleAttributesField *Attributes - - tagsField *Tags - - typeIdField PostureCheckType -} - -// Name gets the name of this polymorphic type -func (m *postureCheckUpdate) Name() *string { - return m.nameField -} - -// SetName sets the name of this polymorphic type -func (m *postureCheckUpdate) SetName(val *string) { - m.nameField = val -} - -// RoleAttributes gets the role attributes of this polymorphic type -func (m *postureCheckUpdate) RoleAttributes() *Attributes { - return m.roleAttributesField -} - -// SetRoleAttributes sets the role attributes of this polymorphic type -func (m *postureCheckUpdate) SetRoleAttributes(val *Attributes) { - m.roleAttributesField = val -} - -// Tags gets the tags of this polymorphic type -func (m *postureCheckUpdate) Tags() *Tags { - return m.tagsField -} - -// SetTags sets the tags of this polymorphic type -func (m *postureCheckUpdate) SetTags(val *Tags) { - m.tagsField = val -} - -// TypeID gets the type Id of this polymorphic type -func (m *postureCheckUpdate) TypeID() PostureCheckType { - return "postureCheckUpdate" -} - -// SetTypeID sets the type Id of this polymorphic type -func (m *postureCheckUpdate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalPostureCheckUpdateSlice unmarshals polymorphic slices of PostureCheckUpdate -func UnmarshalPostureCheckUpdateSlice(reader io.Reader, consumer runtime.Consumer) ([]PostureCheckUpdate, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []PostureCheckUpdate - for _, element := range elements { - obj, err := unmarshalPostureCheckUpdate(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalPostureCheckUpdate unmarshals polymorphic PostureCheckUpdate -func UnmarshalPostureCheckUpdate(reader io.Reader, consumer runtime.Consumer) (PostureCheckUpdate, error) { - // we need to read this twice, so first into a buffer - data, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalPostureCheckUpdate(data, consumer) -} - -func unmarshalPostureCheckUpdate(data []byte, consumer runtime.Consumer) (PostureCheckUpdate, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the typeId property. - var getType struct { - TypeID string `json:"typeId"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("typeId", "body", getType.TypeID); err != nil { - return nil, err - } - - // The value of typeId is used to determine which type to create and unmarshal the data into - switch getType.TypeID { - case "DOMAIN": - var result PostureCheckDomainUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MAC": - var result PostureCheckMacAddressUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MFA": - var result PostureCheckMfaUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "OS": - var result PostureCheckOperatingSystemUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS": - var result PostureCheckProcessUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS_MULTI": - var result PostureCheckProcessMultiUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "postureCheckUpdate": - var result postureCheckUpdate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid typeId value: %q", getType.TypeID) -} - -// Validate validates this posture check update -func (m *postureCheckUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name()); err != nil { - return err - } - - return nil -} - -func (m *postureCheckUpdate) validateRoleAttributes(formats strfmt.Registry) error { - if swag.IsZero(m.RoleAttributes()) { // not required - return nil - } - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags()) { // not required - return nil - } - - if m.Tags() != nil { - if err := m.Tags().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture check update based on the context it is used -func (m *postureCheckUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTypeID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureCheckUpdate) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes() != nil { - if err := m.RoleAttributes().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *postureCheckUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags() != nil { - if err := m.Tags().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *postureCheckUpdate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} diff --git a/rest_model/posture_checks_failure_mfa_criteria.go b/rest_model/posture_checks_failure_mfa_criteria.go deleted file mode 100644 index 3a988e932..000000000 --- a/rest_model/posture_checks_failure_mfa_criteria.go +++ /dev/null @@ -1,178 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureChecksFailureMfaCriteria posture checks failure mfa criteria -// -// swagger:model postureChecksFailureMfaCriteria -type PostureChecksFailureMfaCriteria struct { - - // passed mfa at - // Required: true - // Format: date-time - PassedMfaAt *strfmt.DateTime `json:"passedMfaAt"` - - // timeout remaining seconds - // Required: true - TimeoutRemainingSeconds *int64 `json:"timeoutRemainingSeconds"` - - // timeout seconds - // Required: true - TimeoutSeconds *int64 `json:"timeoutSeconds"` - - // unlocked at - // Required: true - // Format: date-time - UnlockedAt *strfmt.DateTime `json:"unlockedAt"` - - // woken at - // Required: true - // Format: date-time - WokenAt *strfmt.DateTime `json:"wokenAt"` -} - -// Validate validates this posture checks failure mfa criteria -func (m *PostureChecksFailureMfaCriteria) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePassedMfaAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeoutRemainingSeconds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeoutSeconds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUnlockedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWokenAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureChecksFailureMfaCriteria) validatePassedMfaAt(formats strfmt.Registry) error { - - if err := validate.Required("passedMfaAt", "body", m.PassedMfaAt); err != nil { - return err - } - - if err := validate.FormatOf("passedMfaAt", "body", "date-time", m.PassedMfaAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureChecksFailureMfaCriteria) validateTimeoutRemainingSeconds(formats strfmt.Registry) error { - - if err := validate.Required("timeoutRemainingSeconds", "body", m.TimeoutRemainingSeconds); err != nil { - return err - } - - return nil -} - -func (m *PostureChecksFailureMfaCriteria) validateTimeoutSeconds(formats strfmt.Registry) error { - - if err := validate.Required("timeoutSeconds", "body", m.TimeoutSeconds); err != nil { - return err - } - - return nil -} - -func (m *PostureChecksFailureMfaCriteria) validateUnlockedAt(formats strfmt.Registry) error { - - if err := validate.Required("unlockedAt", "body", m.UnlockedAt); err != nil { - return err - } - - if err := validate.FormatOf("unlockedAt", "body", "date-time", m.UnlockedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureChecksFailureMfaCriteria) validateWokenAt(formats strfmt.Registry) error { - - if err := validate.Required("wokenAt", "body", m.WokenAt); err != nil { - return err - } - - if err := validate.FormatOf("wokenAt", "body", "date-time", m.WokenAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture checks failure mfa criteria based on context it is used -func (m *PostureChecksFailureMfaCriteria) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureChecksFailureMfaCriteria) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureChecksFailureMfaCriteria) UnmarshalBinary(b []byte) error { - var res PostureChecksFailureMfaCriteria - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_checks_failure_mfa_values.go b/rest_model/posture_checks_failure_mfa_values.go deleted file mode 100644 index 24248a9ee..000000000 --- a/rest_model/posture_checks_failure_mfa_values.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureChecksFailureMfaValues posture checks failure mfa values -// -// swagger:model postureChecksFailureMfaValues -type PostureChecksFailureMfaValues struct { - - // passed mfa - PassedMfa bool `json:"passedMfa"` - - // passed on unlock - PassedOnUnlock bool `json:"passedOnUnlock"` - - // passed on wake - PassedOnWake bool `json:"passedOnWake"` - - // timed out - TimedOut bool `json:"timedOut"` -} - -// Validate validates this posture checks failure mfa values -func (m *PostureChecksFailureMfaValues) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this posture checks failure mfa values based on context it is used -func (m *PostureChecksFailureMfaValues) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureChecksFailureMfaValues) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureChecksFailureMfaValues) UnmarshalBinary(b []byte) error { - var res PostureChecksFailureMfaValues - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data.go b/rest_model/posture_data.go deleted file mode 100644 index 15a2d2998..000000000 --- a/rest_model/posture_data.go +++ /dev/null @@ -1,340 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureData posture data -// -// swagger:model postureData -type PostureData struct { - - // api session posture data - // Required: true - APISessionPostureData map[string]APISessionPostureData `json:"apiSessionPostureData"` - - // domain - // Required: true - Domain *PostureDataDomain `json:"domain"` - - // mac - // Required: true - Mac *PostureDataMac `json:"mac"` - - // os - // Required: true - Os *PostureDataOs `json:"os"` - - // processes - // Required: true - Processes []*PostureDataProcess `json:"processes"` -} - -// Validate validates this posture data -func (m *PostureData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAPISessionPostureData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomain(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcesses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureData) validateAPISessionPostureData(formats strfmt.Registry) error { - - if err := validate.Required("apiSessionPostureData", "body", m.APISessionPostureData); err != nil { - return err - } - - for k := range m.APISessionPostureData { - - if err := validate.Required("apiSessionPostureData"+"."+k, "body", m.APISessionPostureData[k]); err != nil { - return err - } - if val, ok := m.APISessionPostureData[k]; ok { - if err := val.Validate(formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *PostureData) validateDomain(formats strfmt.Registry) error { - - if err := validate.Required("domain", "body", m.Domain); err != nil { - return err - } - - if m.Domain != nil { - if err := m.Domain.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("domain") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("domain") - } - return err - } - } - - return nil -} - -func (m *PostureData) validateMac(formats strfmt.Registry) error { - - if err := validate.Required("mac", "body", m.Mac); err != nil { - return err - } - - if m.Mac != nil { - if err := m.Mac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mac") - } - return err - } - } - - return nil -} - -func (m *PostureData) validateOs(formats strfmt.Registry) error { - - if err := validate.Required("os", "body", m.Os); err != nil { - return err - } - - if m.Os != nil { - if err := m.Os.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("os") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("os") - } - return err - } - } - - return nil -} - -func (m *PostureData) validateProcesses(formats strfmt.Registry) error { - - if err := validate.Required("processes", "body", m.Processes); err != nil { - return err - } - - for i := 0; i < len(m.Processes); i++ { - if swag.IsZero(m.Processes[i]) { // not required - continue - } - - if m.Processes[i] != nil { - if err := m.Processes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture data based on the context it is used -func (m *PostureData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAPISessionPostureData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDomain(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMac(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcesses(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureData) contextValidateAPISessionPostureData(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.Required("apiSessionPostureData", "body", m.APISessionPostureData); err != nil { - return err - } - - for k := range m.APISessionPostureData { - - if val, ok := m.APISessionPostureData[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - return nil -} - -func (m *PostureData) contextValidateDomain(ctx context.Context, formats strfmt.Registry) error { - - if m.Domain != nil { - if err := m.Domain.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("domain") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("domain") - } - return err - } - } - - return nil -} - -func (m *PostureData) contextValidateMac(ctx context.Context, formats strfmt.Registry) error { - - if m.Mac != nil { - if err := m.Mac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mac") - } - return err - } - } - - return nil -} - -func (m *PostureData) contextValidateOs(ctx context.Context, formats strfmt.Registry) error { - - if m.Os != nil { - if err := m.Os.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("os") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("os") - } - return err - } - } - - return nil -} - -func (m *PostureData) contextValidateProcesses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Processes); i++ { - - if m.Processes[i] != nil { - if err := m.Processes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureData) UnmarshalBinary(b []byte) error { - var res PostureData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_base.go b/rest_model/posture_data_base.go deleted file mode 100644 index 8b1fe4719..000000000 --- a/rest_model/posture_data_base.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataBase posture data base -// -// swagger:model postureDataBase -type PostureDataBase struct { - - // last updated at - // Required: true - // Format: date-time - LastUpdatedAt *strfmt.DateTime `json:"lastUpdatedAt"` - - // posture check Id - // Required: true - PostureCheckID *string `json:"postureCheckId"` - - // timed out - // Required: true - TimedOut *bool `json:"timedOut"` -} - -// Validate validates this posture data base -func (m *PostureDataBase) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLastUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimedOut(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataBase) validateLastUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("lastUpdatedAt", "body", m.LastUpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("lastUpdatedAt", "body", "date-time", m.LastUpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureDataBase) validatePostureCheckID(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckId", "body", m.PostureCheckID); err != nil { - return err - } - - return nil -} - -func (m *PostureDataBase) validateTimedOut(formats strfmt.Registry) error { - - if err := validate.Required("timedOut", "body", m.TimedOut); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture data base based on context it is used -func (m *PostureDataBase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataBase) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataBase) UnmarshalBinary(b []byte) error { - var res PostureDataBase - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_domain.go b/rest_model/posture_data_domain.go deleted file mode 100644 index 8a0020051..000000000 --- a/rest_model/posture_data_domain.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataDomain posture data domain -// -// swagger:model postureDataDomain -type PostureDataDomain struct { - PostureDataBase - - // domain - // Required: true - Domain *string `json:"domain"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PostureDataDomain) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 PostureDataBase - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.PostureDataBase = aO0 - - // AO1 - var dataAO1 struct { - Domain *string `json:"domain"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Domain = dataAO1.Domain - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PostureDataDomain) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.PostureDataBase) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Domain *string `json:"domain"` - } - - dataAO1.Domain = m.Domain - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this posture data domain -func (m *PostureDataDomain) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomain(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataDomain) validateDomain(formats strfmt.Registry) error { - - if err := validate.Required("domain", "body", m.Domain); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture data domain based on the context it is used -func (m *PostureDataDomain) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataDomain) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataDomain) UnmarshalBinary(b []byte) error { - var res PostureDataDomain - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_endpoint_state.go b/rest_model/posture_data_endpoint_state.go deleted file mode 100644 index 1eb3f2987..000000000 --- a/rest_model/posture_data_endpoint_state.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataEndpointState posture data endpoint state -// -// swagger:model postureDataEndpointState -type PostureDataEndpointState struct { - - // unlocked at - // Required: true - // Format: date-time - UnlockedAt *strfmt.DateTime `json:"unlockedAt"` - - // woken at - // Required: true - // Format: date-time - WokenAt *strfmt.DateTime `json:"wokenAt"` -} - -// Validate validates this posture data endpoint state -func (m *PostureDataEndpointState) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUnlockedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWokenAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataEndpointState) validateUnlockedAt(formats strfmt.Registry) error { - - if err := validate.Required("unlockedAt", "body", m.UnlockedAt); err != nil { - return err - } - - if err := validate.FormatOf("unlockedAt", "body", "date-time", m.UnlockedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureDataEndpointState) validateWokenAt(formats strfmt.Registry) error { - - if err := validate.Required("wokenAt", "body", m.WokenAt); err != nil { - return err - } - - if err := validate.FormatOf("wokenAt", "body", "date-time", m.WokenAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture data endpoint state based on context it is used -func (m *PostureDataEndpointState) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataEndpointState) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataEndpointState) UnmarshalBinary(b []byte) error { - var res PostureDataEndpointState - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_envelope.go b/rest_model/posture_data_envelope.go deleted file mode 100644 index 1e319c565..000000000 --- a/rest_model/posture_data_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataEnvelope posture data envelope -// -// swagger:model postureDataEnvelope -type PostureDataEnvelope struct { - - // data - // Required: true - Data *PostureData `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this posture data envelope -func (m *PostureDataEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *PostureDataEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture data envelope based on the context it is used -func (m *PostureDataEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *PostureDataEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataEnvelope) UnmarshalBinary(b []byte) error { - var res PostureDataEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_mac.go b/rest_model/posture_data_mac.go deleted file mode 100644 index f506872ce..000000000 --- a/rest_model/posture_data_mac.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataMac posture data mac -// -// swagger:model postureDataMac -type PostureDataMac struct { - PostureDataBase - - // addresses - // Required: true - Addresses []string `json:"addresses"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PostureDataMac) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 PostureDataBase - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.PostureDataBase = aO0 - - // AO1 - var dataAO1 struct { - Addresses []string `json:"addresses"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Addresses = dataAO1.Addresses - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PostureDataMac) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.PostureDataBase) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Addresses []string `json:"addresses"` - } - - dataAO1.Addresses = m.Addresses - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this posture data mac -func (m *PostureDataMac) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAddresses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataMac) validateAddresses(formats strfmt.Registry) error { - - if err := validate.Required("addresses", "body", m.Addresses); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture data mac based on the context it is used -func (m *PostureDataMac) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataMac) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataMac) UnmarshalBinary(b []byte) error { - var res PostureDataMac - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_mfa.go b/rest_model/posture_data_mfa.go deleted file mode 100644 index ac3a6f35c..000000000 --- a/rest_model/posture_data_mfa.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataMfa posture data mfa -// -// swagger:model postureDataMfa -type PostureDataMfa struct { - - // api session Id - // Required: true - APISessionID *string `json:"apiSessionId"` - - // passed at - // Required: true - // Format: date-time - PassedAt *strfmt.DateTime `json:"passedAt"` - - // passed mfa - // Required: true - PassedMfa *bool `json:"passedMfa"` - - // passed on unlock - // Required: true - PassedOnUnlock *bool `json:"passedOnUnlock"` - - // passed on wake - // Required: true - PassedOnWake *bool `json:"passedOnWake"` -} - -// Validate validates this posture data mfa -func (m *PostureDataMfa) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAPISessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassedMfa(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassedOnUnlock(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePassedOnWake(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataMfa) validateAPISessionID(formats strfmt.Registry) error { - - if err := validate.Required("apiSessionId", "body", m.APISessionID); err != nil { - return err - } - - return nil -} - -func (m *PostureDataMfa) validatePassedAt(formats strfmt.Registry) error { - - if err := validate.Required("passedAt", "body", m.PassedAt); err != nil { - return err - } - - if err := validate.FormatOf("passedAt", "body", "date-time", m.PassedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PostureDataMfa) validatePassedMfa(formats strfmt.Registry) error { - - if err := validate.Required("passedMfa", "body", m.PassedMfa); err != nil { - return err - } - - return nil -} - -func (m *PostureDataMfa) validatePassedOnUnlock(formats strfmt.Registry) error { - - if err := validate.Required("passedOnUnlock", "body", m.PassedOnUnlock); err != nil { - return err - } - - return nil -} - -func (m *PostureDataMfa) validatePassedOnWake(formats strfmt.Registry) error { - - if err := validate.Required("passedOnWake", "body", m.PassedOnWake); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture data mfa based on context it is used -func (m *PostureDataMfa) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataMfa) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataMfa) UnmarshalBinary(b []byte) error { - var res PostureDataMfa - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_os.go b/rest_model/posture_data_os.go deleted file mode 100644 index 3754ed380..000000000 --- a/rest_model/posture_data_os.go +++ /dev/null @@ -1,206 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureDataOs posture data os -// -// swagger:model postureDataOs -type PostureDataOs struct { - PostureDataBase - - // build - // Required: true - Build *string `json:"build"` - - // type - // Required: true - Type *string `json:"type"` - - // version - // Required: true - Version *string `json:"version"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PostureDataOs) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 PostureDataBase - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.PostureDataBase = aO0 - - // AO1 - var dataAO1 struct { - Build *string `json:"build"` - - Type *string `json:"type"` - - Version *string `json:"version"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Build = dataAO1.Build - - m.Type = dataAO1.Type - - m.Version = dataAO1.Version - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PostureDataOs) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.PostureDataBase) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Build *string `json:"build"` - - Type *string `json:"type"` - - Version *string `json:"version"` - } - - dataAO1.Build = m.Build - - dataAO1.Type = m.Type - - dataAO1.Version = m.Version - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this posture data os -func (m *PostureDataOs) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBuild(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureDataOs) validateBuild(formats strfmt.Registry) error { - - if err := validate.Required("build", "body", m.Build); err != nil { - return err - } - - return nil -} - -func (m *PostureDataOs) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -func (m *PostureDataOs) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture data os based on the context it is used -func (m *PostureDataOs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataOs) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataOs) UnmarshalBinary(b []byte) error { - var res PostureDataOs - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_data_process.go b/rest_model/posture_data_process.go deleted file mode 100644 index 0c2995296..000000000 --- a/rest_model/posture_data_process.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureDataProcess posture data process -// -// swagger:model postureDataProcess -type PostureDataProcess struct { - PostureDataBase - - // binary hash - BinaryHash string `json:"binaryHash,omitempty"` - - // is running - IsRunning bool `json:"isRunning,omitempty"` - - // signer fingerprints - SignerFingerprints []string `json:"signerFingerprints"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PostureDataProcess) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 PostureDataBase - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.PostureDataBase = aO0 - - // AO1 - var dataAO1 struct { - BinaryHash string `json:"binaryHash,omitempty"` - - IsRunning bool `json:"isRunning,omitempty"` - - SignerFingerprints []string `json:"signerFingerprints"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.BinaryHash = dataAO1.BinaryHash - - m.IsRunning = dataAO1.IsRunning - - m.SignerFingerprints = dataAO1.SignerFingerprints - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PostureDataProcess) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.PostureDataBase) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - BinaryHash string `json:"binaryHash,omitempty"` - - IsRunning bool `json:"isRunning,omitempty"` - - SignerFingerprints []string `json:"signerFingerprints"` - } - - dataAO1.BinaryHash = m.BinaryHash - - dataAO1.IsRunning = m.IsRunning - - dataAO1.SignerFingerprints = m.SignerFingerprints - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this posture data process -func (m *PostureDataProcess) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this posture data process based on the context it is used -func (m *PostureDataProcess) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with PostureDataBase - if err := m.PostureDataBase.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PostureDataProcess) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureDataProcess) UnmarshalBinary(b []byte) error { - var res PostureDataProcess - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_queries.go b/rest_model/posture_queries.go deleted file mode 100644 index 8f7493c13..000000000 --- a/rest_model/posture_queries.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureQueries posture queries -// -// swagger:model postureQueries -type PostureQueries struct { - - // is passing - // Required: true - IsPassing *bool `json:"isPassing"` - - // policy Id - // Required: true - PolicyID *string `json:"policyId"` - - // policy type - PolicyType DialBind `json:"policyType,omitempty"` - - // posture queries - // Required: true - PostureQueries []*PostureQuery `json:"postureQueries"` -} - -// Validate validates this posture queries -func (m *PostureQueries) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsPassing(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicyID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePolicyType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureQueries(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureQueries) validateIsPassing(formats strfmt.Registry) error { - - if err := validate.Required("isPassing", "body", m.IsPassing); err != nil { - return err - } - - return nil -} - -func (m *PostureQueries) validatePolicyID(formats strfmt.Registry) error { - - if err := validate.Required("policyId", "body", m.PolicyID); err != nil { - return err - } - - return nil -} - -func (m *PostureQueries) validatePolicyType(formats strfmt.Registry) error { - if swag.IsZero(m.PolicyType) { // not required - return nil - } - - if err := m.PolicyType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("policyType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("policyType") - } - return err - } - - return nil -} - -func (m *PostureQueries) validatePostureQueries(formats strfmt.Registry) error { - - if err := validate.Required("postureQueries", "body", m.PostureQueries); err != nil { - return err - } - - for i := 0; i < len(m.PostureQueries); i++ { - if swag.IsZero(m.PostureQueries[i]) { // not required - continue - } - - if m.PostureQueries[i] != nil { - if err := m.PostureQueries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture queries based on the context it is used -func (m *PostureQueries) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePolicyType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureQueries(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureQueries) contextValidatePolicyType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PolicyType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("policyType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("policyType") - } - return err - } - - return nil -} - -func (m *PostureQueries) contextValidatePostureQueries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PostureQueries); i++ { - - if m.PostureQueries[i] != nil { - if err := m.PostureQueries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureQueries) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureQueries) UnmarshalBinary(b []byte) error { - var res PostureQueries - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_query.go b/rest_model/posture_query.go deleted file mode 100644 index a20d1075e..000000000 --- a/rest_model/posture_query.go +++ /dev/null @@ -1,388 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureQuery posture query -// -// swagger:model postureQuery -type PostureQuery struct { - BaseEntity - - // is passing - // Required: true - IsPassing *bool `json:"isPassing"` - - // process - Process *PostureQueryProcess `json:"process,omitempty"` - - // processes - Processes []*PostureQueryProcess `json:"processes"` - - // query type - // Required: true - QueryType *PostureCheckType `json:"queryType"` - - // timeout - // Required: true - Timeout *int64 `json:"timeout"` - - // timeout remaining - // Required: true - TimeoutRemaining *int64 `json:"timeoutRemaining"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *PostureQuery) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - IsPassing *bool `json:"isPassing"` - - Process *PostureQueryProcess `json:"process,omitempty"` - - Processes []*PostureQueryProcess `json:"processes"` - - QueryType *PostureCheckType `json:"queryType"` - - Timeout *int64 `json:"timeout"` - - TimeoutRemaining *int64 `json:"timeoutRemaining"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.IsPassing = dataAO1.IsPassing - - m.Process = dataAO1.Process - - m.Processes = dataAO1.Processes - - m.QueryType = dataAO1.QueryType - - m.Timeout = dataAO1.Timeout - - m.TimeoutRemaining = dataAO1.TimeoutRemaining - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m PostureQuery) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - IsPassing *bool `json:"isPassing"` - - Process *PostureQueryProcess `json:"process,omitempty"` - - Processes []*PostureQueryProcess `json:"processes"` - - QueryType *PostureCheckType `json:"queryType"` - - Timeout *int64 `json:"timeout"` - - TimeoutRemaining *int64 `json:"timeoutRemaining"` - } - - dataAO1.IsPassing = m.IsPassing - - dataAO1.Process = m.Process - - dataAO1.Processes = m.Processes - - dataAO1.QueryType = m.QueryType - - dataAO1.Timeout = m.Timeout - - dataAO1.TimeoutRemaining = m.TimeoutRemaining - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this posture query -func (m *PostureQuery) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsPassing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcess(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProcesses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateQueryType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeout(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeoutRemaining(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureQuery) validateIsPassing(formats strfmt.Registry) error { - - if err := validate.Required("isPassing", "body", m.IsPassing); err != nil { - return err - } - - return nil -} - -func (m *PostureQuery) validateProcess(formats strfmt.Registry) error { - - if swag.IsZero(m.Process) { // not required - return nil - } - - if m.Process != nil { - if err := m.Process.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -func (m *PostureQuery) validateProcesses(formats strfmt.Registry) error { - - if swag.IsZero(m.Processes) { // not required - return nil - } - - for i := 0; i < len(m.Processes); i++ { - if swag.IsZero(m.Processes[i]) { // not required - continue - } - - if m.Processes[i] != nil { - if err := m.Processes[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureQuery) validateQueryType(formats strfmt.Registry) error { - - if err := validate.Required("queryType", "body", m.QueryType); err != nil { - return err - } - - if err := validate.Required("queryType", "body", m.QueryType); err != nil { - return err - } - - if m.QueryType != nil { - if err := m.QueryType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queryType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queryType") - } - return err - } - } - - return nil -} - -func (m *PostureQuery) validateTimeout(formats strfmt.Registry) error { - - if err := validate.Required("timeout", "body", m.Timeout); err != nil { - return err - } - - return nil -} - -func (m *PostureQuery) validateTimeoutRemaining(formats strfmt.Registry) error { - - if err := validate.Required("timeoutRemaining", "body", m.TimeoutRemaining); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture query based on the context it is used -func (m *PostureQuery) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcess(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProcesses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateQueryType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureQuery) contextValidateProcess(ctx context.Context, formats strfmt.Registry) error { - - if m.Process != nil { - if err := m.Process.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("process") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("process") - } - return err - } - } - - return nil -} - -func (m *PostureQuery) contextValidateProcesses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Processes); i++ { - - if m.Processes[i] != nil { - if err := m.Processes[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("processes" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("processes" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PostureQuery) contextValidateQueryType(ctx context.Context, formats strfmt.Registry) error { - - if m.QueryType != nil { - if err := m.QueryType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queryType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queryType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureQuery) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureQuery) UnmarshalBinary(b []byte) error { - var res PostureQuery - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_query_process.go b/rest_model/posture_query_process.go deleted file mode 100644 index ee6163a81..000000000 --- a/rest_model/posture_query_process.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PostureQueryProcess posture query process -// -// swagger:model postureQueryProcess -type PostureQueryProcess struct { - - // os type - OsType OsType `json:"osType,omitempty"` - - // path - Path string `json:"path,omitempty"` -} - -// Validate validates this posture query process -func (m *PostureQueryProcess) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureQueryProcess) validateOsType(formats strfmt.Registry) error { - if swag.IsZero(m.OsType) { // not required - return nil - } - - if err := m.OsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - - return nil -} - -// ContextValidate validate this posture query process based on the context it is used -func (m *PostureQueryProcess) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOsType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureQueryProcess) contextValidateOsType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.OsType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureQueryProcess) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureQueryProcess) UnmarshalBinary(b []byte) error { - var res PostureQueryProcess - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response.go b/rest_model/posture_response.go deleted file mode 100644 index c3dc2ccad..000000000 --- a/rest_model/posture_response.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponse posture response -// -// swagger:model postureResponse -type PostureResponse struct { - - // services - // Required: true - Services []*PostureResponseService `json:"services"` -} - -// Validate validates this posture response -func (m *PostureResponse) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServices(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponse) validateServices(formats strfmt.Registry) error { - - if err := validate.Required("services", "body", m.Services); err != nil { - return err - } - - for i := 0; i < len(m.Services); i++ { - if swag.IsZero(m.Services[i]) { // not required - continue - } - - if m.Services[i] != nil { - if err := m.Services[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("services" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this posture response based on the context it is used -func (m *PostureResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServices(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponse) contextValidateServices(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Services); i++ { - - if m.Services[i] != nil { - if err := m.Services[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("services" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("services" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponse) UnmarshalBinary(b []byte) error { - var res PostureResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_create.go b/rest_model/posture_response_create.go deleted file mode 100644 index 8a94cf45a..000000000 --- a/rest_model/posture_response_create.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "io/ioutil" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PostureResponseCreate posture response create -// -// swagger:discriminator postureResponseCreate typeId -type PostureResponseCreate interface { - runtime.Validatable - runtime.ContextValidatable - - // id - // Required: true - ID() *string - SetID(*string) - - // type Id - // Required: true - TypeID() PostureCheckType - SetTypeID(PostureCheckType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type postureResponseCreate struct { - idField *string - - typeIdField PostureCheckType -} - -// ID gets the id of this polymorphic type -func (m *postureResponseCreate) ID() *string { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *postureResponseCreate) SetID(val *string) { - m.idField = val -} - -// TypeID gets the type Id of this polymorphic type -func (m *postureResponseCreate) TypeID() PostureCheckType { - return "postureResponseCreate" -} - -// SetTypeID sets the type Id of this polymorphic type -func (m *postureResponseCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalPostureResponseCreateSlice unmarshals polymorphic slices of PostureResponseCreate -func UnmarshalPostureResponseCreateSlice(reader io.Reader, consumer runtime.Consumer) ([]PostureResponseCreate, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []PostureResponseCreate - for _, element := range elements { - obj, err := unmarshalPostureResponseCreate(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalPostureResponseCreate unmarshals polymorphic PostureResponseCreate -func UnmarshalPostureResponseCreate(reader io.Reader, consumer runtime.Consumer) (PostureResponseCreate, error) { - // we need to read this twice, so first into a buffer - data, err := ioutil.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalPostureResponseCreate(data, consumer) -} - -func unmarshalPostureResponseCreate(data []byte, consumer runtime.Consumer) (PostureResponseCreate, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the typeId property. - var getType struct { - TypeID string `json:"typeId"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("typeId", "body", getType.TypeID); err != nil { - return nil, err - } - - // The value of typeId is used to determine which type to create and unmarshal the data into - switch getType.TypeID { - case "DOMAIN": - var result PostureResponseDomainCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "ENDPOINT_STATE": - var result PostureResponseEndpointStateCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MAC": - var result PostureResponseMacAddressCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "OS": - var result PostureResponseOperatingSystemCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "PROCESS": - var result PostureResponseProcessCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "postureResponseCreate": - var result postureResponseCreate - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid typeId value: %q", getType.TypeID) -} - -// Validate validates this posture response create -func (m *postureResponseCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureResponseCreate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture response create based on the context it is used -func (m *postureResponseCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTypeID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *postureResponseCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} diff --git a/rest_model/posture_response_domain_create.go b/rest_model/posture_response_domain_create.go deleted file mode 100644 index df82b8923..000000000 --- a/rest_model/posture_response_domain_create.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseDomainCreate posture response domain create -// -// swagger:model postureResponseDomainCreate -type PostureResponseDomainCreate struct { - idField *string - - // domain - // Required: true - Domain *string `json:"domain"` -} - -// ID gets the id of this subtype -func (m *PostureResponseDomainCreate) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureResponseDomainCreate) SetID(val *string) { - m.idField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureResponseDomainCreate) TypeID() PostureCheckType { - return "DOMAIN" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureResponseDomainCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureResponseDomainCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // domain - // Required: true - Domain *string `json:"domain"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureResponseDomainCreate - - result.idField = base.ID - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Domain = data.Domain - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureResponseDomainCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // domain - // Required: true - Domain *string `json:"domain"` - }{ - - Domain: m.Domain, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - ID: m.ID(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture response domain create -func (m *PostureResponseDomainCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDomain(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseDomainCreate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseDomainCreate) validateDomain(formats strfmt.Registry) error { - - if err := validate.Required("domain", "body", m.Domain); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture response domain create based on the context it is used -func (m *PostureResponseDomainCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseDomainCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseDomainCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseDomainCreate) UnmarshalBinary(b []byte) error { - var res PostureResponseDomainCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_endpoint_state_create.go b/rest_model/posture_response_endpoint_state_create.go deleted file mode 100644 index 4f82c9c02..000000000 --- a/rest_model/posture_response_endpoint_state_create.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseEndpointStateCreate posture response endpoint state create -// -// swagger:model postureResponseEndpointStateCreate -type PostureResponseEndpointStateCreate struct { - idField *string - - // unlocked - Unlocked bool `json:"unlocked,omitempty"` - - // woken - Woken bool `json:"woken,omitempty"` -} - -// ID gets the id of this subtype -func (m *PostureResponseEndpointStateCreate) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureResponseEndpointStateCreate) SetID(val *string) { - m.idField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureResponseEndpointStateCreate) TypeID() PostureCheckType { - return "ENDPOINT_STATE" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureResponseEndpointStateCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureResponseEndpointStateCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // unlocked - Unlocked bool `json:"unlocked,omitempty"` - - // woken - Woken bool `json:"woken,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureResponseEndpointStateCreate - - result.idField = base.ID - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Unlocked = data.Unlocked - result.Woken = data.Woken - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureResponseEndpointStateCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // unlocked - Unlocked bool `json:"unlocked,omitempty"` - - // woken - Woken bool `json:"woken,omitempty"` - }{ - - Unlocked: m.Unlocked, - - Woken: m.Woken, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - ID: m.ID(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture response endpoint state create -func (m *PostureResponseEndpointStateCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseEndpointStateCreate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture response endpoint state create based on the context it is used -func (m *PostureResponseEndpointStateCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseEndpointStateCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseEndpointStateCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseEndpointStateCreate) UnmarshalBinary(b []byte) error { - var res PostureResponseEndpointStateCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_envelope.go b/rest_model/posture_response_envelope.go deleted file mode 100644 index 9cacac47c..000000000 --- a/rest_model/posture_response_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseEnvelope posture response envelope -// -// swagger:model postureResponseEnvelope -type PostureResponseEnvelope struct { - - // data - // Required: true - Data *PostureResponse `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this posture response envelope -func (m *PostureResponseEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *PostureResponseEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this posture response envelope based on the context it is used -func (m *PostureResponseEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *PostureResponseEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseEnvelope) UnmarshalBinary(b []byte) error { - var res PostureResponseEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_mac_address_create.go b/rest_model/posture_response_mac_address_create.go deleted file mode 100644 index f27098b31..000000000 --- a/rest_model/posture_response_mac_address_create.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseMacAddressCreate posture response mac address create -// -// swagger:model postureResponseMacAddressCreate -type PostureResponseMacAddressCreate struct { - idField *string - - // mac addresses - // Required: true - MacAddresses []string `json:"macAddresses"` -} - -// ID gets the id of this subtype -func (m *PostureResponseMacAddressCreate) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureResponseMacAddressCreate) SetID(val *string) { - m.idField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureResponseMacAddressCreate) TypeID() PostureCheckType { - return "MAC" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureResponseMacAddressCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureResponseMacAddressCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // mac addresses - // Required: true - MacAddresses []string `json:"macAddresses"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureResponseMacAddressCreate - - result.idField = base.ID - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.MacAddresses = data.MacAddresses - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureResponseMacAddressCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // mac addresses - // Required: true - MacAddresses []string `json:"macAddresses"` - }{ - - MacAddresses: m.MacAddresses, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - ID: m.ID(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture response mac address create -func (m *PostureResponseMacAddressCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMacAddresses(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseMacAddressCreate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseMacAddressCreate) validateMacAddresses(formats strfmt.Registry) error { - - if err := validate.Required("macAddresses", "body", m.MacAddresses); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture response mac address create based on the context it is used -func (m *PostureResponseMacAddressCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseMacAddressCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseMacAddressCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseMacAddressCreate) UnmarshalBinary(b []byte) error { - var res PostureResponseMacAddressCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_operating_system_create.go b/rest_model/posture_response_operating_system_create.go deleted file mode 100644 index bd4dc43f2..000000000 --- a/rest_model/posture_response_operating_system_create.go +++ /dev/null @@ -1,269 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseOperatingSystemCreate posture response operating system create -// -// swagger:model postureResponseOperatingSystemCreate -type PostureResponseOperatingSystemCreate struct { - idField *string - - // build - Build string `json:"build,omitempty"` - - // type - // Required: true - Type *string `json:"type"` - - // version - // Required: true - Version *string `json:"version"` -} - -// ID gets the id of this subtype -func (m *PostureResponseOperatingSystemCreate) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureResponseOperatingSystemCreate) SetID(val *string) { - m.idField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureResponseOperatingSystemCreate) TypeID() PostureCheckType { - return "OS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureResponseOperatingSystemCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureResponseOperatingSystemCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // build - Build string `json:"build,omitempty"` - - // type - // Required: true - Type *string `json:"type"` - - // version - // Required: true - Version *string `json:"version"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureResponseOperatingSystemCreate - - result.idField = base.ID - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Build = data.Build - result.Type = data.Type - result.Version = data.Version - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureResponseOperatingSystemCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // build - Build string `json:"build,omitempty"` - - // type - // Required: true - Type *string `json:"type"` - - // version - // Required: true - Version *string `json:"version"` - }{ - - Build: m.Build, - - Type: m.Type, - - Version: m.Version, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - ID: m.ID(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture response operating system create -func (m *PostureResponseOperatingSystemCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseOperatingSystemCreate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseOperatingSystemCreate) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseOperatingSystemCreate) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture response operating system create based on the context it is used -func (m *PostureResponseOperatingSystemCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseOperatingSystemCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseOperatingSystemCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseOperatingSystemCreate) UnmarshalBinary(b []byte) error { - var res PostureResponseOperatingSystemCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_process_create.go b/rest_model/posture_response_process_create.go deleted file mode 100644 index f1c9304e9..000000000 --- a/rest_model/posture_response_process_create.go +++ /dev/null @@ -1,249 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseProcessCreate posture response process create -// -// swagger:model postureResponseProcessCreate -type PostureResponseProcessCreate struct { - idField *string - - // hash - Hash string `json:"hash,omitempty"` - - // is running - IsRunning bool `json:"isRunning,omitempty"` - - // path - Path string `json:"path,omitempty"` - - // signer fingerprints - SignerFingerprints []string `json:"signerFingerprints"` -} - -// ID gets the id of this subtype -func (m *PostureResponseProcessCreate) ID() *string { - return m.idField -} - -// SetID sets the id of this subtype -func (m *PostureResponseProcessCreate) SetID(val *string) { - m.idField = val -} - -// TypeID gets the type Id of this subtype -func (m *PostureResponseProcessCreate) TypeID() PostureCheckType { - return "PROCESS" -} - -// SetTypeID sets the type Id of this subtype -func (m *PostureResponseProcessCreate) SetTypeID(val PostureCheckType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *PostureResponseProcessCreate) UnmarshalJSON(raw []byte) error { - var data struct { - - // hash - Hash string `json:"hash,omitempty"` - - // is running - IsRunning bool `json:"isRunning,omitempty"` - - // path - Path string `json:"path,omitempty"` - - // signer fingerprints - SignerFingerprints []string `json:"signerFingerprints"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result PostureResponseProcessCreate - - result.idField = base.ID - - if base.TypeID != result.TypeID() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid typeId value: %q", base.TypeID) - } - - result.Hash = data.Hash - result.IsRunning = data.IsRunning - result.Path = data.Path - result.SignerFingerprints = data.SignerFingerprints - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m PostureResponseProcessCreate) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // hash - Hash string `json:"hash,omitempty"` - - // is running - IsRunning bool `json:"isRunning,omitempty"` - - // path - Path string `json:"path,omitempty"` - - // signer fingerprints - SignerFingerprints []string `json:"signerFingerprints"` - }{ - - Hash: m.Hash, - - IsRunning: m.IsRunning, - - Path: m.Path, - - SignerFingerprints: m.SignerFingerprints, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID *string `json:"id"` - - TypeID PostureCheckType `json:"typeId"` - }{ - - ID: m.ID(), - - TypeID: m.TypeID(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this posture response process create -func (m *PostureResponseProcessCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseProcessCreate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID()); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this posture response process create based on the context it is used -func (m *PostureResponseProcessCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseProcessCreate) contextValidateTypeID(ctx context.Context, formats strfmt.Registry) error { - - if err := m.TypeID().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("typeId") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("typeId") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseProcessCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseProcessCreate) UnmarshalBinary(b []byte) error { - var res PostureResponseProcessCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/posture_response_service.go b/rest_model/posture_response_service.go deleted file mode 100644 index f1c843364..000000000 --- a/rest_model/posture_response_service.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostureResponseService posture response service -// -// swagger:model postureResponseService -type PostureResponseService struct { - - // id - // Required: true - ID *string `json:"id"` - - // name - // Required: true - Name *string `json:"name"` - - // posture query type - // Required: true - PostureQueryType *string `json:"postureQueryType"` - - // timeout - // Required: true - Timeout *int64 `json:"timeout"` - - // timeout remaining - // Required: true - TimeoutRemaining *int64 `json:"timeoutRemaining"` -} - -// Validate validates this posture response service -func (m *PostureResponseService) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureQueryType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeout(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeoutRemaining(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostureResponseService) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseService) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseService) validatePostureQueryType(formats strfmt.Registry) error { - - if err := validate.Required("postureQueryType", "body", m.PostureQueryType); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseService) validateTimeout(formats strfmt.Registry) error { - - if err := validate.Required("timeout", "body", m.Timeout); err != nil { - return err - } - - return nil -} - -func (m *PostureResponseService) validateTimeoutRemaining(formats strfmt.Registry) error { - - if err := validate.Required("timeoutRemaining", "body", m.TimeoutRemaining); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this posture response service based on context it is used -func (m *PostureResponseService) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostureResponseService) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostureResponseService) UnmarshalBinary(b []byte) error { - var res PostureResponseService - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/process.go b/rest_model/process.go deleted file mode 100644 index 1409bde4c..000000000 --- a/rest_model/process.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Process process -// -// swagger:model process -type Process struct { - - // hashes - Hashes []string `json:"hashes"` - - // os type - // Required: true - OsType *OsType `json:"osType"` - - // path - // Required: true - Path *string `json:"path"` - - // signer fingerprint - SignerFingerprint string `json:"signerFingerprint,omitempty"` -} - -// Validate validates this process -func (m *Process) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Process) validateOsType(formats strfmt.Registry) error { - - if err := validate.Required("osType", "body", m.OsType); err != nil { - return err - } - - if err := validate.Required("osType", "body", m.OsType); err != nil { - return err - } - - if m.OsType != nil { - if err := m.OsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - } - - return nil -} - -func (m *Process) validatePath(formats strfmt.Registry) error { - - if err := validate.Required("path", "body", m.Path); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this process based on the context it is used -func (m *Process) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOsType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Process) contextValidateOsType(ctx context.Context, formats strfmt.Registry) error { - - if m.OsType != nil { - if err := m.OsType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Process) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Process) UnmarshalBinary(b []byte) error { - var res Process - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/process_multi.go b/rest_model/process_multi.go deleted file mode 100644 index c2fb75c0b..000000000 --- a/rest_model/process_multi.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProcessMulti process multi -// -// swagger:model processMulti -type ProcessMulti struct { - - // hashes - Hashes []string `json:"hashes"` - - // os type - // Required: true - OsType *OsType `json:"osType"` - - // path - // Required: true - Path *string `json:"path"` - - // signer fingerprints - SignerFingerprints []string `json:"signerFingerprints"` -} - -// Validate validates this process multi -func (m *ProcessMulti) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateOsType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePath(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProcessMulti) validateOsType(formats strfmt.Registry) error { - - if err := validate.Required("osType", "body", m.OsType); err != nil { - return err - } - - if err := validate.Required("osType", "body", m.OsType); err != nil { - return err - } - - if m.OsType != nil { - if err := m.OsType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - } - - return nil -} - -func (m *ProcessMulti) validatePath(formats strfmt.Registry) error { - - if err := validate.Required("path", "body", m.Path); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this process multi based on the context it is used -func (m *ProcessMulti) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateOsType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProcessMulti) contextValidateOsType(ctx context.Context, formats strfmt.Registry) error { - - if m.OsType != nil { - if err := m.OsType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("osType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("osType") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProcessMulti) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProcessMulti) UnmarshalBinary(b []byte) error { - var res ProcessMulti - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/protocol.go b/rest_model/protocol.go deleted file mode 100644 index 6d4a6b83a..000000000 --- a/rest_model/protocol.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Protocol protocol -// -// swagger:model protocol -type Protocol struct { - - // address - // Required: true - Address *string `json:"address"` -} - -// Validate validates this protocol -func (m *Protocol) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Protocol) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this protocol based on context it is used -func (m *Protocol) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Protocol) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Protocol) UnmarshalBinary(b []byte) error { - var res Protocol - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/re_enroll.go b/rest_model/re_enroll.go deleted file mode 100644 index baa40700c..000000000 --- a/rest_model/re_enroll.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ReEnroll re enroll -// -// swagger:model reEnroll -type ReEnroll struct { - - // expires at - // Required: true - // Format: date-time - ExpiresAt *strfmt.DateTime `json:"expiresAt"` -} - -// Validate validates this re enroll -func (m *ReEnroll) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpiresAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ReEnroll) validateExpiresAt(formats strfmt.Registry) error { - - if err := validate.Required("expiresAt", "body", m.ExpiresAt); err != nil { - return err - } - - if err := validate.FormatOf("expiresAt", "body", "date-time", m.ExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this re enroll based on context it is used -func (m *ReEnroll) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ReEnroll) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ReEnroll) UnmarshalBinary(b []byte) error { - var res ReEnroll - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/role_attributes_list.go b/rest_model/role_attributes_list.go deleted file mode 100644 index 439a08d75..000000000 --- a/rest_model/role_attributes_list.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// RoleAttributesList An array of role attributes -// -// swagger:model roleAttributesList -type RoleAttributesList []string - -// Validate validates this role attributes list -func (m RoleAttributesList) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this role attributes list based on context it is used -func (m RoleAttributesList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/roles.go b/rest_model/roles.go deleted file mode 100644 index 272310831..000000000 --- a/rest_model/roles.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// Roles roles -// -// swagger:model roles -type Roles []string - -// Validate validates this roles -func (m Roles) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this roles based on context it is used -func (m Roles) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/router_create.go b/rest_model/router_create.go deleted file mode 100644 index 5adb06f28..000000000 --- a/rest_model/router_create.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RouterCreate router create -// -// swagger:model routerCreate -type RouterCreate struct { - - // cost - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // no traversal - NoTraversal *bool `json:"noTraversal,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this router create -func (m *RouterCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterCreate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *RouterCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RouterCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this router create based on the context it is used -func (m *RouterCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RouterCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RouterCreate) UnmarshalBinary(b []byte) error { - var res RouterCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/router_detail.go b/rest_model/router_detail.go deleted file mode 100644 index e2af9f8c3..000000000 --- a/rest_model/router_detail.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RouterDetail router detail -// -// swagger:model routerDetail -type RouterDetail struct { - BaseEntity - - // cost - // Required: true - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost"` - - // enrollment created at - // Format: date-time - EnrollmentCreatedAt *strfmt.DateTime `json:"enrollmentCreatedAt,omitempty"` - - // enrollment expires at - // Format: date-time - EnrollmentExpiresAt *strfmt.DateTime `json:"enrollmentExpiresAt,omitempty"` - - // enrollment Jwt - EnrollmentJWT *string `json:"enrollmentJwt,omitempty"` - - // enrollment token - EnrollmentToken *string `json:"enrollmentToken,omitempty"` - - // fingerprint - // Required: true - Fingerprint *string `json:"fingerprint"` - - // is online - // Required: true - IsOnline *bool `json:"isOnline"` - - // is verified - // Required: true - IsVerified *bool `json:"isVerified"` - - // name - // Required: true - Name *string `json:"name"` - - // no traversal - // Required: true - NoTraversal *bool `json:"noTraversal"` - - // unverified cert pem - UnverifiedCertPem *string `json:"unverifiedCertPem"` - - // unverified fingerprint - UnverifiedFingerprint *string `json:"unverifiedFingerprint"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *RouterDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Cost *int64 `json:"cost"` - - EnrollmentCreatedAt *strfmt.DateTime `json:"enrollmentCreatedAt,omitempty"` - - EnrollmentExpiresAt *strfmt.DateTime `json:"enrollmentExpiresAt,omitempty"` - - EnrollmentJWT *string `json:"enrollmentJwt,omitempty"` - - EnrollmentToken *string `json:"enrollmentToken,omitempty"` - - Fingerprint *string `json:"fingerprint"` - - IsOnline *bool `json:"isOnline"` - - IsVerified *bool `json:"isVerified"` - - Name *string `json:"name"` - - NoTraversal *bool `json:"noTraversal"` - - UnverifiedCertPem *string `json:"unverifiedCertPem"` - - UnverifiedFingerprint *string `json:"unverifiedFingerprint"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Cost = dataAO1.Cost - - m.EnrollmentCreatedAt = dataAO1.EnrollmentCreatedAt - - m.EnrollmentExpiresAt = dataAO1.EnrollmentExpiresAt - - m.EnrollmentJWT = dataAO1.EnrollmentJWT - - m.EnrollmentToken = dataAO1.EnrollmentToken - - m.Fingerprint = dataAO1.Fingerprint - - m.IsOnline = dataAO1.IsOnline - - m.IsVerified = dataAO1.IsVerified - - m.Name = dataAO1.Name - - m.NoTraversal = dataAO1.NoTraversal - - m.UnverifiedCertPem = dataAO1.UnverifiedCertPem - - m.UnverifiedFingerprint = dataAO1.UnverifiedFingerprint - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m RouterDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Cost *int64 `json:"cost"` - - EnrollmentCreatedAt *strfmt.DateTime `json:"enrollmentCreatedAt,omitempty"` - - EnrollmentExpiresAt *strfmt.DateTime `json:"enrollmentExpiresAt,omitempty"` - - EnrollmentJWT *string `json:"enrollmentJwt,omitempty"` - - EnrollmentToken *string `json:"enrollmentToken,omitempty"` - - Fingerprint *string `json:"fingerprint"` - - IsOnline *bool `json:"isOnline"` - - IsVerified *bool `json:"isVerified"` - - Name *string `json:"name"` - - NoTraversal *bool `json:"noTraversal"` - - UnverifiedCertPem *string `json:"unverifiedCertPem"` - - UnverifiedFingerprint *string `json:"unverifiedFingerprint"` - } - - dataAO1.Cost = m.Cost - - dataAO1.EnrollmentCreatedAt = m.EnrollmentCreatedAt - - dataAO1.EnrollmentExpiresAt = m.EnrollmentExpiresAt - - dataAO1.EnrollmentJWT = m.EnrollmentJWT - - dataAO1.EnrollmentToken = m.EnrollmentToken - - dataAO1.Fingerprint = m.Fingerprint - - dataAO1.IsOnline = m.IsOnline - - dataAO1.IsVerified = m.IsVerified - - dataAO1.Name = m.Name - - dataAO1.NoTraversal = m.NoTraversal - - dataAO1.UnverifiedCertPem = m.UnverifiedCertPem - - dataAO1.UnverifiedFingerprint = m.UnverifiedFingerprint - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this router detail -func (m *RouterDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrollmentCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEnrollmentExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFingerprint(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsOnline(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsVerified(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNoTraversal(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterDetail) validateCost(formats strfmt.Registry) error { - - if err := validate.Required("cost", "body", m.Cost); err != nil { - return err - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateEnrollmentCreatedAt(formats strfmt.Registry) error { - - if swag.IsZero(m.EnrollmentCreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("enrollmentCreatedAt", "body", "date-time", m.EnrollmentCreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateEnrollmentExpiresAt(formats strfmt.Registry) error { - - if swag.IsZero(m.EnrollmentExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("enrollmentExpiresAt", "body", "date-time", m.EnrollmentExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateFingerprint(formats strfmt.Registry) error { - - if err := validate.Required("fingerprint", "body", m.Fingerprint); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateIsOnline(formats strfmt.Registry) error { - - if err := validate.Required("isOnline", "body", m.IsOnline); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateIsVerified(formats strfmt.Registry) error { - - if err := validate.Required("isVerified", "body", m.IsVerified); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RouterDetail) validateNoTraversal(formats strfmt.Registry) error { - - if err := validate.Required("noTraversal", "body", m.NoTraversal); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this router detail based on the context it is used -func (m *RouterDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *RouterDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RouterDetail) UnmarshalBinary(b []byte) error { - var res RouterDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/router_entity_ref.go b/rest_model/router_entity_ref.go deleted file mode 100644 index 7d5873af1..000000000 --- a/rest_model/router_entity_ref.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RouterEntityRef router entity ref -// -// swagger:model routerEntityRef -type RouterEntityRef struct { - EntityRef - - // is online - // Required: true - IsOnline *bool `json:"isOnline"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *RouterEntityRef) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 EntityRef - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.EntityRef = aO0 - - // AO1 - var dataAO1 struct { - IsOnline *bool `json:"isOnline"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.IsOnline = dataAO1.IsOnline - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m RouterEntityRef) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.EntityRef) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - IsOnline *bool `json:"isOnline"` - } - - dataAO1.IsOnline = m.IsOnline - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this router entity ref -func (m *RouterEntityRef) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with EntityRef - if err := m.EntityRef.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsOnline(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterEntityRef) validateIsOnline(formats strfmt.Registry) error { - - if err := validate.Required("isOnline", "body", m.IsOnline); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this router entity ref based on the context it is used -func (m *RouterEntityRef) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with EntityRef - if err := m.EntityRef.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *RouterEntityRef) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RouterEntityRef) UnmarshalBinary(b []byte) error { - var res RouterEntityRef - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/router_extend_enrollment_request.go b/rest_model/router_extend_enrollment_request.go deleted file mode 100644 index 4b413e307..000000000 --- a/rest_model/router_extend_enrollment_request.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RouterExtendEnrollmentRequest router extend enrollment request -// -// swagger:model routerExtendEnrollmentRequest -type RouterExtendEnrollmentRequest struct { - - // cert csr - // Required: true - CertCsr *string `json:"certCsr"` - - // server cert csr - // Required: true - ServerCertCsr *string `json:"serverCertCsr"` -} - -// Validate validates this router extend enrollment request -func (m *RouterExtendEnrollmentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertCsr(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServerCertCsr(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterExtendEnrollmentRequest) validateCertCsr(formats strfmt.Registry) error { - - if err := validate.Required("certCsr", "body", m.CertCsr); err != nil { - return err - } - - return nil -} - -func (m *RouterExtendEnrollmentRequest) validateServerCertCsr(formats strfmt.Registry) error { - - if err := validate.Required("serverCertCsr", "body", m.ServerCertCsr); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this router extend enrollment request based on context it is used -func (m *RouterExtendEnrollmentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RouterExtendEnrollmentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RouterExtendEnrollmentRequest) UnmarshalBinary(b []byte) error { - var res RouterExtendEnrollmentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/router_list.go b/rest_model/router_list.go deleted file mode 100644 index 88673642b..000000000 --- a/rest_model/router_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// RouterList router list -// -// swagger:model routerList -type RouterList []*RouterDetail - -// Validate validates this router list -func (m RouterList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this router list based on the context it is used -func (m RouterList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/router_patch.go b/rest_model/router_patch.go deleted file mode 100644 index c4ca018a5..000000000 --- a/rest_model/router_patch.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RouterPatch router patch -// -// swagger:model routerPatch -type RouterPatch struct { - - // cost - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost,omitempty"` - - // name - Name string `json:"name,omitempty"` - - // no traversal - NoTraversal *bool `json:"noTraversal,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this router patch -func (m *RouterPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterPatch) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *RouterPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this router patch based on the context it is used -func (m *RouterPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RouterPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RouterPatch) UnmarshalBinary(b []byte) error { - var res RouterPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/router_update.go b/rest_model/router_update.go deleted file mode 100644 index e800d3dd0..000000000 --- a/rest_model/router_update.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RouterUpdate router update -// -// swagger:model routerUpdate -type RouterUpdate struct { - - // cost - // Maximum: 65535 - // Minimum: 0 - Cost *int64 `json:"cost,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // no traversal - NoTraversal *bool `json:"noTraversal,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this router update -func (m *RouterUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterUpdate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if err := validate.MinimumInt("cost", "body", *m.Cost, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("cost", "body", *m.Cost, 65535, false); err != nil { - return err - } - - return nil -} - -func (m *RouterUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *RouterUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this router update based on the context it is used -func (m *RouterUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RouterUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RouterUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RouterUpdate) UnmarshalBinary(b []byte) error { - var res RouterUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/sdk_info.go b/rest_model/sdk_info.go deleted file mode 100644 index 0896b11c0..000000000 --- a/rest_model/sdk_info.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SdkInfo SDK information an authenticating client may provide -// -// swagger:model sdkInfo -type SdkInfo struct { - - // app Id - AppID string `json:"appId,omitempty"` - - // app version - AppVersion string `json:"appVersion,omitempty"` - - // branch - Branch string `json:"branch,omitempty"` - - // revision - Revision string `json:"revision,omitempty"` - - // type - Type string `json:"type,omitempty"` - - // version - Version string `json:"version,omitempty"` -} - -// Validate validates this sdk info -func (m *SdkInfo) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this sdk info based on context it is used -func (m *SdkInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SdkInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SdkInfo) UnmarshalBinary(b []byte) error { - var res SdkInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/semantic.go b/rest_model/semantic.go deleted file mode 100644 index 7720469e5..000000000 --- a/rest_model/semantic.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Semantic semantic -// -// swagger:model semantic -type Semantic string - -func NewSemantic(value Semantic) *Semantic { - v := value - return &v -} - -const ( - - // SemanticAllOf captures enum value "AllOf" - SemanticAllOf Semantic = "AllOf" - - // SemanticAnyOf captures enum value "AnyOf" - SemanticAnyOf Semantic = "AnyOf" -) - -// for schema -var semanticEnum []interface{} - -func init() { - var res []Semantic - if err := json.Unmarshal([]byte(`["AllOf","AnyOf"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - semanticEnum = append(semanticEnum, v) - } -} - -func (m Semantic) validateSemanticEnum(path, location string, value Semantic) error { - if err := validate.EnumCase(path, location, value, semanticEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this semantic -func (m Semantic) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSemanticEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this semantic based on context it is used -func (m Semantic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/service_config_assign.go b/rest_model/service_config_assign.go deleted file mode 100644 index fb63484e2..000000000 --- a/rest_model/service_config_assign.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceConfigAssign service config assign -// -// swagger:model serviceConfigAssign -type ServiceConfigAssign struct { - - // config Id - // Required: true - ConfigID *string `json:"configId"` - - // service Id - // Required: true - ServiceID *string `json:"serviceId"` -} - -// Validate validates this service config assign -func (m *ServiceConfigAssign) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfigID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceConfigAssign) validateConfigID(formats strfmt.Registry) error { - - if err := validate.Required("configId", "body", m.ConfigID); err != nil { - return err - } - - return nil -} - -func (m *ServiceConfigAssign) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("serviceId", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this service config assign based on context it is used -func (m *ServiceConfigAssign) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceConfigAssign) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceConfigAssign) UnmarshalBinary(b []byte) error { - var res ServiceConfigAssign - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_config_detail.go b/rest_model/service_config_detail.go deleted file mode 100644 index 550c84700..000000000 --- a/rest_model/service_config_detail.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceConfigDetail service config detail -// Example: {"config":{"_links":{"self":{"href":"./identities/13347602-ba34-4ff7-8082-e533ba945744"}},"id":"13347602-ba34-4ff7-8082-e533ba945744","name":"test-config-02fade09-fcc3-426c-854e-18539726bdc6","urlName":"configs"},"service":{"_links":{"self":{"href":"./services/913a8c63-17a6-44d7-82b3-9f6eb997cf8e"}},"id":"913a8c63-17a6-44d7-82b3-9f6eb997cf8e","name":"netcat4545-egress-r2","urlName":"services"}} -// -// swagger:model serviceConfigDetail -type ServiceConfigDetail struct { - - // config - // Required: true - Config *EntityRef `json:"config"` - - // config Id - // Required: true - ConfigID *string `json:"configId"` - - // service - // Required: true - Service *EntityRef `json:"service"` - - // service Id - // Required: true - ServiceID *string `json:"serviceId"` -} - -// Validate validates this service config detail -func (m *ServiceConfigDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConfig(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceConfigDetail) validateConfig(formats strfmt.Registry) error { - - if err := validate.Required("config", "body", m.Config); err != nil { - return err - } - - if m.Config != nil { - if err := m.Config.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("config") - } - return err - } - } - - return nil -} - -func (m *ServiceConfigDetail) validateConfigID(formats strfmt.Registry) error { - - if err := validate.Required("configId", "body", m.ConfigID); err != nil { - return err - } - - return nil -} - -func (m *ServiceConfigDetail) validateService(formats strfmt.Registry) error { - - if err := validate.Required("service", "body", m.Service); err != nil { - return err - } - - if m.Service != nil { - if err := m.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -func (m *ServiceConfigDetail) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("serviceId", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service config detail based on the context it is used -func (m *ServiceConfigDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateConfig(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceConfigDetail) contextValidateConfig(ctx context.Context, formats strfmt.Registry) error { - - if m.Config != nil { - if err := m.Config.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("config") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("config") - } - return err - } - } - - return nil -} - -func (m *ServiceConfigDetail) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - - if m.Service != nil { - if err := m.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceConfigDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceConfigDetail) UnmarshalBinary(b []byte) error { - var res ServiceConfigDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_config_list.go b/rest_model/service_config_list.go deleted file mode 100644 index a0e80b4be..000000000 --- a/rest_model/service_config_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceConfigList service config list -// -// swagger:model serviceConfigList -type ServiceConfigList []*ServiceConfigDetail - -// Validate validates this service config list -func (m ServiceConfigList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service config list based on the context it is used -func (m ServiceConfigList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/service_configs_assign_list.go b/rest_model/service_configs_assign_list.go deleted file mode 100644 index f90ddbbeb..000000000 --- a/rest_model/service_configs_assign_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceConfigsAssignList service configs assign list -// -// swagger:model serviceConfigsAssignList -type ServiceConfigsAssignList []*ServiceConfigAssign - -// Validate validates this service configs assign list -func (m ServiceConfigsAssignList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service configs assign list based on the context it is used -func (m ServiceConfigsAssignList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/service_create.go b/rest_model/service_create.go deleted file mode 100644 index b0cf5f45f..000000000 --- a/rest_model/service_create.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceCreate service create -// -// swagger:model serviceCreate -type ServiceCreate struct { - - // configs - Configs []string `json:"configs"` - - // Describes whether connections must support end-to-end encryption on both sides of the connection. - // Required: true - EncryptionRequired *bool `json:"encryptionRequired"` - - // name - // Required: true - Name *string `json:"name"` - - // role attributes - RoleAttributes []string `json:"roleAttributes"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // terminator strategy - TerminatorStrategy string `json:"terminatorStrategy,omitempty"` -} - -// Validate validates this service create -func (m *ServiceCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEncryptionRequired(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceCreate) validateEncryptionRequired(formats strfmt.Registry) error { - - if err := validate.Required("encryptionRequired", "body", m.EncryptionRequired); err != nil { - return err - } - - return nil -} - -func (m *ServiceCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service create based on the context it is used -func (m *ServiceCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceCreate) UnmarshalBinary(b []byte) error { - var res ServiceCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_detail.go b/rest_model/service_detail.go deleted file mode 100644 index ca26c33cf..000000000 --- a/rest_model/service_detail.go +++ /dev/null @@ -1,452 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceDetail service detail -// -// swagger:model serviceDetail -type ServiceDetail struct { - BaseEntity - - // map of config data for this service keyed by the config type name. Only configs of the types requested will be returned. - // Required: true - Config map[string]map[string]interface{} `json:"config"` - - // configs - // Required: true - Configs []string `json:"configs"` - - // Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create. - // Required: true - EncryptionRequired *bool `json:"encryptionRequired"` - - // name - // Required: true - Name *string `json:"name"` - - // permissions - // Required: true - Permissions DialBindArray `json:"permissions"` - - // posture queries - // Required: true - PostureQueries []*PostureQueries `json:"postureQueries"` - - // role attributes - // Required: true - RoleAttributes *Attributes `json:"roleAttributes"` - - // terminator strategy - // Required: true - TerminatorStrategy *string `json:"terminatorStrategy"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ServiceDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Config map[string]map[string]interface{} `json:"config"` - - Configs []string `json:"configs"` - - EncryptionRequired *bool `json:"encryptionRequired"` - - Name *string `json:"name"` - - Permissions DialBindArray `json:"permissions"` - - PostureQueries []*PostureQueries `json:"postureQueries"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - TerminatorStrategy *string `json:"terminatorStrategy"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Config = dataAO1.Config - - m.Configs = dataAO1.Configs - - m.EncryptionRequired = dataAO1.EncryptionRequired - - m.Name = dataAO1.Name - - m.Permissions = dataAO1.Permissions - - m.PostureQueries = dataAO1.PostureQueries - - m.RoleAttributes = dataAO1.RoleAttributes - - m.TerminatorStrategy = dataAO1.TerminatorStrategy - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ServiceDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Config map[string]map[string]interface{} `json:"config"` - - Configs []string `json:"configs"` - - EncryptionRequired *bool `json:"encryptionRequired"` - - Name *string `json:"name"` - - Permissions DialBindArray `json:"permissions"` - - PostureQueries []*PostureQueries `json:"postureQueries"` - - RoleAttributes *Attributes `json:"roleAttributes"` - - TerminatorStrategy *string `json:"terminatorStrategy"` - } - - dataAO1.Config = m.Config - - dataAO1.Configs = m.Configs - - dataAO1.EncryptionRequired = m.EncryptionRequired - - dataAO1.Name = m.Name - - dataAO1.Permissions = m.Permissions - - dataAO1.PostureQueries = m.PostureQueries - - dataAO1.RoleAttributes = m.RoleAttributes - - dataAO1.TerminatorStrategy = m.TerminatorStrategy - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this service detail -func (m *ServiceDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfig(formats); err != nil { - res = append(res, err) - } - - if err := m.validateConfigs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEncryptionRequired(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePermissions(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureQueries(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleAttributes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTerminatorStrategy(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceDetail) validateConfig(formats strfmt.Registry) error { - - if err := validate.Required("config", "body", m.Config); err != nil { - return err - } - - for k := range m.Config { - - if err := validate.Required("config"+"."+k, "body", m.Config[k]); err != nil { - return err - } - - if err := validate.Required("config"+"."+k, "body", m.Config); err != nil { - return err - } - - for kk := range m.Config[k] { - - if err := validate.Required("config"+"."+k+"."+kk, "body", m.Config[k][kk]); err != nil { - return err - } - - } - - } - - return nil -} - -func (m *ServiceDetail) validateConfigs(formats strfmt.Registry) error { - - if err := validate.Required("configs", "body", m.Configs); err != nil { - return err - } - - return nil -} - -func (m *ServiceDetail) validateEncryptionRequired(formats strfmt.Registry) error { - - if err := validate.Required("encryptionRequired", "body", m.EncryptionRequired); err != nil { - return err - } - - return nil -} - -func (m *ServiceDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceDetail) validatePermissions(formats strfmt.Registry) error { - - if err := validate.Required("permissions", "body", m.Permissions); err != nil { - return err - } - - if err := m.Permissions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permissions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permissions") - } - return err - } - - return nil -} - -func (m *ServiceDetail) validatePostureQueries(formats strfmt.Registry) error { - - if err := validate.Required("postureQueries", "body", m.PostureQueries); err != nil { - return err - } - - for i := 0; i < len(m.PostureQueries); i++ { - if swag.IsZero(m.PostureQueries[i]) { // not required - continue - } - - if m.PostureQueries[i] != nil { - if err := m.PostureQueries[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ServiceDetail) validateRoleAttributes(formats strfmt.Registry) error { - - if err := validate.Required("roleAttributes", "body", m.RoleAttributes); err != nil { - return err - } - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -func (m *ServiceDetail) validateTerminatorStrategy(formats strfmt.Registry) error { - - if err := validate.Required("terminatorStrategy", "body", m.TerminatorStrategy); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service detail based on the context it is used -func (m *ServiceDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePermissions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureQueries(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoleAttributes(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceDetail) contextValidatePermissions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Permissions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permissions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permissions") - } - return err - } - - return nil -} - -func (m *ServiceDetail) contextValidatePostureQueries(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PostureQueries); i++ { - - if m.PostureQueries[i] != nil { - if err := m.PostureQueries[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureQueries" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ServiceDetail) contextValidateRoleAttributes(ctx context.Context, formats strfmt.Registry) error { - - if m.RoleAttributes != nil { - if err := m.RoleAttributes.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roleAttributes") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roleAttributes") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceDetail) UnmarshalBinary(b []byte) error { - var res ServiceDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_edge_router_policy_create.go b/rest_model/service_edge_router_policy_create.go deleted file mode 100644 index 25fcc07cb..000000000 --- a/rest_model/service_edge_router_policy_create.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceEdgeRouterPolicyCreate service edge router policy create -// -// swagger:model serviceEdgeRouterPolicyCreate -type ServiceEdgeRouterPolicyCreate struct { - - // edge router roles - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // name - // Required: true - Name *string `json:"name"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // service roles - ServiceRoles Roles `json:"serviceRoles"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this service edge router policy create -func (m *ServiceEdgeRouterPolicyCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required - return nil - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required - return nil - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service edge router policy create based on the context it is used -func (m *ServiceEdgeRouterPolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyCreate) UnmarshalBinary(b []byte) error { - var res ServiceEdgeRouterPolicyCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_edge_router_policy_detail.go b/rest_model/service_edge_router_policy_detail.go deleted file mode 100644 index 96d16be48..000000000 --- a/rest_model/service_edge_router_policy_detail.go +++ /dev/null @@ -1,424 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceEdgeRouterPolicyDetail service edge router policy detail -// -// swagger:model serviceEdgeRouterPolicyDetail -type ServiceEdgeRouterPolicyDetail struct { - BaseEntity - - // edge router roles - // Required: true - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // edge router roles display - // Required: true - EdgeRouterRolesDisplay NamedRoles `json:"edgeRouterRolesDisplay"` - - // name - // Required: true - Name *string `json:"name"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // service roles - // Required: true - ServiceRoles Roles `json:"serviceRoles"` - - // service roles display - // Required: true - ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ServiceEdgeRouterPolicyDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - EdgeRouterRolesDisplay NamedRoles `json:"edgeRouterRolesDisplay"` - - Name *string `json:"name"` - - Semantic *Semantic `json:"semantic"` - - ServiceRoles Roles `json:"serviceRoles"` - - ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.EdgeRouterRoles = dataAO1.EdgeRouterRoles - - m.EdgeRouterRolesDisplay = dataAO1.EdgeRouterRolesDisplay - - m.Name = dataAO1.Name - - m.Semantic = dataAO1.Semantic - - m.ServiceRoles = dataAO1.ServiceRoles - - m.ServiceRolesDisplay = dataAO1.ServiceRolesDisplay - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ServiceEdgeRouterPolicyDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - EdgeRouterRolesDisplay NamedRoles `json:"edgeRouterRolesDisplay"` - - Name *string `json:"name"` - - Semantic *Semantic `json:"semantic"` - - ServiceRoles Roles `json:"serviceRoles"` - - ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - } - - dataAO1.EdgeRouterRoles = m.EdgeRouterRoles - - dataAO1.EdgeRouterRolesDisplay = m.EdgeRouterRolesDisplay - - dataAO1.Name = m.Name - - dataAO1.Semantic = m.Semantic - - dataAO1.ServiceRoles = m.ServiceRoles - - dataAO1.ServiceRolesDisplay = m.ServiceRolesDisplay - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this service edge router policy detail -func (m *ServiceEdgeRouterPolicyDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdgeRouterRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) validateEdgeRouterRoles(formats strfmt.Registry) error { - - if err := validate.Required("edgeRouterRoles", "body", m.EdgeRouterRoles); err != nil { - return err - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) validateEdgeRouterRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("edgeRouterRolesDisplay", "body", m.EdgeRouterRolesDisplay); err != nil { - return err - } - - if err := m.EdgeRouterRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) validateServiceRoles(formats strfmt.Registry) error { - - if err := validate.Required("serviceRoles", "body", m.ServiceRoles); err != nil { - return err - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) validateServiceRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("serviceRolesDisplay", "body", m.ServiceRolesDisplay); err != nil { - return err - } - - if err := m.ServiceRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRolesDisplay") - } - return err - } - - return nil -} - -// ContextValidate validate this service edge router policy detail based on the context it is used -func (m *ServiceEdgeRouterPolicyDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEdgeRouterRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) contextValidateEdgeRouterRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyDetail) contextValidateServiceRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRolesDisplay") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyDetail) UnmarshalBinary(b []byte) error { - var res ServiceEdgeRouterPolicyDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_edge_router_policy_list.go b/rest_model/service_edge_router_policy_list.go deleted file mode 100644 index 45536f37d..000000000 --- a/rest_model/service_edge_router_policy_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceEdgeRouterPolicyList service edge router policy list -// -// swagger:model serviceEdgeRouterPolicyList -type ServiceEdgeRouterPolicyList []*ServiceEdgeRouterPolicyDetail - -// Validate validates this service edge router policy list -func (m ServiceEdgeRouterPolicyList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service edge router policy list based on the context it is used -func (m ServiceEdgeRouterPolicyList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/service_edge_router_policy_patch.go b/rest_model/service_edge_router_policy_patch.go deleted file mode 100644 index 0e6b25e08..000000000 --- a/rest_model/service_edge_router_policy_patch.go +++ /dev/null @@ -1,257 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceEdgeRouterPolicyPatch service edge router policy patch -// -// swagger:model serviceEdgeRouterPolicyPatch -type ServiceEdgeRouterPolicyPatch struct { - - // edge router roles - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // name - Name string `json:"name,omitempty"` - - // semantic - Semantic Semantic `json:"semantic,omitempty"` - - // service roles - ServiceRoles Roles `json:"serviceRoles"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this service edge router policy patch -func (m *ServiceEdgeRouterPolicyPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required - return nil - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required - return nil - } - - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required - return nil - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service edge router policy patch based on the context it is used -func (m *ServiceEdgeRouterPolicyPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyPatch) UnmarshalBinary(b []byte) error { - var res ServiceEdgeRouterPolicyPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_edge_router_policy_update.go b/rest_model/service_edge_router_policy_update.go deleted file mode 100644 index d01dcd2ee..000000000 --- a/rest_model/service_edge_router_policy_update.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceEdgeRouterPolicyUpdate service edge router policy update -// -// swagger:model serviceEdgeRouterPolicyUpdate -type ServiceEdgeRouterPolicyUpdate struct { - - // edge router roles - EdgeRouterRoles Roles `json:"edgeRouterRoles"` - - // name - // Required: true - Name *string `json:"name"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // service roles - ServiceRoles Roles `json:"serviceRoles"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this service edge router policy update -func (m *ServiceEdgeRouterPolicyUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdgeRouterRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) validateEdgeRouterRoles(formats strfmt.Registry) error { - if swag.IsZero(m.EdgeRouterRoles) { // not required - return nil - } - - if err := m.EdgeRouterRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required - return nil - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service edge router policy update based on the context it is used -func (m *ServiceEdgeRouterPolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdgeRouterRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) contextValidateEdgeRouterRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.EdgeRouterRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouterRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouterRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServiceEdgeRouterPolicyUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceEdgeRouterPolicyUpdate) UnmarshalBinary(b []byte) error { - var res ServiceEdgeRouterPolicyUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_list.go b/rest_model/service_list.go deleted file mode 100644 index d3224d354..000000000 --- a/rest_model/service_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceList service list -// -// swagger:model serviceList -type ServiceList []*ServiceDetail - -// Validate validates this service list -func (m ServiceList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service list based on the context it is used -func (m ServiceList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/service_patch.go b/rest_model/service_patch.go deleted file mode 100644 index 14649db7f..000000000 --- a/rest_model/service_patch.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServicePatch service patch -// -// swagger:model servicePatch -type ServicePatch struct { - - // configs - Configs []string `json:"configs"` - - // Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create. - EncryptionRequired bool `json:"encryptionRequired,omitempty"` - - // name - Name string `json:"name,omitempty"` - - // role attributes - RoleAttributes []string `json:"roleAttributes"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // terminator strategy - TerminatorStrategy string `json:"terminatorStrategy,omitempty"` -} - -// Validate validates this service patch -func (m *ServicePatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service patch based on the context it is used -func (m *ServicePatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicePatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicePatch) UnmarshalBinary(b []byte) error { - var res ServicePatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_policy_create.go b/rest_model/service_policy_create.go deleted file mode 100644 index 5c8a62765..000000000 --- a/rest_model/service_policy_create.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServicePolicyCreate service policy create -// -// swagger:model servicePolicyCreate -type ServicePolicyCreate struct { - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // name - // Required: true - Name *string `json:"name"` - - // posture check roles - PostureCheckRoles Roles `json:"postureCheckRoles"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // service roles - ServiceRoles Roles `json:"serviceRoles"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - // Required: true - Type *DialBind `json:"type"` -} - -// Validate validates this service policy create -func (m *ServicePolicyCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyCreate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyCreate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServicePolicyCreate) validatePostureCheckRoles(formats strfmt.Registry) error { - if swag.IsZero(m.PostureCheckRoles) { // not required - return nil - } - - if err := m.PostureCheckRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyCreate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyCreate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required - return nil - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyCreate) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service policy create based on the context it is used -func (m *ServicePolicyCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureCheckRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyCreate) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyCreate) contextValidatePostureCheckRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostureCheckRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyCreate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyCreate) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicePolicyCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicePolicyCreate) UnmarshalBinary(b []byte) error { - var res ServicePolicyCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_policy_detail.go b/rest_model/service_policy_detail.go deleted file mode 100644 index 4ef488a8a..000000000 --- a/rest_model/service_policy_detail.go +++ /dev/null @@ -1,588 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServicePolicyDetail service policy detail -// -// swagger:model servicePolicyDetail -type ServicePolicyDetail struct { - BaseEntity - - // identity roles - // Required: true - IdentityRoles Roles `json:"identityRoles"` - - // identity roles display - // Required: true - IdentityRolesDisplay NamedRoles `json:"identityRolesDisplay"` - - // name - // Required: true - Name *string `json:"name"` - - // posture check roles - // Required: true - PostureCheckRoles Roles `json:"postureCheckRoles"` - - // posture check roles display - // Required: true - PostureCheckRolesDisplay NamedRoles `json:"postureCheckRolesDisplay"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // service roles - // Required: true - ServiceRoles Roles `json:"serviceRoles"` - - // service roles display - // Required: true - ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - - // type - // Required: true - Type *DialBind `json:"type"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ServicePolicyDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - IdentityRoles Roles `json:"identityRoles"` - - IdentityRolesDisplay NamedRoles `json:"identityRolesDisplay"` - - Name *string `json:"name"` - - PostureCheckRoles Roles `json:"postureCheckRoles"` - - PostureCheckRolesDisplay NamedRoles `json:"postureCheckRolesDisplay"` - - Semantic *Semantic `json:"semantic"` - - ServiceRoles Roles `json:"serviceRoles"` - - ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - - Type *DialBind `json:"type"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.IdentityRoles = dataAO1.IdentityRoles - - m.IdentityRolesDisplay = dataAO1.IdentityRolesDisplay - - m.Name = dataAO1.Name - - m.PostureCheckRoles = dataAO1.PostureCheckRoles - - m.PostureCheckRolesDisplay = dataAO1.PostureCheckRolesDisplay - - m.Semantic = dataAO1.Semantic - - m.ServiceRoles = dataAO1.ServiceRoles - - m.ServiceRolesDisplay = dataAO1.ServiceRolesDisplay - - m.Type = dataAO1.Type - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ServicePolicyDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - IdentityRoles Roles `json:"identityRoles"` - - IdentityRolesDisplay NamedRoles `json:"identityRolesDisplay"` - - Name *string `json:"name"` - - PostureCheckRoles Roles `json:"postureCheckRoles"` - - PostureCheckRolesDisplay NamedRoles `json:"postureCheckRolesDisplay"` - - Semantic *Semantic `json:"semantic"` - - ServiceRoles Roles `json:"serviceRoles"` - - ServiceRolesDisplay NamedRoles `json:"serviceRolesDisplay"` - - Type *DialBind `json:"type"` - } - - dataAO1.IdentityRoles = m.IdentityRoles - - dataAO1.IdentityRolesDisplay = m.IdentityRolesDisplay - - dataAO1.Name = m.Name - - dataAO1.PostureCheckRoles = m.PostureCheckRoles - - dataAO1.PostureCheckRolesDisplay = m.PostureCheckRolesDisplay - - dataAO1.Semantic = m.Semantic - - dataAO1.ServiceRoles = m.ServiceRoles - - dataAO1.ServiceRolesDisplay = m.ServiceRolesDisplay - - dataAO1.Type = m.Type - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this service policy detail -func (m *ServicePolicyDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRolesDisplay(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyDetail) validateIdentityRoles(formats strfmt.Registry) error { - - if err := validate.Required("identityRoles", "body", m.IdentityRoles); err != nil { - return err - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validateIdentityRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("identityRolesDisplay", "body", m.IdentityRolesDisplay); err != nil { - return err - } - - if err := m.IdentityRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validatePostureCheckRoles(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckRoles", "body", m.PostureCheckRoles); err != nil { - return err - } - - if err := m.PostureCheckRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validatePostureCheckRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("postureCheckRolesDisplay", "body", m.PostureCheckRolesDisplay); err != nil { - return err - } - - if err := m.PostureCheckRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyDetail) validateServiceRoles(formats strfmt.Registry) error { - - if err := validate.Required("serviceRoles", "body", m.ServiceRoles); err != nil { - return err - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validateServiceRolesDisplay(formats strfmt.Registry) error { - - if err := validate.Required("serviceRolesDisplay", "body", m.ServiceRolesDisplay); err != nil { - return err - } - - if err := m.ServiceRolesDisplay.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service policy detail based on the context it is used -func (m *ServicePolicyDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIdentityRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureCheckRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureCheckRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRolesDisplay(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyDetail) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidateIdentityRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidatePostureCheckRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostureCheckRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidatePostureCheckRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostureCheckRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidateServiceRolesDisplay(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRolesDisplay.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRolesDisplay") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRolesDisplay") - } - return err - } - - return nil -} - -func (m *ServicePolicyDetail) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicePolicyDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicePolicyDetail) UnmarshalBinary(b []byte) error { - var res ServicePolicyDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_policy_list.go b/rest_model/service_policy_list.go deleted file mode 100644 index b61522c18..000000000 --- a/rest_model/service_policy_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServicePolicyList service policy list -// -// swagger:model servicePolicyList -type ServicePolicyList []*ServicePolicyDetail - -// Validate validates this service policy list -func (m ServicePolicyList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service policy list based on the context it is used -func (m ServicePolicyList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/service_policy_patch.go b/rest_model/service_policy_patch.go deleted file mode 100644 index 1e04543c7..000000000 --- a/rest_model/service_policy_patch.go +++ /dev/null @@ -1,341 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServicePolicyPatch service policy patch -// -// swagger:model servicePolicyPatch -type ServicePolicyPatch struct { - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // name - Name string `json:"name,omitempty"` - - // posture check roles - PostureCheckRoles Roles `json:"postureCheckRoles"` - - // semantic - Semantic Semantic `json:"semantic,omitempty"` - - // service roles - ServiceRoles Roles `json:"serviceRoles"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - Type DialBind `json:"type,omitempty"` -} - -// Validate validates this service policy patch -func (m *ServicePolicyPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyPatch) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) validatePostureCheckRoles(formats strfmt.Registry) error { - if swag.IsZero(m.PostureCheckRoles) { // not required - return nil - } - - if err := m.PostureCheckRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) validateSemantic(formats strfmt.Registry) error { - if swag.IsZero(m.Semantic) { // not required - return nil - } - - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required - return nil - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyPatch) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this service policy patch based on the context it is used -func (m *ServicePolicyPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureCheckRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyPatch) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) contextValidatePostureCheckRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostureCheckRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyPatch) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicePolicyPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicePolicyPatch) UnmarshalBinary(b []byte) error { - var res ServicePolicyPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_policy_update.go b/rest_model/service_policy_update.go deleted file mode 100644 index 319e9058a..000000000 --- a/rest_model/service_policy_update.go +++ /dev/null @@ -1,376 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServicePolicyUpdate service policy update -// -// swagger:model servicePolicyUpdate -type ServicePolicyUpdate struct { - - // identity roles - IdentityRoles Roles `json:"identityRoles"` - - // name - // Required: true - Name *string `json:"name"` - - // posture check roles - PostureCheckRoles Roles `json:"postureCheckRoles"` - - // semantic - // Required: true - Semantic *Semantic `json:"semantic"` - - // service roles - ServiceRoles Roles `json:"serviceRoles"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - // Required: true - Type *DialBind `json:"type"` -} - -// Validate validates this service policy update -func (m *ServicePolicyUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIdentityRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostureCheckRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSemantic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyUpdate) validateIdentityRoles(formats strfmt.Registry) error { - if swag.IsZero(m.IdentityRoles) { // not required - return nil - } - - if err := m.IdentityRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) validatePostureCheckRoles(formats strfmt.Registry) error { - if swag.IsZero(m.PostureCheckRoles) { // not required - return nil - } - - if err := m.PostureCheckRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) validateSemantic(formats strfmt.Registry) error { - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if err := validate.Required("semantic", "body", m.Semantic); err != nil { - return err - } - - if m.Semantic != nil { - if err := m.Semantic.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyUpdate) validateServiceRoles(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRoles) { // not required - return nil - } - - if err := m.ServiceRoles.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyUpdate) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service policy update based on the context it is used -func (m *ServicePolicyUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateIdentityRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePostureCheckRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSemantic(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServicePolicyUpdate) contextValidateIdentityRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.IdentityRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("identityRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("identityRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) contextValidatePostureCheckRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PostureCheckRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("postureCheckRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("postureCheckRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) contextValidateSemantic(ctx context.Context, formats strfmt.Registry) error { - - if m.Semantic != nil { - if err := m.Semantic.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("semantic") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("semantic") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyUpdate) contextValidateServiceRoles(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRoles.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRoles") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRoles") - } - return err - } - - return nil -} - -func (m *ServicePolicyUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *ServicePolicyUpdate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServicePolicyUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServicePolicyUpdate) UnmarshalBinary(b []byte) error { - var res ServicePolicyUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/service_update.go b/rest_model/service_update.go deleted file mode 100644 index c06488cad..000000000 --- a/rest_model/service_update.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceUpdate service update -// -// swagger:model serviceUpdate -type ServiceUpdate struct { - - // configs - Configs []string `json:"configs"` - - // Describes whether connections must support end-to-end encryption on both sides of the connection. Read-only property, set at create. - EncryptionRequired bool `json:"encryptionRequired,omitempty"` - - // name - // Required: true - Name *string `json:"name"` - - // role attributes - RoleAttributes []string `json:"roleAttributes"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // terminator strategy - TerminatorStrategy string `json:"terminatorStrategy,omitempty"` -} - -// Validate validates this service update -func (m *ServiceUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceUpdate) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service update based on the context it is used -func (m *ServiceUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceUpdate) UnmarshalBinary(b []byte) error { - var res ServiceUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/session_create.go b/rest_model/session_create.go deleted file mode 100644 index 852ec1498..000000000 --- a/rest_model/session_create.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionCreate session create -// -// swagger:model sessionCreate -type SessionCreate struct { - - // service Id - ServiceID string `json:"serviceId,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` - - // type - Type DialBind `json:"type,omitempty"` -} - -// Validate validates this session create -func (m *SessionCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *SessionCreate) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this session create based on the context it is used -func (m *SessionCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -func (m *SessionCreate) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionCreate) UnmarshalBinary(b []byte) error { - var res SessionCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/session_create_envelope.go b/rest_model/session_create_envelope.go deleted file mode 100644 index c905a5c40..000000000 --- a/rest_model/session_create_envelope.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionCreateEnvelope session create envelope -// -// swagger:model sessionCreateEnvelope -type SessionCreateEnvelope struct { - - // data - Data *SessionDetail `json:"data,omitempty"` - - // meta - Meta *Meta `json:"meta,omitempty"` -} - -// Validate validates this session create envelope -func (m *SessionCreateEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionCreateEnvelope) validateData(formats strfmt.Registry) error { - if swag.IsZero(m.Data) { // not required - return nil - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *SessionCreateEnvelope) validateMeta(formats strfmt.Registry) error { - if swag.IsZero(m.Meta) { // not required - return nil - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this session create envelope based on the context it is used -func (m *SessionCreateEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionCreateEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *SessionCreateEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionCreateEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionCreateEnvelope) UnmarshalBinary(b []byte) error { - var res SessionCreateEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/session_detail.go b/rest_model/session_detail.go deleted file mode 100644 index 50df1ac04..000000000 --- a/rest_model/session_detail.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionDetail session detail -// -// swagger:model sessionDetail -type SessionDetail struct { - BaseEntity - - // api session - // Required: true - APISession *EntityRef `json:"apiSession"` - - // api session Id - // Required: true - APISessionID *string `json:"apiSessionId"` - - // edge routers - // Required: true - EdgeRouters []*SessionEdgeRouter `json:"edgeRouters"` - - // identity Id - // Required: true - IdentityID *string `json:"identityId"` - - // service - // Required: true - Service *EntityRef `json:"service"` - - // service Id - // Required: true - ServiceID *string `json:"serviceId"` - - // token - // Required: true - Token *string `json:"token"` - - // type - // Required: true - Type *DialBind `json:"type"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *SessionDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - APISession *EntityRef `json:"apiSession"` - - APISessionID *string `json:"apiSessionId"` - - EdgeRouters []*SessionEdgeRouter `json:"edgeRouters"` - - IdentityID *string `json:"identityId"` - - Service *EntityRef `json:"service"` - - ServiceID *string `json:"serviceId"` - - Token *string `json:"token"` - - Type *DialBind `json:"type"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.APISession = dataAO1.APISession - - m.APISessionID = dataAO1.APISessionID - - m.EdgeRouters = dataAO1.EdgeRouters - - m.IdentityID = dataAO1.IdentityID - - m.Service = dataAO1.Service - - m.ServiceID = dataAO1.ServiceID - - m.Token = dataAO1.Token - - m.Type = dataAO1.Type - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m SessionDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - APISession *EntityRef `json:"apiSession"` - - APISessionID *string `json:"apiSessionId"` - - EdgeRouters []*SessionEdgeRouter `json:"edgeRouters"` - - IdentityID *string `json:"identityId"` - - Service *EntityRef `json:"service"` - - ServiceID *string `json:"serviceId"` - - Token *string `json:"token"` - - Type *DialBind `json:"type"` - } - - dataAO1.APISession = m.APISession - - dataAO1.APISessionID = m.APISessionID - - dataAO1.EdgeRouters = m.EdgeRouters - - dataAO1.IdentityID = m.IdentityID - - dataAO1.Service = m.Service - - dataAO1.ServiceID = m.ServiceID - - dataAO1.Token = m.Token - - dataAO1.Type = m.Type - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this session detail -func (m *SessionDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAPISession(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAPISessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdgeRouters(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentityID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateToken(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionDetail) validateAPISession(formats strfmt.Registry) error { - - if err := validate.Required("apiSession", "body", m.APISession); err != nil { - return err - } - - if m.APISession != nil { - if err := m.APISession.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("apiSession") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("apiSession") - } - return err - } - } - - return nil -} - -func (m *SessionDetail) validateAPISessionID(formats strfmt.Registry) error { - - if err := validate.Required("apiSessionId", "body", m.APISessionID); err != nil { - return err - } - - return nil -} - -func (m *SessionDetail) validateEdgeRouters(formats strfmt.Registry) error { - - if err := validate.Required("edgeRouters", "body", m.EdgeRouters); err != nil { - return err - } - - for i := 0; i < len(m.EdgeRouters); i++ { - if swag.IsZero(m.EdgeRouters[i]) { // not required - continue - } - - if m.EdgeRouters[i] != nil { - if err := m.EdgeRouters[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SessionDetail) validateIdentityID(formats strfmt.Registry) error { - - if err := validate.Required("identityId", "body", m.IdentityID); err != nil { - return err - } - - return nil -} - -func (m *SessionDetail) validateService(formats strfmt.Registry) error { - - if err := validate.Required("service", "body", m.Service); err != nil { - return err - } - - if m.Service != nil { - if err := m.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -func (m *SessionDetail) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("serviceId", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -func (m *SessionDetail) validateToken(formats strfmt.Registry) error { - - if err := validate.Required("token", "body", m.Token); err != nil { - return err - } - - return nil -} - -func (m *SessionDetail) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this session detail based on the context it is used -func (m *SessionDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAPISession(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEdgeRouters(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionDetail) contextValidateAPISession(ctx context.Context, formats strfmt.Registry) error { - - if m.APISession != nil { - if err := m.APISession.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("apiSession") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("apiSession") - } - return err - } - } - - return nil -} - -func (m *SessionDetail) contextValidateEdgeRouters(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.EdgeRouters); i++ { - - if m.EdgeRouters[i] != nil { - if err := m.EdgeRouters[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("edgeRouters" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("edgeRouters" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *SessionDetail) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - - if m.Service != nil { - if err := m.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -func (m *SessionDetail) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if m.Type != nil { - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionDetail) UnmarshalBinary(b []byte) error { - var res SessionDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/session_edge_router.go b/rest_model/session_edge_router.go deleted file mode 100644 index a144e28d8..000000000 --- a/rest_model/session_edge_router.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SessionEdgeRouter session edge router -// -// swagger:model sessionEdgeRouter -type SessionEdgeRouter struct { - CommonEdgeRouterProperties - - // urls - // Required: true - Urls map[string]string `json:"urls"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *SessionEdgeRouter) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 CommonEdgeRouterProperties - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.CommonEdgeRouterProperties = aO0 - - // AO1 - var dataAO1 struct { - Urls map[string]string `json:"urls"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Urls = dataAO1.Urls - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m SessionEdgeRouter) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.CommonEdgeRouterProperties) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Urls map[string]string `json:"urls"` - } - - dataAO1.Urls = m.Urls - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this session edge router -func (m *SessionEdgeRouter) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CommonEdgeRouterProperties - if err := m.CommonEdgeRouterProperties.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUrls(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionEdgeRouter) validateUrls(formats strfmt.Registry) error { - - if err := validate.Required("urls", "body", m.Urls); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this session edge router based on the context it is used -func (m *SessionEdgeRouter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with CommonEdgeRouterProperties - if err := m.CommonEdgeRouterProperties.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *SessionEdgeRouter) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionEdgeRouter) UnmarshalBinary(b []byte) error { - var res SessionEdgeRouter - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/session_list.go b/rest_model/session_list.go deleted file mode 100644 index e46666ee0..000000000 --- a/rest_model/session_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionList session list -// -// swagger:model sessionList -type SessionList []*SessionDetail - -// Validate validates this session list -func (m SessionList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this session list based on the context it is used -func (m SessionList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/session_management_detail.go b/rest_model/session_management_detail.go deleted file mode 100644 index 82f7ff860..000000000 --- a/rest_model/session_management_detail.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionManagementDetail session management detail -// -// swagger:model sessionManagementDetail -type SessionManagementDetail struct { - SessionDetail - - // service policies - ServicePolicies []*EntityRef `json:"servicePolicies"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *SessionManagementDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 SessionDetail - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.SessionDetail = aO0 - - // AO1 - var dataAO1 struct { - ServicePolicies []*EntityRef `json:"servicePolicies"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.ServicePolicies = dataAO1.ServicePolicies - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m SessionManagementDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.SessionDetail) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - ServicePolicies []*EntityRef `json:"servicePolicies"` - } - - dataAO1.ServicePolicies = m.ServicePolicies - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this session management detail -func (m *SessionManagementDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with SessionDetail - if err := m.SessionDetail.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServicePolicies(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionManagementDetail) validateServicePolicies(formats strfmt.Registry) error { - - if swag.IsZero(m.ServicePolicies) { // not required - return nil - } - - for i := 0; i < len(m.ServicePolicies); i++ { - if swag.IsZero(m.ServicePolicies[i]) { // not required - continue - } - - if m.ServicePolicies[i] != nil { - if err := m.ServicePolicies[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("servicePolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("servicePolicies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this session management detail based on the context it is used -func (m *SessionManagementDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with SessionDetail - if err := m.SessionDetail.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServicePolicies(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SessionManagementDetail) contextValidateServicePolicies(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ServicePolicies); i++ { - - if m.ServicePolicies[i] != nil { - if err := m.ServicePolicies[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("servicePolicies" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("servicePolicies" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SessionManagementDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionManagementDetail) UnmarshalBinary(b []byte) error { - var res SessionManagementDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/session_management_list.go b/rest_model/session_management_list.go deleted file mode 100644 index cd0a8387e..000000000 --- a/rest_model/session_management_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionManagementList session management list -// -// swagger:model sessionManagementList -type SessionManagementList []*SessionManagementDetail - -// Validate validates this session management list -func (m SessionManagementList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this session management list based on the context it is used -func (m SessionManagementList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/session_route_path_detail.go b/rest_model/session_route_path_detail.go deleted file mode 100644 index 3c1b8fa17..000000000 --- a/rest_model/session_route_path_detail.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SessionRoutePathDetail session route path detail -// -// swagger:model sessionRoutePathDetail -type SessionRoutePathDetail struct { - - // route path - RoutePath []string `json:"routePath"` -} - -// Validate validates this session route path detail -func (m *SessionRoutePathDetail) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this session route path detail based on context it is used -func (m *SessionRoutePathDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SessionRoutePathDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SessionRoutePathDetail) UnmarshalBinary(b []byte) error { - var res SessionRoutePathDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/spec_body_detail.go b/rest_model/spec_body_detail.go deleted file mode 100644 index e76692c3c..000000000 --- a/rest_model/spec_body_detail.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// SpecBodyDetail spec body detail -// -// swagger:model specBodyDetail -type SpecBodyDetail string - -// Validate validates this spec body detail -func (m SpecBodyDetail) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this spec body detail based on context it is used -func (m SpecBodyDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/spec_detail.go b/rest_model/spec_detail.go deleted file mode 100644 index 9f3646d20..000000000 --- a/rest_model/spec_detail.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SpecDetail spec detail -// -// swagger:model specDetail -type SpecDetail struct { - BaseEntity - - // name - // Required: true - Name *string `json:"name"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *SpecDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Name *string `json:"name"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Name = dataAO1.Name - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m SpecDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Name *string `json:"name"` - } - - dataAO1.Name = m.Name - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this spec detail -func (m *SpecDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SpecDetail) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this spec detail based on the context it is used -func (m *SpecDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *SpecDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SpecDetail) UnmarshalBinary(b []byte) error { - var res SpecDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/spec_list.go b/rest_model/spec_list.go deleted file mode 100644 index ddc652b93..000000000 --- a/rest_model/spec_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SpecList spec list -// -// swagger:model specList -type SpecList []*SpecDetail - -// Validate validates this spec list -func (m SpecList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this spec list based on the context it is used -func (m SpecList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/sub_tags.go b/rest_model/sub_tags.go deleted file mode 100644 index d1f59c0b8..000000000 --- a/rest_model/sub_tags.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// SubTags sub tags -// -// swagger:model subTags -type SubTags map[string]interface{} - -// Validate validates this sub tags -func (m SubTags) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this sub tags based on context it is used -func (m SubTags) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/tags.go b/rest_model/tags.go deleted file mode 100644 index 21879d0db..000000000 --- a/rest_model/tags.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Tags A map of user defined fields and values. The values are limited to the following types/values: null, string, boolean -// -// swagger:model tags -type Tags struct { - SubTags -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *Tags) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 SubTags - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.SubTags = aO0 - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m Tags) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 1) - - aO0, err := swag.WriteJSON(m.SubTags) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this tags -func (m *Tags) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with SubTags - if err := m.SubTags.Validate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this tags based on the context it is used -func (m *Tags) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with SubTags - if err := m.SubTags.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *Tags) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Tags) UnmarshalBinary(b []byte) error { - var res Tags - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/terminator_client_detail.go b/rest_model/terminator_client_detail.go deleted file mode 100644 index c8cf2bfff..000000000 --- a/rest_model/terminator_client_detail.go +++ /dev/null @@ -1,262 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TerminatorClientDetail terminator client detail -// -// swagger:model terminatorClientDetail -type TerminatorClientDetail struct { - BaseEntity - - // identity - // Required: true - Identity *string `json:"identity"` - - // router Id - // Required: true - RouterID *string `json:"routerId"` - - // service - // Required: true - Service *EntityRef `json:"service"` - - // service Id - // Required: true - ServiceID *string `json:"serviceId"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *TerminatorClientDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Identity *string `json:"identity"` - - RouterID *string `json:"routerId"` - - Service *EntityRef `json:"service"` - - ServiceID *string `json:"serviceId"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Identity = dataAO1.Identity - - m.RouterID = dataAO1.RouterID - - m.Service = dataAO1.Service - - m.ServiceID = dataAO1.ServiceID - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m TerminatorClientDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Identity *string `json:"identity"` - - RouterID *string `json:"routerId"` - - Service *EntityRef `json:"service"` - - ServiceID *string `json:"serviceId"` - } - - dataAO1.Identity = m.Identity - - dataAO1.RouterID = m.RouterID - - dataAO1.Service = m.Service - - dataAO1.ServiceID = m.ServiceID - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this terminator client detail -func (m *TerminatorClientDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRouterID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorClientDetail) validateIdentity(formats strfmt.Registry) error { - - if err := validate.Required("identity", "body", m.Identity); err != nil { - return err - } - - return nil -} - -func (m *TerminatorClientDetail) validateRouterID(formats strfmt.Registry) error { - - if err := validate.Required("routerId", "body", m.RouterID); err != nil { - return err - } - - return nil -} - -func (m *TerminatorClientDetail) validateService(formats strfmt.Registry) error { - - if err := validate.Required("service", "body", m.Service); err != nil { - return err - } - - if m.Service != nil { - if err := m.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -func (m *TerminatorClientDetail) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("serviceId", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this terminator client detail based on the context it is used -func (m *TerminatorClientDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorClientDetail) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - - if m.Service != nil { - if err := m.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TerminatorClientDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TerminatorClientDetail) UnmarshalBinary(b []byte) error { - var res TerminatorClientDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/terminator_client_list.go b/rest_model/terminator_client_list.go deleted file mode 100644 index 12ce257c3..000000000 --- a/rest_model/terminator_client_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TerminatorClientList terminator client list -// -// swagger:model terminatorClientList -type TerminatorClientList []*TerminatorClientDetail - -// Validate validates this terminator client list -func (m TerminatorClientList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this terminator client list based on the context it is used -func (m TerminatorClientList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/terminator_cost.go b/rest_model/terminator_cost.go deleted file mode 100644 index 39144cc7c..000000000 --- a/rest_model/terminator_cost.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// TerminatorCost terminator cost -// -// swagger:model terminatorCost -type TerminatorCost int64 - -// Validate validates this terminator cost -func (m TerminatorCost) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.MinimumInt("", "body", int64(m), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("", "body", int64(m), 65535, false); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this terminator cost based on context it is used -func (m TerminatorCost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/terminator_cost_map.go b/rest_model/terminator_cost_map.go deleted file mode 100644 index 9a8c43d47..000000000 --- a/rest_model/terminator_cost_map.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TerminatorCostMap terminator cost map -// -// swagger:model terminatorCostMap -type TerminatorCostMap map[string]*TerminatorCost - -// Validate validates this terminator cost map -func (m TerminatorCostMap) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if swag.IsZero(m[k]) { // not required - continue - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this terminator cost map based on the context it is used -func (m TerminatorCostMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/terminator_create.go b/rest_model/terminator_create.go deleted file mode 100644 index b98faed42..000000000 --- a/rest_model/terminator_create.go +++ /dev/null @@ -1,292 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TerminatorCreate terminator create -// -// swagger:model terminatorCreate -type TerminatorCreate struct { - - // address - // Required: true - Address *string `json:"address"` - - // binding - // Required: true - Binding *string `json:"binding"` - - // cost - Cost *TerminatorCost `json:"cost,omitempty"` - - // identity - Identity string `json:"identity,omitempty"` - - // identity secret - // Format: byte - IdentitySecret strfmt.Base64 `json:"identitySecret,omitempty"` - - // precedence - Precedence TerminatorPrecedence `json:"precedence,omitempty"` - - // router - // Required: true - Router *string `json:"router"` - - // service - // Required: true - Service *string `json:"service"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this terminator create -func (m *TerminatorCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBinding(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRouter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorCreate) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - return nil -} - -func (m *TerminatorCreate) validateBinding(formats strfmt.Registry) error { - - if err := validate.Required("binding", "body", m.Binding); err != nil { - return err - } - - return nil -} - -func (m *TerminatorCreate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if m.Cost != nil { - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorCreate) validatePrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.Precedence) { // not required - return nil - } - - if err := m.Precedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - - return nil -} - -func (m *TerminatorCreate) validateRouter(formats strfmt.Registry) error { - - if err := validate.Required("router", "body", m.Router); err != nil { - return err - } - - return nil -} - -func (m *TerminatorCreate) validateService(formats strfmt.Registry) error { - - if err := validate.Required("service", "body", m.Service); err != nil { - return err - } - - return nil -} - -func (m *TerminatorCreate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this terminator create based on the context it is used -func (m *TerminatorCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorCreate) contextValidateCost(ctx context.Context, formats strfmt.Registry) error { - - if m.Cost != nil { - if err := m.Cost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorCreate) contextValidatePrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Precedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - - return nil -} - -func (m *TerminatorCreate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TerminatorCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TerminatorCreate) UnmarshalBinary(b []byte) error { - var res TerminatorCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/terminator_detail.go b/rest_model/terminator_detail.go deleted file mode 100644 index c5ad1488b..000000000 --- a/rest_model/terminator_detail.go +++ /dev/null @@ -1,548 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TerminatorDetail terminator detail -// -// swagger:model terminatorDetail -type TerminatorDetail struct { - BaseEntity - - // address - // Required: true - Address *string `json:"address"` - - // binding - // Required: true - Binding *string `json:"binding"` - - // cost - // Required: true - Cost *TerminatorCost `json:"cost"` - - // dynamic cost - // Required: true - DynamicCost *TerminatorCost `json:"dynamicCost"` - - // identity - // Required: true - Identity *string `json:"identity"` - - // precedence - // Required: true - Precedence *TerminatorPrecedence `json:"precedence"` - - // router - // Required: true - Router *EntityRef `json:"router"` - - // router Id - // Required: true - RouterID *string `json:"routerId"` - - // service - // Required: true - Service *EntityRef `json:"service"` - - // service Id - // Required: true - ServiceID *string `json:"serviceId"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *TerminatorDetail) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 BaseEntity - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.BaseEntity = aO0 - - // AO1 - var dataAO1 struct { - Address *string `json:"address"` - - Binding *string `json:"binding"` - - Cost *TerminatorCost `json:"cost"` - - DynamicCost *TerminatorCost `json:"dynamicCost"` - - Identity *string `json:"identity"` - - Precedence *TerminatorPrecedence `json:"precedence"` - - Router *EntityRef `json:"router"` - - RouterID *string `json:"routerId"` - - Service *EntityRef `json:"service"` - - ServiceID *string `json:"serviceId"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.Address = dataAO1.Address - - m.Binding = dataAO1.Binding - - m.Cost = dataAO1.Cost - - m.DynamicCost = dataAO1.DynamicCost - - m.Identity = dataAO1.Identity - - m.Precedence = dataAO1.Precedence - - m.Router = dataAO1.Router - - m.RouterID = dataAO1.RouterID - - m.Service = dataAO1.Service - - m.ServiceID = dataAO1.ServiceID - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m TerminatorDetail) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.BaseEntity) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - Address *string `json:"address"` - - Binding *string `json:"binding"` - - Cost *TerminatorCost `json:"cost"` - - DynamicCost *TerminatorCost `json:"dynamicCost"` - - Identity *string `json:"identity"` - - Precedence *TerminatorPrecedence `json:"precedence"` - - Router *EntityRef `json:"router"` - - RouterID *string `json:"routerId"` - - Service *EntityRef `json:"service"` - - ServiceID *string `json:"serviceId"` - } - - dataAO1.Address = m.Address - - dataAO1.Binding = m.Binding - - dataAO1.Cost = m.Cost - - dataAO1.DynamicCost = m.DynamicCost - - dataAO1.Identity = m.Identity - - dataAO1.Precedence = m.Precedence - - dataAO1.Router = m.Router - - dataAO1.RouterID = m.RouterID - - dataAO1.Service = m.Service - - dataAO1.ServiceID = m.ServiceID - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this terminator detail -func (m *TerminatorDetail) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBinding(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDynamicCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIdentity(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRouter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRouterID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorDetail) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - return nil -} - -func (m *TerminatorDetail) validateBinding(formats strfmt.Registry) error { - - if err := validate.Required("binding", "body", m.Binding); err != nil { - return err - } - - return nil -} - -func (m *TerminatorDetail) validateCost(formats strfmt.Registry) error { - - if err := validate.Required("cost", "body", m.Cost); err != nil { - return err - } - - if err := validate.Required("cost", "body", m.Cost); err != nil { - return err - } - - if m.Cost != nil { - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) validateDynamicCost(formats strfmt.Registry) error { - - if err := validate.Required("dynamicCost", "body", m.DynamicCost); err != nil { - return err - } - - if err := validate.Required("dynamicCost", "body", m.DynamicCost); err != nil { - return err - } - - if m.DynamicCost != nil { - if err := m.DynamicCost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dynamicCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dynamicCost") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) validateIdentity(formats strfmt.Registry) error { - - if err := validate.Required("identity", "body", m.Identity); err != nil { - return err - } - - return nil -} - -func (m *TerminatorDetail) validatePrecedence(formats strfmt.Registry) error { - - if err := validate.Required("precedence", "body", m.Precedence); err != nil { - return err - } - - if err := validate.Required("precedence", "body", m.Precedence); err != nil { - return err - } - - if m.Precedence != nil { - if err := m.Precedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) validateRouter(formats strfmt.Registry) error { - - if err := validate.Required("router", "body", m.Router); err != nil { - return err - } - - if m.Router != nil { - if err := m.Router.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("router") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("router") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) validateRouterID(formats strfmt.Registry) error { - - if err := validate.Required("routerId", "body", m.RouterID); err != nil { - return err - } - - return nil -} - -func (m *TerminatorDetail) validateService(formats strfmt.Registry) error { - - if err := validate.Required("service", "body", m.Service); err != nil { - return err - } - - if m.Service != nil { - if err := m.Service.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) validateServiceID(formats strfmt.Registry) error { - - if err := validate.Required("serviceId", "body", m.ServiceID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this terminator detail based on the context it is used -func (m *TerminatorDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with BaseEntity - if err := m.BaseEntity.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDynamicCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRouter(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateService(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorDetail) contextValidateCost(ctx context.Context, formats strfmt.Registry) error { - - if m.Cost != nil { - if err := m.Cost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) contextValidateDynamicCost(ctx context.Context, formats strfmt.Registry) error { - - if m.DynamicCost != nil { - if err := m.DynamicCost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dynamicCost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dynamicCost") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) contextValidatePrecedence(ctx context.Context, formats strfmt.Registry) error { - - if m.Precedence != nil { - if err := m.Precedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) contextValidateRouter(ctx context.Context, formats strfmt.Registry) error { - - if m.Router != nil { - if err := m.Router.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("router") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("router") - } - return err - } - } - - return nil -} - -func (m *TerminatorDetail) contextValidateService(ctx context.Context, formats strfmt.Registry) error { - - if m.Service != nil { - if err := m.Service.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TerminatorDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TerminatorDetail) UnmarshalBinary(b []byte) error { - var res TerminatorDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/terminator_list.go b/rest_model/terminator_list.go deleted file mode 100644 index 3d347d4d6..000000000 --- a/rest_model/terminator_list.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TerminatorList terminator list -// -// swagger:model terminatorList -type TerminatorList []*TerminatorDetail - -// Validate validates this terminator list -func (m TerminatorList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this terminator list based on the context it is used -func (m TerminatorList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/terminator_patch.go b/rest_model/terminator_patch.go deleted file mode 100644 index ac986aba6..000000000 --- a/rest_model/terminator_patch.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TerminatorPatch terminator patch -// -// swagger:model terminatorPatch -type TerminatorPatch struct { - - // address - Address string `json:"address,omitempty"` - - // binding - Binding string `json:"binding,omitempty"` - - // cost - Cost *TerminatorCost `json:"cost,omitempty"` - - // precedence - Precedence TerminatorPrecedence `json:"precedence,omitempty"` - - // router - Router string `json:"router,omitempty"` - - // service - Service string `json:"service,omitempty"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this terminator patch -func (m *TerminatorPatch) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorPatch) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if m.Cost != nil { - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorPatch) validatePrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.Precedence) { // not required - return nil - } - - if err := m.Precedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - - return nil -} - -func (m *TerminatorPatch) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this terminator patch based on the context it is used -func (m *TerminatorPatch) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorPatch) contextValidateCost(ctx context.Context, formats strfmt.Registry) error { - - if m.Cost != nil { - if err := m.Cost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorPatch) contextValidatePrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Precedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - - return nil -} - -func (m *TerminatorPatch) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TerminatorPatch) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TerminatorPatch) UnmarshalBinary(b []byte) error { - var res TerminatorPatch - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/terminator_precedence.go b/rest_model/terminator_precedence.go deleted file mode 100644 index eee6defda..000000000 --- a/rest_model/terminator_precedence.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// TerminatorPrecedence terminator precedence -// -// swagger:model terminatorPrecedence -type TerminatorPrecedence string - -func NewTerminatorPrecedence(value TerminatorPrecedence) *TerminatorPrecedence { - v := value - return &v -} - -const ( - - // TerminatorPrecedenceDefault captures enum value "default" - TerminatorPrecedenceDefault TerminatorPrecedence = "default" - - // TerminatorPrecedenceRequired captures enum value "required" - TerminatorPrecedenceRequired TerminatorPrecedence = "required" - - // TerminatorPrecedenceFailed captures enum value "failed" - TerminatorPrecedenceFailed TerminatorPrecedence = "failed" -) - -// for schema -var terminatorPrecedenceEnum []interface{} - -func init() { - var res []TerminatorPrecedence - if err := json.Unmarshal([]byte(`["default","required","failed"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - terminatorPrecedenceEnum = append(terminatorPrecedenceEnum, v) - } -} - -func (m TerminatorPrecedence) validateTerminatorPrecedenceEnum(path, location string, value TerminatorPrecedence) error { - if err := validate.EnumCase(path, location, value, terminatorPrecedenceEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this terminator precedence -func (m TerminatorPrecedence) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateTerminatorPrecedenceEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this terminator precedence based on context it is used -func (m TerminatorPrecedence) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/terminator_precedence_map.go b/rest_model/terminator_precedence_map.go deleted file mode 100644 index 88bc7474a..000000000 --- a/rest_model/terminator_precedence_map.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" -) - -// TerminatorPrecedenceMap terminator precedence map -// -// swagger:model terminatorPrecedenceMap -type TerminatorPrecedenceMap map[string]TerminatorPrecedence - -// Validate validates this terminator precedence map -func (m TerminatorPrecedenceMap) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this terminator precedence map based on the context it is used -func (m TerminatorPrecedenceMap) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/rest_model/terminator_update.go b/rest_model/terminator_update.go deleted file mode 100644 index 3ca4fd173..000000000 --- a/rest_model/terminator_update.go +++ /dev/null @@ -1,285 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TerminatorUpdate terminator update -// -// swagger:model terminatorUpdate -type TerminatorUpdate struct { - - // address - // Required: true - Address *string `json:"address"` - - // binding - // Required: true - Binding *string `json:"binding"` - - // cost - Cost *TerminatorCost `json:"cost,omitempty"` - - // precedence - Precedence TerminatorPrecedence `json:"precedence,omitempty"` - - // router - // Required: true - Router *string `json:"router"` - - // service - // Required: true - Service *string `json:"service"` - - // tags - Tags *Tags `json:"tags,omitempty"` -} - -// Validate validates this terminator update -func (m *TerminatorUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBinding(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCost(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrecedence(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRouter(formats); err != nil { - res = append(res, err) - } - - if err := m.validateService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTags(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorUpdate) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - return nil -} - -func (m *TerminatorUpdate) validateBinding(formats strfmt.Registry) error { - - if err := validate.Required("binding", "body", m.Binding); err != nil { - return err - } - - return nil -} - -func (m *TerminatorUpdate) validateCost(formats strfmt.Registry) error { - if swag.IsZero(m.Cost) { // not required - return nil - } - - if m.Cost != nil { - if err := m.Cost.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorUpdate) validatePrecedence(formats strfmt.Registry) error { - if swag.IsZero(m.Precedence) { // not required - return nil - } - - if err := m.Precedence.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - - return nil -} - -func (m *TerminatorUpdate) validateRouter(formats strfmt.Registry) error { - - if err := validate.Required("router", "body", m.Router); err != nil { - return err - } - - return nil -} - -func (m *TerminatorUpdate) validateService(formats strfmt.Registry) error { - - if err := validate.Required("service", "body", m.Service); err != nil { - return err - } - - return nil -} - -func (m *TerminatorUpdate) validateTags(formats strfmt.Registry) error { - if swag.IsZero(m.Tags) { // not required - return nil - } - - if m.Tags != nil { - if err := m.Tags.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// ContextValidate validate this terminator update based on the context it is used -func (m *TerminatorUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCost(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrecedence(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTags(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TerminatorUpdate) contextValidateCost(ctx context.Context, formats strfmt.Registry) error { - - if m.Cost != nil { - if err := m.Cost.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cost") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("cost") - } - return err - } - } - - return nil -} - -func (m *TerminatorUpdate) contextValidatePrecedence(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Precedence.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("precedence") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("precedence") - } - return err - } - - return nil -} - -func (m *TerminatorUpdate) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { - - if m.Tags != nil { - if err := m.Tags.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tags") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tags") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TerminatorUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TerminatorUpdate) UnmarshalBinary(b []byte) error { - var res TerminatorUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/trace_detail.go b/rest_model/trace_detail.go deleted file mode 100644 index 490bd05c3..000000000 --- a/rest_model/trace_detail.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TraceDetail trace detail -// -// swagger:model traceDetail -type TraceDetail struct { - - // enabled - Enabled bool `json:"enabled,omitempty"` - - // trace Id - TraceID string `json:"traceId,omitempty"` - - // until - // Format: date-time - Until strfmt.DateTime `json:"until,omitempty"` -} - -// Validate validates this trace detail -func (m *TraceDetail) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUntil(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TraceDetail) validateUntil(formats strfmt.Registry) error { - if swag.IsZero(m.Until) { // not required - return nil - } - - if err := validate.FormatOf("until", "body", "date-time", m.Until.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this trace detail based on context it is used -func (m *TraceDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TraceDetail) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TraceDetail) UnmarshalBinary(b []byte) error { - var res TraceDetail - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/trace_detail_envelope.go b/rest_model/trace_detail_envelope.go deleted file mode 100644 index 58a96c58a..000000000 --- a/rest_model/trace_detail_envelope.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TraceDetailEnvelope trace detail envelope -// -// swagger:model traceDetailEnvelope -type TraceDetailEnvelope struct { - - // data - // Required: true - Data *TraceDetail `json:"data"` - - // meta - // Required: true - Meta *Meta `json:"meta"` -} - -// Validate validates this trace detail envelope -func (m *TraceDetailEnvelope) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateData(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMeta(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TraceDetailEnvelope) validateData(formats strfmt.Registry) error { - - if err := validate.Required("data", "body", m.Data); err != nil { - return err - } - - if m.Data != nil { - if err := m.Data.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *TraceDetailEnvelope) validateMeta(formats strfmt.Registry) error { - - if err := validate.Required("meta", "body", m.Meta); err != nil { - return err - } - - if m.Meta != nil { - if err := m.Meta.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// ContextValidate validate this trace detail envelope based on the context it is used -func (m *TraceDetailEnvelope) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateData(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMeta(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TraceDetailEnvelope) contextValidateData(ctx context.Context, formats strfmt.Registry) error { - - if m.Data != nil { - if err := m.Data.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("data") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("data") - } - return err - } - } - - return nil -} - -func (m *TraceDetailEnvelope) contextValidateMeta(ctx context.Context, formats strfmt.Registry) error { - - if m.Meta != nil { - if err := m.Meta.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("meta") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("meta") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TraceDetailEnvelope) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TraceDetailEnvelope) UnmarshalBinary(b []byte) error { - var res TraceDetailEnvelope - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/trace_spec.go b/rest_model/trace_spec.go deleted file mode 100644 index 4fe0f08c1..000000000 --- a/rest_model/trace_spec.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TraceSpec trace spec -// -// swagger:model traceSpec -type TraceSpec struct { - - // channels - Channels []string `json:"channels"` - - // duration - Duration string `json:"duration,omitempty"` - - // enabled - Enabled bool `json:"enabled,omitempty"` - - // trace Id - TraceID string `json:"traceId,omitempty"` -} - -// Validate validates this trace spec -func (m *TraceSpec) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this trace spec based on context it is used -func (m *TraceSpec) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TraceSpec) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TraceSpec) UnmarshalBinary(b []byte) error { - var res TraceSpec - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/username.go b/rest_model/username.go deleted file mode 100644 index 1a14094b7..000000000 --- a/rest_model/username.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Username username -// -// swagger:model username -type Username string - -// Validate validates this username -func (m Username) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.MinLength("", "body", string(m), 4); err != nil { - return err - } - - if err := validate.MaxLength("", "body", string(m), 100); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this username based on context it is used -func (m Username) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/username_nullable.go b/rest_model/username_nullable.go deleted file mode 100644 index c449cdb5f..000000000 --- a/rest_model/username_nullable.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UsernameNullable username nullable -// -// swagger:model usernameNullable -type UsernameNullable string - -// Validate validates this username nullable -func (m UsernameNullable) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.MinLength("", "body", string(m), 4); err != nil { - return err - } - - if err := validate.MaxLength("", "body", string(m), 100); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this username nullable based on context it is used -func (m UsernameNullable) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/rest_model/version.go b/rest_model/version.go deleted file mode 100644 index 7a4444077..000000000 --- a/rest_model/version.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Version version -// -// swagger:model version -type Version struct { - - // api versions - APIVersions map[string]map[string]APIVersion `json:"apiVersions,omitempty"` - - // build date - // Example: 2020-02-11 16:09:08 - BuildDate string `json:"buildDate,omitempty"` - - // revision - // Example: ea556fc18740 - Revision string `json:"revision,omitempty"` - - // runtime version - // Example: go1.13.5 - RuntimeVersion string `json:"runtimeVersion,omitempty"` - - // version - // Example: v0.9.0 - Version string `json:"version,omitempty"` -} - -// Validate validates this version -func (m *Version) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAPIVersions(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Version) validateAPIVersions(formats strfmt.Registry) error { - if swag.IsZero(m.APIVersions) { // not required - return nil - } - - for k := range m.APIVersions { - - for kk := range m.APIVersions[k] { - - if err := validate.Required("apiVersions"+"."+k+"."+kk, "body", m.APIVersions[k][kk]); err != nil { - return err - } - if val, ok := m.APIVersions[k][kk]; ok { - if err := val.Validate(formats); err != nil { - return err - } - } - - } - - } - - return nil -} - -// ContextValidate validate this version based on the context it is used -func (m *Version) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAPIVersions(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Version) contextValidateAPIVersions(ctx context.Context, formats strfmt.Registry) error { - - for k := range m.APIVersions { - - for kk := range m.APIVersions[k] { - - if val, ok := m.APIVersions[k][kk]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Version) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Version) UnmarshalBinary(b []byte) error { - var res Version - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_model/version_info.go b/rest_model/version_info.go deleted file mode 100644 index b9d2d9dea..000000000 --- a/rest_model/version_info.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// -// Copyright NetFoundry Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// __ __ _ -// \ \ / / (_) -// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ -// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | -// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. -// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | -// __/ | -// |___/ - -package rest_model - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VersionInfo version info -// -// swagger:model versionInfo -type VersionInfo struct { - - // arch - // Required: true - Arch *string `json:"arch"` - - // build date - // Required: true - BuildDate *string `json:"buildDate"` - - // os - // Required: true - Os *string `json:"os"` - - // revision - // Required: true - Revision *string `json:"revision"` - - // version - // Required: true - Version *string `json:"version"` -} - -// Validate validates this version info -func (m *VersionInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateArch(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBuildDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRevision(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVersion(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VersionInfo) validateArch(formats strfmt.Registry) error { - - if err := validate.Required("arch", "body", m.Arch); err != nil { - return err - } - - return nil -} - -func (m *VersionInfo) validateBuildDate(formats strfmt.Registry) error { - - if err := validate.Required("buildDate", "body", m.BuildDate); err != nil { - return err - } - - return nil -} - -func (m *VersionInfo) validateOs(formats strfmt.Registry) error { - - if err := validate.Required("os", "body", m.Os); err != nil { - return err - } - - return nil -} - -func (m *VersionInfo) validateRevision(formats strfmt.Registry) error { - - if err := validate.Required("revision", "body", m.Revision); err != nil { - return err - } - - return nil -} - -func (m *VersionInfo) validateVersion(formats strfmt.Registry) error { - - if err := validate.Required("version", "body", m.Version); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this version info based on context it is used -func (m *VersionInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VersionInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VersionInfo) UnmarshalBinary(b []byte) error { - var res VersionInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/rest_util/authenticate.go b/rest_util/authenticate.go deleted file mode 100644 index 547698245..000000000 --- a/rest_util/authenticate.go +++ /dev/null @@ -1,270 +0,0 @@ -/* - Copyright NetFoundry Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rest_util - -import ( - "context" - "crypto" - "crypto/tls" - "crypto/x509" - "fmt" - openapiclient "github.com/go-openapi/runtime/client" - "github.com/openziti/edge/rest_management_api_client" - "github.com/openziti/edge/rest_management_api_client/authentication" - "github.com/openziti/edge/rest_model" - "net/http" - "net/url" -) - -// Authenticator is an interface that facilitates obtaining an API Session. -type Authenticator interface { - //Authenticate issues an authentication HTTP requests to the designated controller. The method and operation - // of this authentication request is determined by the implementor. - Authenticate(controllerAddress *url.URL) (*rest_model.CurrentAPISessionDetail, error) - - //BuildHttpClient returns a http.Client to use for an API client. This specifically allows - //client certificate authentication to be configured in the http.Client's transport/tls.Config - BuildHttpClient() (*http.Client, error) -} - -// HttpClientFunc allows an external HttpClient to be created and used. -type HttpClientFunc func(tlsClientConfig *tls.Config) (*http.Client, error) - -// TlsConfigFunc allows the tls.Config to be modified before use. -type TlsConfigFunc func() (*tls.Config, error) - -// AuthenticatorBase provides embeddable shared capabilities for all -// authenticators. -type AuthenticatorBase struct { - ConfigTypes rest_model.ConfigTypes - EnvInfo *rest_model.EnvInfo - SdkInfo *rest_model.SdkInfo - HttpClientFunc HttpClientFunc - TlsConfigFunc TlsConfigFunc - RootCas *x509.CertPool -} - -// BuildHttpClientWithModifyTls builds a new http.Client with the provided HttpClientFunc and TlsConfigFunc. -// If not set, default NewHttpClientWithTlsConfig and NewTlsConfig will be used. -func (a *AuthenticatorBase) BuildHttpClientWithModifyTls(modifyTls func(*tls.Config)) (*http.Client, error) { - if a.HttpClientFunc == nil { - a.HttpClientFunc = NewHttpClientWithTlsConfig - } - - if a.TlsConfigFunc == nil { - a.TlsConfigFunc = NewTlsConfig - } - - tlsConfig, err := a.TlsConfigFunc() - tlsConfig.RootCAs = a.RootCas - - if modifyTls != nil { - modifyTls(tlsConfig) - } - - if err != nil { - return nil, err - } - - httpClient, err := a.HttpClientFunc(tlsConfig) - - if err != nil { - return nil, err - } - - return httpClient, err -} - -var _ Authenticator = &AuthenticatorUpdb{} - -// AuthenticatorUpdb is an implementation of Authenticator that can fulfill username/password authentication -// requests. -type AuthenticatorUpdb struct { - AuthenticatorBase - Username string - Password string -} - -func NewAuthenticatorUpdb(username, password string) *AuthenticatorUpdb { - return &AuthenticatorUpdb{ - Username: username, - Password: password, - } -} - -func (a *AuthenticatorUpdb) BuildHttpClient() (*http.Client, error) { - return a.BuildHttpClientWithModifyTls(nil) -} - -func (a *AuthenticatorUpdb) Params() *authentication.AuthenticateParams { - return &authentication.AuthenticateParams{ - Auth: &rest_model.Authenticate{ - ConfigTypes: a.ConfigTypes, - EnvInfo: a.EnvInfo, - SdkInfo: a.SdkInfo, - Username: rest_model.Username(a.Username), - Password: rest_model.Password(a.Password), - }, - Method: "password", - Context: context.Background(), - } -} - -func (a *AuthenticatorUpdb) Authenticate(controllerAddress *url.URL) (*rest_model.CurrentAPISessionDetail, error) { - httpClient, err := a.BuildHttpClientWithModifyTls(nil) - - if err != nil { - return nil, err - } - - clientRuntime := openapiclient.NewWithClient(controllerAddress.Host, rest_management_api_client.DefaultBasePath, rest_management_api_client.DefaultSchemes, httpClient) - - client := rest_management_api_client.New(clientRuntime, nil) - - params := a.Params() - - resp, err := client.Authentication.Authenticate(params) - - if err != nil { - return nil, err - } - - if resp.GetPayload() == nil { - return nil, fmt.Errorf("error, nil payload: %v", resp.Error()) - } - - return resp.GetPayload().Data, nil -} - -var _ Authenticator = &AuthenticatorCert{} - -// AuthenticatorCert is an implementation of Authenticator that can fulfill client certificate authentication -// requests. -type AuthenticatorCert struct { - AuthenticatorBase - Certificate *x509.Certificate - PrivateKey crypto.PrivateKey -} - -func NewAuthenticatorCert(cert *x509.Certificate, privateKey crypto.PrivateKey) *AuthenticatorCert { - return &AuthenticatorCert{ - Certificate: cert, - PrivateKey: privateKey, - } -} - -func (a *AuthenticatorCert) BuildHttpClient() (*http.Client, error) { - return a.BuildHttpClientWithModifyTls(func(config *tls.Config) { - config.Certificates = []tls.Certificate{ - { - PrivateKey: a.PrivateKey, - Leaf: a.Certificate, - }, - } - }) -} - -func (a *AuthenticatorCert) Authenticate(controllerAddress *url.URL) (*rest_model.CurrentAPISessionDetail, error) { - httpClient, err := a.BuildHttpClient() - if err != nil { - return nil, err - } - - clientRuntime := openapiclient.NewWithClient(controllerAddress.Host, rest_management_api_client.DefaultBasePath, rest_management_api_client.DefaultSchemes, httpClient) - - client := rest_management_api_client.New(clientRuntime, nil) - - params := a.Params() - - resp, err := client.Authentication.Authenticate(params) - - if err != nil { - return nil, err - } - - if resp.GetPayload() == nil { - return nil, fmt.Errorf("error, nil payload: %v", resp.Error()) - } - - return resp.GetPayload().Data, nil -} - -func (a *AuthenticatorCert) Params() *authentication.AuthenticateParams { - return &authentication.AuthenticateParams{ - Auth: &rest_model.Authenticate{ - ConfigTypes: a.ConfigTypes, - EnvInfo: a.EnvInfo, - SdkInfo: a.SdkInfo, - }, - Method: "cert'", - Context: context.Background(), - } -} - -type AuthenticatorAuthHeader struct { - AuthenticatorBase - Token string -} - -func NewAuthenticatorAuthHeader(token string) *AuthenticatorAuthHeader { - return &AuthenticatorAuthHeader{ - Token: token, - } -} - -func (a *AuthenticatorAuthHeader) Params() *authentication.AuthenticateParams { - return &authentication.AuthenticateParams{ - Auth: &rest_model.Authenticate{ - ConfigTypes: a.ConfigTypes, - EnvInfo: a.EnvInfo, - SdkInfo: a.SdkInfo, - }, - Method: "jwt", - Context: context.Background(), - } -} - -func (a *AuthenticatorAuthHeader) Authenticate(controllerAddress *url.URL) (*rest_model.CurrentAPISessionDetail, error) { - httpClient, err := a.BuildHttpClientWithModifyTls(nil) - - if err != nil { - return nil, err - } - - clientRuntime := openapiclient.NewWithClient(controllerAddress.Host, rest_management_api_client.DefaultBasePath, rest_management_api_client.DefaultSchemes, httpClient) - - clientRuntime.DefaultAuthentication = &HeaderAuth{ - HeaderName: "Authorization", - HeaderValue: a.Token, - } - - client := rest_management_api_client.New(clientRuntime, nil) - - params := a.Params() - - resp, err := client.Authentication.Authenticate(params) - - if err != nil { - return nil, err - } - - if resp.GetPayload() == nil { - return nil, fmt.Errorf("error, nil payload: %v", resp.Error()) - } - - return resp.GetPayload().Data, nil -} diff --git a/rest_util/capool.go b/rest_util/capool.go deleted file mode 100644 index 6fe4b06e0..000000000 --- a/rest_util/capool.go +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright NetFoundry Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rest_util - -import ( - "crypto/x509" - "encoding/base64" - "fmt" - "github.com/fullsailor/pkcs7" - "io" -) - -// VerifyController will attempt to use the provided x509.CertPool to connect to the provided controller. -// If successful true an no error will be returned. -func VerifyController(controllerAddr string, caPool *x509.CertPool) (bool, error) { - tlsConfig, err := NewTlsConfig() - - if err != nil { - return false, err - } - - tlsConfig.RootCAs = caPool - - httpClient, err := NewHttpClientWithTlsConfig(tlsConfig) - - if err != nil { - return false, err - } - - _, err = httpClient.Get(controllerAddr + "/edge/client/v1/versions") - - if err != nil { - return false, err - } - - return true, nil -} - -// GetControllerWellKnownCas will attempt to connect to a controller and retrieve its PKCS11 well-known CA bundle. -func GetControllerWellKnownCas(controllerAddr string) ([]*x509.Certificate, error) { - tlsConfig, err := NewTlsConfig() - - if err != nil { - return nil, err - } - - tlsConfig.InsecureSkipVerify = true - - httpClient, err := NewHttpClientWithTlsConfig(tlsConfig) - - if err != nil { - return nil, err - } - - resp, err := httpClient.Get(fmt.Sprintf("%v/.well-known/est/cacerts", controllerAddr)) - if err != nil { - return nil, err - } - defer func() { _ = resp.Body.Close() }() - encoded, err := io.ReadAll(resp.Body) - if err != nil { - return nil, err - } - certData, err := base64.StdEncoding.DecodeString(string(encoded)) - if err != nil { - return nil, err - } - certs, err := pkcs7.Parse(certData) - if err != nil { - return nil, err - } - - return certs.Certificates, nil -} diff --git a/rest_util/clients.go b/rest_util/clients.go deleted file mode 100644 index c7474e98f..000000000 --- a/rest_util/clients.go +++ /dev/null @@ -1,173 +0,0 @@ -/* - Copyright NetFoundry Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -// Package rest_util provides helper functions to generate a client for the Ziti Edge REST APIs. It is a meat and -// potato API that is meant to be consumed by higher level implementations (e.g. CLIs). -// -// The main entry functions are: -// - NewEdgeManagementClientWithToken() -// - NewEdgeManagementClientWithUpdb() -// - NewEdgeManagementClientWithCert() -// - NewEdgeManagementClientWithAuthenticator() -// - NewEdgeClientClientWithToken() -// - NewEdgeClientClientWithUpdb() -// - NewEdgeClientClientWithCert() -// - NewEdgeClientClientWithAuthenticator() -// -// `updb` and `cert` are supported with specific helper functions. Any authentication method not supported explicitly -// can use the ***Authenticator helper functions to implement other authentication methods. -// -// An example(s) is provided in the `examples` directory. -package rest_util - -import ( - "crypto" - "crypto/x509" - httptransport "github.com/go-openapi/runtime/client" - "github.com/openziti/edge/rest_client_api_client" - "github.com/openziti/edge/rest_management_api_client" - "github.com/pkg/errors" - "net/http" - "net/url" -) - -// NewEdgeManagementClientWithToken will generate a new rest_management_api_client.ZitiEdgeManagement client based -// upon a provided http.Client, controller address, and an API Session token that has been previously obtained. -func NewEdgeManagementClientWithToken(httpClient *http.Client, apiAddress string, apiSessionToken string) (*rest_management_api_client.ZitiEdgeManagement, error) { - ctrlUrl, err := url.Parse(apiAddress) - - if err != nil { - return nil, err - } - - clientRuntime := httptransport.NewWithClient(ctrlUrl.Host, rest_management_api_client.DefaultBasePath, rest_management_api_client.DefaultSchemes, httpClient) - - clientRuntime.DefaultAuthentication = &ZitiTokenAuth{ - Token: apiSessionToken, - } - - return rest_management_api_client.New(clientRuntime, nil), nil -} - -// NewEdgeManagementClientWithUpdb will generate a new rest_management_api_client.ZitiEdgeManagement client based -// upon a provided http.Client, controller address, and will authenticate via username/password database (updb) -// to obtain an API Session token. -func NewEdgeManagementClientWithUpdb(username, password string, apiAddress string, rootCas *x509.CertPool) (*rest_management_api_client.ZitiEdgeManagement, error) { - auth := NewAuthenticatorUpdb(username, password) - auth.RootCas = rootCas - return NewEdgeManagementClientWithAuthenticator(auth, apiAddress) -} - -// NewEdgeManagementClientWithCert will generate a new rest_management_api_client.ZitiEdgeManagement client based -// upon a provided http.Client, controller address, and will authenticate via client certificate to obtain -// an API Session token. -func NewEdgeManagementClientWithCert(cert *x509.Certificate, privateKey crypto.PrivateKey, apiAddress string, rootCas *x509.CertPool) (*rest_management_api_client.ZitiEdgeManagement, error) { - auth := NewAuthenticatorCert(cert, privateKey) - auth.RootCas = rootCas - return NewEdgeManagementClientWithAuthenticator(auth, apiAddress) -} - -// NewEdgeManagementClientWithAuthenticator will generate a new rest_management_api_client.ZitiEdgeManagement client based -// upon a provided http.Client, controller address, and will authenticate with the provided Authenticator to obtain -// an API Session token. -func NewEdgeManagementClientWithAuthenticator(authenticator Authenticator, apiAddress string) (*rest_management_api_client.ZitiEdgeManagement, error) { - ctrlUrl, err := url.Parse(apiAddress) - - if err != nil { - return nil, err - } - - apiSession, err := authenticator.Authenticate(ctrlUrl) - - if err != nil { - return nil, err - } - - if apiSession.Token == nil || *apiSession.Token == "" { - return nil, errors.New("api session token was empty") - } - - httpClient, err := authenticator.BuildHttpClient() - if err != nil { - return nil, err - } - - return NewEdgeManagementClientWithToken(httpClient, apiAddress, *apiSession.Token) -} - -// NewEdgeClientClientWithToken will generate a new rest_client_api_client.ZitiEdgeClient client based -// upon a provided http.Client, controller address, and an API Session token that has been previously obtained. -func NewEdgeClientClientWithToken(httpClient *http.Client, apiAddress string, apiSessionToken string) (*rest_client_api_client.ZitiEdgeClient, error) { - ctrlUrl, err := url.Parse(apiAddress) - - if err != nil { - return nil, err - } - - clientRuntime := httptransport.NewWithClient(ctrlUrl.Host, rest_client_api_client.DefaultBasePath, rest_client_api_client.DefaultSchemes, httpClient) - - clientRuntime.DefaultAuthentication = &ZitiTokenAuth{ - Token: apiSessionToken, - } - - return rest_client_api_client.New(clientRuntime, nil), nil -} - -// NewEdgeClientClientWithUpdb will generate a new rest_client_api_client.ZitiEdgeClient client based -// upon a provided http.Client, controller address, and will authenticate via username/password database (updb) -// to obtain an API Session token. -func NewEdgeClientClientWithUpdb(username, password string, apiAddress string, rootCas *x509.CertPool) (*rest_client_api_client.ZitiEdgeClient, error) { - auth := NewAuthenticatorUpdb(username, password) - auth.RootCas = rootCas - return NewEdgeClientClientWithAuthenticator(auth, apiAddress) -} - -// NewEdgeClientClientWithCert will generate a new rest_client_api_client.ZitiEdgeClient client based -// upon a provided http.Client, controller address, and will authenticate via client certificate to obtain -// an API Session token. -func NewEdgeClientClientWithCert(cert *x509.Certificate, privateKey crypto.PrivateKey, apiAddress string, rootCas *x509.CertPool) (*rest_client_api_client.ZitiEdgeClient, error) { - auth := NewAuthenticatorCert(cert, privateKey) - auth.RootCas = rootCas - return NewEdgeClientClientWithAuthenticator(auth, apiAddress) -} - -// NewEdgeClientClientWithAuthenticator will generate a new rest_client_api_client.ZitiEdgeClient client based -// upon a provided http.Client, controller address, and will authenticate with the provided Authenticator to obtain -// an API Session token. -func NewEdgeClientClientWithAuthenticator(authenticator Authenticator, apiAddress string) (*rest_client_api_client.ZitiEdgeClient, error) { - ctrlUrl, err := url.Parse(apiAddress) - - if err != nil { - return nil, err - } - - apiSession, err := authenticator.Authenticate(ctrlUrl) - - if err != nil { - return nil, err - } - - if apiSession.Token == nil || *apiSession.Token == "" { - return nil, errors.New("api session token was empty") - } - - httpClient, err := authenticator.BuildHttpClient() - if err != nil { - return nil, err - } - - return NewEdgeClientClientWithToken(httpClient, apiAddress, *apiSession.Token) -} diff --git a/rest_util/examples/ziti-example-list-identities/main.go b/rest_util/examples/ziti-example-list-identities/main.go deleted file mode 100644 index 8dab3d2bc..000000000 --- a/rest_util/examples/ziti-example-list-identities/main.go +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright NetFoundry Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package main - -import ( - "context" - "crypto/x509" - "github.com/openziti/edge/rest_management_api_client/identity" - "github.com/openziti/edge/rest_util" - log "github.com/sirupsen/logrus" -) - -// main is an example usage of the rest_util package. This example is missing the concepts of enrollment. -// Part of enrollment is being delivered a signed JWT that can be used to verify the controller server certificate -// That step is missing from this example. The CA bundle from the well-known endpoint is verified as a sanity -// check against the controller. However, this does not add any extra security, just sanity. -func main() { - ctrlAddress := "https://localhost:1280" - caCerts, err := rest_util.GetControllerWellKnownCas(ctrlAddress) - - if err != nil { - log.Fatal(err) - } - - caPool := x509.NewCertPool() - - for _, ca := range caCerts { - caPool.AddCert(ca) - } - - ok, err := rest_util.VerifyController(ctrlAddress, caPool) - - if err != nil { - log.Fatal(err) - } - - if !ok { - log.Fatal("controller failed CA validation") - } - - client, err := rest_util.NewEdgeManagementClientWithUpdb("admin", "admin", ctrlAddress, caPool) - - if err != nil { - log.Fatal(err) - } - - params := &identity.ListIdentitiesParams{ - Context: context.Background(), - } - - resp, err := client.Identity.ListIdentities(params, nil) - - if err != nil { - log.Fatal(err) - } - - println("\n=== Identity List ===") - for _, identityItem := range resp.GetPayload().Data { - println(*identityItem.Name) - } -} diff --git a/rest_util/util.go b/rest_util/util.go deleted file mode 100644 index cbb3e4c66..000000000 --- a/rest_util/util.go +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright NetFoundry Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package rest_util - -import ( - "crypto/tls" - openApiRuntime "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "net" - "net/http" - "time" -) - -type HeaderAuth struct { - HeaderName string - HeaderValue string -} - -func (e *HeaderAuth) AuthenticateRequest(request openApiRuntime.ClientRequest, _ strfmt.Registry) error { - return request.SetHeaderParam(e.HeaderName, e.HeaderValue) -} - -// ZitiTokenAuth is an implementation of runtime.ClientAuthInfoWriter. It allows an API Session token to be -// injected into out going HTTP requests. -type ZitiTokenAuth struct { - Token string -} - -// AuthenticateRequest injects the API Session token into outgoing requests. -func (e *ZitiTokenAuth) AuthenticateRequest(request openApiRuntime.ClientRequest, _ strfmt.Registry) error { - return request.SetHeaderParam("zt-session", e.Token) -} - -// NewHttpClientWithTlsConfig provides a default HTTP client with generous default timeouts. -func NewHttpClientWithTlsConfig(tlsClientConfig *tls.Config) (*http.Client, error) { - httpClientTransport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 10 * time.Second, - KeepAlive: 10 * time.Second, - }).DialContext, - - ForceAttemptHTTP2: true, - MaxIdleConns: 10, - IdleConnTimeout: 10 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - } - - httpClientTransport.TLSClientConfig = tlsClientConfig - - httpClient := &http.Client{ - Transport: httpClientTransport, - Timeout: 10 * time.Second, - } - return httpClient, nil -} - -// NewTlsConfig creates a tls.Config with default min/max TSL versions. -func NewTlsConfig() (*tls.Config, error) { - return &tls.Config{ - MinVersion: tls.VersionTLS12, - MaxVersion: tls.VersionTLS13, - }, nil -} diff --git a/router/enroll/enroll.go b/router/enroll/enroll.go index 33bf214cb..6016c09d5 100644 --- a/router/enroll/enroll.go +++ b/router/enroll/enroll.go @@ -25,7 +25,7 @@ import ( "errors" "fmt" "github.com/michaelquigley/pfxlog" - "github.com/openziti/edge/rest_model" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/router/internal/edgerouter" "github.com/openziti/fabric/router" "github.com/openziti/identity/certtools" diff --git a/router/xgress_edge/certchecker_test.go b/router/xgress_edge/certchecker_test.go index 6234cc231..091ba90cd 100644 --- a/router/xgress_edge/certchecker_test.go +++ b/router/xgress_edge/certchecker_test.go @@ -545,7 +545,7 @@ func newCertChecker() (*CertExpirationChecker, func()) { Data: nil, } ctrls := env.NewNetworkControllers(time.Second) - ctrls.Add(testChannel) + _, _ = ctrls.Add(testChannel) return NewCertExpirationChecker(id, &edgerouter.Config{}, ctrls, closeNotify), func() { close(closeNotify) } } diff --git a/scripts/generate_rest.ps1 b/scripts/generate_rest.ps1 deleted file mode 100644 index e00d78075..000000000 --- a/scripts/generate_rest.ps1 +++ /dev/null @@ -1,142 +0,0 @@ -$PSDefaultParameterValues += @{ 'New-RegKey:ErrorAction' = 'Stop' } - -$orignalLocaltion = Get-Location -try -{ - - Get-Command swagger -ErrorAction "SilentlyContinue" | Out-Null - if (-not$?) - { - throw "Command 'swagger' not installed. See: https://github.com/go-swagger/go-swagger for installation" - } - - $zitiEdgeDir = Join-Path $PSScriptRoot "../" -Resolve - $zitiSpecSrcDir = Join-Path $PSScriptRoot "../specs/source" -Resolve - - $copyrightFile = Join-Path $PSScriptRoot "template.copyright.txt" -Resolve - - "...generating Open API 2.0 specs from source" - Push-Location $zitiSpecSrcDir - swagger flatten .\client.yml -o ..\client.yml --format yaml - if (-not$?) - { - Pop-Location - throw "Failed to flatten client.yml. See above." - } - - swagger flatten .\management.yml -o ..\management.yml --format yaml - if (-not$?) - { - Pop-Location - throw "Failed to flatten management.yml. See above." - } - - $clientSpec = Join-Path $zitiEdgeDir "/specs/client.yml" -Resolve - $managementSpec = Join-Path $zitiEdgeDir "/specs/management.yml" -Resolve - - - $oldServerPath = Join-Path $zitiEdgeDir "/rest_server" - $oldClientPath = Join-Path $zitiEdgeDir "/rest_client" - - "...removing old server path: $oldServerPath" - Remove-Item $oldServerPath -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - - "...removing old client path: $oldClientPath" - Remove-Item $oldClientPath -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - - $clientServerOutDir = Join-Path $zitiEdgeDir "/rest_client_api_server" - "...removing any existing server from $clientServerOutDir" - Remove-Item $clientServerOutDir -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $clientServerOutDir -ErrorAction "SilentlyContinue" | Out-Null - - $clientClientOutDir = Join-Path $zitiEdgeDir "/rest_client_api_client" - "...removing any existing client from $clientClientOutDir" - Remove-Item $clientClientOutDir -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $clientClientOutDir -ErrorAction "SilentlyContinue" | Out-Null - - $managementServerOutDir = Join-Path $zitiEdgeDir "/rest_management_api_server" - "...removing any existing server from $managementServerOutDir" - Remove-Item $managementServerOutDir -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $managementServerOutDir -ErrorAction "SilentlyContinue" | Out-Null - - $managementClientOutDir = Join-Path $zitiEdgeDir "/rest_management_api_client" - "...removing any existing client from $managementClientOutDir" - Remove-Item $managementClientOutDir -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $managementClientOutDir -ErrorAction "SilentlyContinue" | Out-Null - - $modelPath = Join-Path $zitiEdgeDir "/rest_model" - "...removing any existing model from $modelPath" - Remove-Item $modelPath -Recurse -Force -ErrorAction "SilentlyContinue" | Out-Null - New-Item -ItemType "directory" -Path $modelPath -ErrorAction "SilentlyContinue" | Out-Null - - "...generating Client API server" - swagger generate server --exclude-main --additional-initialism=jwt -f $clientSpec -s rest_client_api_server -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" - if (-not$?) - { - throw "Failed to generate server. See above." - } - - "...generating Client API client" - swagger generate client -f $clientSpec --additional-initialism=jwt -c rest_client_api_client -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" - if (-not$?) - { - throw "Failed to generate client. See above." - } - - "...generating Management API server" - swagger generate server --exclude-main --additional-initialism=jwt -f $managementSpec -s rest_management_api_server -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" - if (-not$?) - { - throw "Failed to generate server. See above." - } - - "...generating Management API client" - swagger generate client -f $managementSpec --additional-initialism=jwt -c rest_management_api_client -t $zitiEdgeDir -q -r $copyrightFile -m "rest_model" - if (-not$?) - { - throw "Failed to generate client. See above." - } - - "...fixing up windows slashes" - # This one file has the command used to generate the server in it w/ paths. The path sep is OS specific. - # On Windows this causes this one file to show changes depending on the OS that generated it. This - # works around those changes from showing up in commits by switching to forward slashes. - # - # There appears to be no option to suppress this line in the `swagger` executable. - $configureFile = Join-Path $managementServerOutDir "/configure_ziti_edge_management.go" -Resolve - - $content = "" - foreach ($line in Get-Content $configureFile) - { - if ($line -match "^//go:generate swagger generate server") - { - $line = $line -replace "\\", "/" - } - - $content = $content + $line + "`n" - } - - $content | Set-Content $configureFile -nonewline - - $configureFile = Join-Path $clientServerOutDir "/configure_ziti_edge_client.go" -Resolve - - $content = "" - foreach ($line in Get-Content $configureFile) - { - if ($line -match "^//go:generate swagger generate server") - { - $line = $line -replace "\\", "/" - } - - $content = $content + $line + "`n" - } - - $content | Set-Content $configureFile -nonewline - -} -catch -{ - [Console]::Error.WriteLine($Error[0]) -} - -Set-Location $orignalLocaltion \ No newline at end of file diff --git a/scripts/generate_rest.sh b/scripts/generate_rest.sh deleted file mode 100755 index 4aa266910..000000000 --- a/scripts/generate_rest.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/bash -e - -command -v swagger >/dev/null 2>&1 || { - echo >&2 "Command 'swagger' not installed. See: https://github.com/go-swagger/go-swagger for installation" - exit 1 -} - -scriptPath=$(realpath $0) -scriptDir=$(dirname "$scriptPath") - -zitiEdgeDir=$(realpath "$scriptDir/..") - -clientSourceSpec=$(realpath "$zitiEdgeDir/specs/source/client.yml") -clientSwagSpec=$(realpath "$zitiEdgeDir/specs/client.yml") - -managementSourceSpec=$(realpath "$zitiEdgeDir/specs/source/management.yml") -managementSwagSpec=$(realpath "$zitiEdgeDir/specs/management.yml") - -copyrightFile=$(realpath "$scriptDir/template.copyright.txt") - -echo "...flattening client spec" -swagger flatten "$clientSourceSpec" -o "$clientSwagSpec" --format yaml -echo "...flattening management spec" -swagger flatten "$managementSourceSpec" -o "$managementSwagSpec" --format yaml - - -oldServerPath=$(realpath "$zitiEdgeDir/rest_server") -echo "...removing any existing server from $oldServerPath" -rm -rf "$oldServerPath" - -oldClientPath=$(realpath "$zitiEdgeDir/rest_client") -echo "...removing any existing client from $oldClientPath" -rm -rf "$oldClientPath" - -clientServerPath=$(realpath "$zitiEdgeDir/rest_client_api_server") -echo "...removing any existing server from $clientServerPath" -rm -rf "$clientServerPath" -mkdir -p "$clientServerPath" - -clientClientPath=$(realpath "$zitiEdgeDir/rest_client_api_client") -echo "...removing any existing client from $clientClientPath" -rm -rf "$clientClientPath" -mkdir -p "$clientClientPath" - -managementServerPath=$(realpath "$zitiEdgeDir/rest_management_api_server") -echo "...removing any existing server from $managementServerPath" -rm -rf "$managementServerPath" -mkdir -p "$managementServerPath" - -managementClientPath=$(realpath "$zitiEdgeDir/rest_management_api_client") -echo "...removing any existing client from $managementClientPath" -rm -rf "$managementClientPath" -mkdir -p "$managementClientPath" - -modelPath=$(realpath "$zitiEdgeDir/rest_model") -echo "...removing any existing model from $modelPath" -rm -rf "$modelPath" -mkdir -p "$modelPath" - - -echo "...generating client api server" -swagger generate server --exclude-main --additional-initialism=jwt -f "$clientSwagSpec" -s rest_client_api_server -t "$zitiEdgeDir" -q -r "$copyrightFile" -m "rest_model" -exit_status=$? -if [ ${exit_status} -ne 0 ]; then - echo "Failed to generate client api server. See above." - exit "${exit_status}" -fi - -echo "...generating client api client" -swagger generate client --additional-initialism=jwt -f "$clientSwagSpec" -c rest_client_api_client -t "$zitiEdgeDir" -q -r "$copyrightFile" -m "rest_model" -exit_status=$? -if [ ${exit_status} -ne 0 ]; then - echo "Failed to generate client api client. See above." - exit "${exit_status}" -fi - -echo "...generating management api server" -swagger generate server --exclude-main --additional-initialism=jwt -f "$managementSwagSpec" -s rest_management_api_server -t "$zitiEdgeDir" -q -r "$copyrightFile" -m "rest_model" -exit_status=$? -if [ ${exit_status} -ne 0 ]; then - echo "Failed to generate management api server. See above." - exit "${exit_status}" -fi - -echo "...generating management api management" -swagger generate client --additional-initialism=jwt -f "$managementSwagSpec" -c rest_management_api_client -t "$zitiEdgeDir" -q -r "$copyrightFile" -m "rest_model" -exit_status=$? -if [ ${exit_status} -ne 0 ]; then - echo "Failed to generate management api client. See above." - exit "${exit_status}" -fi diff --git a/scripts/template.copyright.txt b/scripts/template.copyright.txt deleted file mode 100644 index cd19fd4be..000000000 --- a/scripts/template.copyright.txt +++ /dev/null @@ -1,23 +0,0 @@ - -Copyright NetFoundry Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -__ __ _ -\ \ / / (_) - \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _ - \ \/ \/ / _` | '__| '_ \| | '_ \ / _` | - \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it. - \/ \/ \__,_|_| |_| |_|_|_| |_|\__, | - __/ | - |___/ \ No newline at end of file diff --git a/tests/auth_cert_test.go b/tests/auth_cert_test.go index 938f4e534..7495fed75 100644 --- a/tests/auth_cert_test.go +++ b/tests/auth_cert_test.go @@ -28,10 +28,10 @@ import ( "encoding/pem" "fmt" "github.com/Jeffail/gabs" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/eid" "github.com/openziti/edge/internal/cert" - "github.com/openziti/edge/rest_model" nfPem "github.com/openziti/foundation/v2/pem" "github.com/openziti/sdk-golang/ziti/constants" "github.com/stretchr/testify/require" diff --git a/tests/auth_external_jwt_signer_test.go b/tests/auth_external_jwt_signer_test.go index 433877ac6..3c154a05a 100644 --- a/tests/auth_external_jwt_signer_test.go +++ b/tests/auth_external_jwt_signer_test.go @@ -22,7 +22,7 @@ package tests import ( "github.com/golang-jwt/jwt" "github.com/google/uuid" - "github.com/openziti/edge/rest_model" + "github.com/openziti/edge-api/rest_model" nfpem "github.com/openziti/foundation/v2/pem" "net/http" "testing" diff --git a/tests/auth_policy_test.go b/tests/auth_policy_test.go index 8a8f4eec4..13a90071c 100644 --- a/tests/auth_policy_test.go +++ b/tests/auth_policy_test.go @@ -22,8 +22,8 @@ package tests import ( "github.com/golang-jwt/jwt" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/persistence" - "github.com/openziti/edge/rest_model" nfpem "github.com/openziti/foundation/v2/pem" "net/http" "testing" diff --git a/tests/authenticate.go b/tests/authenticate.go index 7fc745b4f..01651eb9b 100644 --- a/tests/authenticate.go +++ b/tests/authenticate.go @@ -24,9 +24,9 @@ import ( "fmt" "github.com/Jeffail/gabs" "github.com/michaelquigley/pfxlog" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" "github.com/openziti/edge/internal/cert" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/stringz" "github.com/openziti/sdk-golang/ziti" "github.com/openziti/sdk-golang/ziti/constants" diff --git a/tests/authenticator_test.go b/tests/authenticator_test.go index a66ecd48d..9431c4ad4 100644 --- a/tests/authenticator_test.go +++ b/tests/authenticator_test.go @@ -23,9 +23,9 @@ import ( "fmt" "github.com/Jeffail/gabs" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/apierror" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "github.com/stretchr/testify/require" "net/http" diff --git a/tests/ca_test.go b/tests/ca_test.go index 4137cb1b2..d681238da 100644 --- a/tests/ca_test.go +++ b/tests/ca_test.go @@ -6,9 +6,9 @@ package tests import ( "fmt" "github.com/Jeffail/gabs" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "net/http" "sort" "testing" diff --git a/tests/ca_traffic_test.go b/tests/ca_traffic_test.go index 72d80a0a6..08166a64f 100644 --- a/tests/ca_traffic_test.go +++ b/tests/ca_traffic_test.go @@ -10,8 +10,8 @@ import ( "crypto/x509/pkix" "encoding/pem" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" nfpem "github.com/openziti/foundation/v2/pem" id "github.com/openziti/identity" "github.com/openziti/sdk-golang/ziti" diff --git a/tests/config_test.go b/tests/config_test.go index 5fd778105..3b061fefb 100644 --- a/tests/config_test.go +++ b/tests/config_test.go @@ -20,8 +20,8 @@ package tests import ( "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "github.com/openziti/foundation/v2/errorz" "math" "net/http" diff --git a/tests/context.go b/tests/context.go index 7c414c6d1..70d339651 100644 --- a/tests/context.go +++ b/tests/context.go @@ -28,9 +28,9 @@ import ( "fmt" "github.com/go-openapi/strfmt" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/edge_common" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "github.com/openziti/edge/router/enroll" "github.com/openziti/edge/router/fabric" "github.com/openziti/edge/router/xgress_edge" diff --git a/tests/enrollment_ca_auto_test.go b/tests/enrollment_ca_auto_test.go index 89616dc63..914f5e105 100644 --- a/tests/enrollment_ca_auto_test.go +++ b/tests/enrollment_ca_auto_test.go @@ -29,8 +29,8 @@ import ( "crypto/x509/pkix" "encoding/pem" "fmt" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "math/big" "net/http" "strings" diff --git a/tests/enrollment_create_test.go b/tests/enrollment_create_test.go index 85a0bb109..636497423 100644 --- a/tests/enrollment_create_test.go +++ b/tests/enrollment_create_test.go @@ -20,8 +20,8 @@ package tests import ( "encoding/pem" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "net/http" "testing" "time" diff --git a/tests/enrollment_identity_extend_test.go b/tests/enrollment_identity_extend_test.go index a39a026e4..b4cb512be 100644 --- a/tests/enrollment_identity_extend_test.go +++ b/tests/enrollment_identity_extend_test.go @@ -28,8 +28,8 @@ import ( "encoding/json" "encoding/pem" "fmt" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" nfpem "github.com/openziti/foundation/v2/pem" "github.com/openziti/identity/certtools" "github.com/openziti/sdk-golang/ziti/constants" diff --git a/tests/enrollment_refresh_test.go b/tests/enrollment_refresh_test.go index 8fb1d5352..0220af1b3 100644 --- a/tests/enrollment_refresh_test.go +++ b/tests/enrollment_refresh_test.go @@ -21,7 +21,7 @@ package tests import ( "github.com/google/uuid" - "github.com/openziti/edge/rest_model" + "github.com/openziti/edge-api/rest_model" "net/http" "testing" "time" diff --git a/tests/external_jwt_signer_test.go b/tests/external_jwt_signer_test.go index 6228962dc..3be146059 100644 --- a/tests/external_jwt_signer_test.go +++ b/tests/external_jwt_signer_test.go @@ -27,8 +27,8 @@ import ( "crypto/x509" "crypto/x509/pkix" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/persistence" - "github.com/openziti/edge/rest_model" nfpem "github.com/openziti/foundation/v2/pem" "math/big" "net/http" diff --git a/tests/identity_test.go b/tests/identity_test.go index 8333be624..536b287f9 100644 --- a/tests/identity_test.go +++ b/tests/identity_test.go @@ -23,9 +23,9 @@ import ( "github.com/Jeffail/gabs" "github.com/golang-jwt/jwt" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/controller/persistence" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" nfpem "github.com/openziti/foundation/v2/pem" "github.com/openziti/foundation/v2/stringz" "net/http" diff --git a/tests/posture_check_mfa_test.go b/tests/posture_check_mfa_test.go index 928598887..ac6d3b2ab 100644 --- a/tests/posture_check_mfa_test.go +++ b/tests/posture_check_mfa_test.go @@ -21,8 +21,8 @@ package tests import ( "fmt" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "net/http" "net/url" "testing" diff --git a/tests/posture_check_process_multi_test.go b/tests/posture_check_process_multi_test.go index e182cda62..f00c5573d 100644 --- a/tests/posture_check_process_multi_test.go +++ b/tests/posture_check_process_multi_test.go @@ -22,8 +22,8 @@ package tests import ( "github.com/Jeffail/gabs" "github.com/google/uuid" + "github.com/openziti/edge-api/rest_model" "github.com/openziti/edge/eid" - "github.com/openziti/edge/rest_model" "net/http" "testing" ) diff --git a/tests/router_reenroll_test.go b/tests/router_reenroll_test.go index d4d5a20e3..a30a9fd12 100644 --- a/tests/router_reenroll_test.go +++ b/tests/router_reenroll_test.go @@ -20,7 +20,7 @@ package tests import ( - "github.com/openziti/edge/rest_model" + "github.com/openziti/edge-api/rest_model" "net/http" "testing" )